Skip to content
| Marketplace
Sign in
Visual Studio Code>Chat>VS Code Copilot as ServiceNew to Visual Studio Code? Get it now.
VS Code Copilot as Service

VS Code Copilot as Service

Marty Zhou

|
156 installs
| (1) | Free
Expose GitHub Copilot as an Ollama-compatible HTTP API server for external applications
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code Copilot as Service

License: MIT VS Code Ollama Compatible OpenAI Compatible

Expose GitHub Copilot as a local, Ollama- and OpenAI-compatible HTTP service with workspace intelligence, automatic tool calling, and an interactive web dashboard.


Table of Contents

  • VS Code Copilot as Service
    • Table of Contents
    • Overview
    • Quick Start
      • 1. Web Dashboard (Interactive Test)
      • 2. Ollama API (curl & Python)
        • curl
        • Python (ollama library or requests)
      • 3. OpenAI API (curl & Python SDK)
        • curl
        • Official OpenAI Python SDK
    • AI Agent Quick Reference
      • Connection & Environment
      • Available Models
    • API Reference
      • Ollama-Compatible Endpoints (/api/*)
        • Example: POST /api/chat
      • OpenAI-Compatible Endpoints (/v1/*)
        • Example: POST /v1/chat/completions
      • Workspace File Endpoints (/v1/workspace/files/*)
        • Example: Read Workspace File
        • Example: Search Workspace Code
      • Tool Invocation Endpoints (/v1/tools*)
    • Client Integrations
      • Ollama CLI & Open WebUI
      • LangChain & LlamaIndex
        • LangChain (Python)
        • LlamaIndex (Python)
      • Continue.dev
    • Advanced Features
      • Automatic Tool Execution
      • Workspace Context & Code Search
      • JSON Mode
    • Configuration & Commands
      • Settings
      • Command Palette
    • Development & Testing
      • Prerequisites
      • Build & Test
    • License & Disclaimer

Overview

VS Code Copilot as Service bridges your active GitHub Copilot subscription to local developer tools, AI agents, and frameworks by running a local HTTP server inside VS Code (default: http://localhost:11434).

  • Dual API Compatibility: Drop-in compatible with both Ollama (/api/chat, /api/generate, /api/tags) and OpenAI (/v1/chat/completions, /v1/models).
  • Interactive Web Dashboard: Navigate to http://localhost:11434/ in any browser to verify service status and test LLM requests with one click.
  • Default Fast Model: Defaults to claude-haiku-5.5 for low latency and high quality, while supporting all model families in your Copilot subscription.
  • VS Code Workspace Intelligence: Agents can read, search, edit, and open files in your active workspace through authenticated REST endpoints.
  • Built-in Tool Invocation: Transparently executes tool calls (including VS Code's native fileSearch) and feeds results back to the model.

Quick Start

1. Web Dashboard (Interactive Test)

Once the extension is active in VS Code, open:

http://localhost:11434/

The browser displays an interactive control panel where you can:

  • Verify that the server is running (200 OK).
  • Select any available model from your Copilot subscription.
  • Pick preset prompts (Greeting, Code, Summary).
  • Click Test LLM Request to inspect streaming/non-streaming responses, latency, and raw JSON.

2. Ollama API (curl & Python)

curl

# Health check
curl http://localhost:11434/

# List models
curl http://localhost:11434/api/tags

# Chat request
curl http://localhost:11434/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-5.5",
    "messages": [{"role": "user", "content": "Explain this project in one sentence."}],
    "stream": false
  }'

Python (ollama library or requests)

import requests

response = requests.post("http://localhost:11434/api/chat", json={
    "model": "claude-haiku-5.5",
    "messages": [{"role": "user", "content": "Hello Copilot!"}],
    "stream": False
})

print(response.json()["message"]["content"])

3. OpenAI API (curl & Python SDK)

curl

curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-5.5",
    "messages": [{"role": "user", "content": "Write a hello world in Python."}]
  }'

Official OpenAI Python SDK

from openai import OpenAI

# Point client to local Copilot service
client = OpenAI(
    base_url="http://localhost:11434/v1",
    api_key="copilot-local"  # Any string is accepted
)

response = client.chat.completions.create(
    model="claude-haiku-5.5",
    messages=[{"role": "user", "content": "Write a quick test."}]
)

print(response.choices[0].message.content)

AI Agent Quick Reference

For autonomous coding agents, LLM orchestrators, and AI frameworks (e.g. LangChain, LlamaIndex, OpenClaw, AutoGen, CrewAI, Cursor):

Connection & Environment

Property Value Notes
Base URL (Ollama) http://localhost:11434 Compatible with Ollama SDKs and CLIs
Base URL (OpenAI) http://localhost:11434/v1 Compatible with OpenAI SDKs
API Key Not required (any string, e.g. "copilot") Local trusted connection
Default Model claude-haiku-5.5 Fast, high-context default
Health Check GET /health or GET / Returns {"status":"ok"} or "Copilot as a Service is running"

Recommended Environment Variables:

export OLLAMA_HOST="http://localhost:11434"
export OPENAI_BASE_URL="http://localhost:11434/v1"
export OPENAI_API_KEY="copilot-local"

Available Models

Available models reflect your active GitHub Copilot subscription. Query dynamically:

# Ollama format
curl http://localhost:11434/api/tags

# OpenAI format
curl http://localhost:11434/v1/models

API Reference

Ollama-Compatible Endpoints (/api/*)

Method Endpoint Description Request Body
GET / Root status. Returns HTML dashboard for browsers (Accept: text/html) or plain text for API clients None
GET /api/version Returns server version ({"version": "0.5.7"}) None
GET /api/tags List available models None
GET /api/ps List running models (alias of /api/tags) None
POST /api/show Show model parameters and details {"model": "claude-haiku-5.5"}
POST /api/generate Generate completion for a single prompt {"model": "...", "prompt": "...", "stream": false}
POST /api/chat Multi-turn chat completion {"model": "...", "messages": [...], "stream": false}

Example: POST /api/chat

{
  "model": "claude-haiku-5.5",
  "messages": [
    { "role": "system", "content": "You are a concise assistant." },
    { "role": "user", "content": "Define recursion." }
  ],
  "stream": false
}

Response:

{
  "model": "claude-haiku-5.5",
  "created_at": "2026-10-10T15:00:00.000Z",
  "message": {
    "role": "assistant",
    "content": "Recursion is a method where a function calls itself to solve smaller instances of a problem."
  },
  "done": true,
  "done_reason": "stop",
  "total_duration": 425000000
}

OpenAI-Compatible Endpoints (/v1/*)

Method Endpoint Description
GET /health Server health check ({"status": "ok"})
GET /v1/models List available models in OpenAI format
POST /v1/chat/completions Create chat completion (supports streaming, tools, context)

Example: POST /v1/chat/completions

{
  "model": "claude-haiku-5.5",
  "messages": [
    { "role": "user", "content": "What is the capital of France?" }
  ],
  "stream": false
}

Response:

{
  "id": "chatcmpl-1728572400000",
  "object": "chat.completion",
  "created": 1728572400,
  "model": "claude-haiku-5.5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ]
}

Workspace File Endpoints (/v1/workspace/files/*)

Allows external tools and agents to inspect and manipulate files in the open VS Code workspace:

Method Endpoint Payload Parameters Description
POST /v1/workspace/files/read filePath (string), startLine? (num), endLine? (num) Read entire file or line range
POST /v1/workspace/files/add filePath (string), content (string), overwrite? (bool) Create or overwrite a file
POST /v1/workspace/files/edit filePath (string), oldString (string), newString (string) Replace specific text in a file
POST /v1/workspace/files/search query (string), filePattern? (string), maxResults? (num) Search workspace text
POST /v1/workspace/files/open filePath (string), line? (num), column? (num) Open file at line in editor

Example: Read Workspace File

curl http://localhost:11434/v1/workspace/files/read \
  -H "Content-Type: application/json" \
  -d '{"filePath": "package.json", "startLine": 1, "endLine": 15}'

Example: Search Workspace Code

curl http://localhost:11434/v1/workspace/files/search \
  -H "Content-Type: application/json" \
  -d '{"query": "handleChatCompletions", "maxResults": 5}'

Tool Invocation Endpoints (/v1/tools*)

Method Endpoint Description
GET /v1/tools List all available VS Code tools and extensions
POST /v1/tools/invoke Directly invoke a tool with parameters ({"tool_name": "...", "parameters": {...}})

Client Integrations

Ollama CLI & Open WebUI

Because Copilot Local exposes standard Ollama routes on port 11434, apps configured for Ollama connect directly:

  • Open WebUI: Set Ollama Base URL to http://localhost:11434. Models returned by /api/tags appear automatically.
  • LangFlow / OpenClaw: Select Ollama as model provider and enter http://localhost:11434.

LangChain & LlamaIndex

LangChain (Python)

from langchain_community.chat_models import ChatOllama

llm = ChatOllama(
    base_url="http://localhost:11434",
    model="claude-haiku-5.5"
)

response = llm.invoke("Summarize agile software development.")
print(response.content)

LlamaIndex (Python)

from llama_index.llms.ollama import Ollama

llm = Ollama(
    base_url="http://localhost:11434",
    model="claude-haiku-5.5"
)

response = llm.complete("Explain neural networks simply.")
print(response.text)

Continue.dev

In ~/.continue/config.json:

{
  "models": [
    {
      "title": "Copilot Local (Haiku)",
      "provider": "ollama",
      "model": "claude-haiku-5.5",
      "apiBase": "http://localhost:11434"
    }
  ]
}

Advanced Features

Automatic Tool Execution

Include OpenAI-formatted tool schemas in /v1/chat/completions. When the model selects a tool, the server executes it against VS Code and returns the final answer:

{
  "model": "claude-haiku-5.5",
  "messages": [{"role": "user", "content": "Find where routeRegistry is defined"}],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "fileSearch",
        "description": "Search workspace files",
        "parameters": {
          "type": "object",
          "properties": { "query": { "type": "string" } },
          "required": ["query"]
        }
      }
    }
  ],
  "tool_choice": "auto"
}

Workspace Context & Code Search

You can attach files and automated searches directly to /v1/chat/completions:

{
  "model": "claude-haiku-5.5",
  "messages": [{"role": "user", "content": "Review these routes"}],
  "fileReads": ["src/routes.ts", "package.json"],
  "codeSearch": {
    "query": "handleOllamaChat",
    "maxResults": 3
  },
  "suggestNextActions": true
}

JSON Mode

Enforce strict JSON output by setting response_format:

{
  "model": "claude-haiku-5.5",
  "messages": [{"role": "user", "content": "List 3 colors with hex values"}],
  "response_format": { "type": "json_object" }
}

Configuration & Commands

Settings

Open VS Code Settings (Cmd+, / Ctrl+,) and search for Copilot Local:

Setting Default Description
copilotLocal.port 11434 HTTP server port (standard Ollama port)
copilotLocal.model claude-haiku-5.5 Default Copilot model family to use
copilotLocal.autoStart true Automatically start the server on VS Code startup
copilotLocal.includeWorkspaceContext false Include open editor and workspace context by default

Command Palette

Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux):

  • Copilot Local: Start Copilot HTTP Server (vscode-copilot-local.start)
  • Copilot Local: Stop Copilot HTTP Server (vscode-copilot-local.stop)
  • Copilot Local: Restart Copilot HTTP Server (vscode-copilot-local.restart)
  • Copilot Local: Select Copilot Model from Subscription (vscode-copilot-local.selectModel)

The status bar shows current state (e.g. $(globe) Copilot:11434). Click it to restart.


Development & Testing

Prerequisites

  • Node.js 20+
  • VS Code 1.105.0+ with active GitHub Copilot subscription

Build & Test

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Run integration test suite against running service (port 11434)
npm test

# Package .vsix extension for local installation
npm run pack

License & Disclaimer

This project is licensed under the MIT License.

Disclaimer: This extension requires an active GitHub Copilot subscription. It is an independent open-source project and is not affiliated with, endorsed by, or sponsored by GitHub, Microsoft, or Anthropic.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft