VS Code Copilot as ServiceExpose 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
OverviewVS 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:
Quick Start1. Web Dashboard (Interactive Test)Once the extension is active in VS Code, open:
The browser displays an interactive control panel where you can:
2. Ollama API (curl & Python)curl
Python (
|
| 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/tagsappear 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.