LAI Compatible Provider for CopilotTurn VS Code Copilot Chat into a gateway for any model: local llama.cpp / Ollama / vLLM servers and OpenAI / Anthropic / Gemini / DeepSeek cloud endpoints — with tool calling, vision and reasoning support. Requires VS Code 1.120+ with GitHub Copilot Chat. Install from the Marketplace ( What it doesCopilot Chat normally talks only to GitHub's own models. This extension registers its own model provider, so the same chat UI can drive:
Quick start1. Zero config: the built-in free modelsOn a fresh install the picker already lists a set of free models shown as 2. Run a local server
3. Add the modelIn
Pick the model in the Copilot Chat model dropdown and start chatting — tools are called automatically. Cloud modelsDeclare an endpoint once in
Prefer explicit entries? Put them in
Built-in free modelsA preset ships with the extension so a fresh install works out of the box:
Notes:
API keysThe model list never prompts for a key. A provider without a key simply appears as a
Leaving the input box empty and pressing Enter clears the stored key. Storage in Secret Storage (OS keychain / Windows Credential Manager):
If a stored key for the same provider exists, it always takes priority over the bundled free key. Local servers (llama.cpp / Ollama / vLLM) need no key; if yours runs with When the upstream rejects a key (401/403) or rate-limits it (429), the extension shows a notification with Add my API key / Open configuration / Hide built-in free models buttons and flags the status bar, instead of dumping the raw upstream error into the transcript. SettingsGlobal
Per model (
|
| Field | Description |
|---|---|
id |
Model id sent to the endpoint |
displayName |
Label shown in the picker |
configId |
Distinguish several configs of the same model |
owned_by |
Provider name that selects the API key; local providers (llamacpp, ollama, vllm) need no key |
baseUrl |
Endpoint for this model; /v1 optional |
apiMode |
openai | openai-responses | ollama | anthropic | gemini | llamacpp | vllm |
headers |
Extra HTTP headers, merged with the defaults |
family |
Model-family label stored with the entry (default lai-compatible); informational only — no behaviour currently keys off it |
delay |
Per-model request spacing in ms (overrides the global setting) |
Context & tokens
| Field | Description |
|---|---|
context_length |
Important: real server window (--ctx-size / n_ctx_train). Wrong values make the adaptive output budget too small and cause "no visible output" |
max_tokens / max_completion_tokens |
Output budget = thinking + answer. Auto when unset: 25% of the context window (at least 32768, raised up to 40% for tool-heavy local requests); cloud models fall back to 4096 |
max_history_messages |
Send only the last N messages (0 or unset = all). Recommended for local models |
max_system_message_length |
Character cap on Copilot's large system prompt (truncation keeps the beginning) |
On a context-window error the extension automatically retries with fewer messages and truncated tool results — no setting needed. To compact long conversations proactively, enable laicopilot.autoCompact (global setting, see above).
Sampling & reasoning
| Field | Description |
|---|---|
temperature / top_p / top_k / min_p |
Sampling parameters, forwarded as-is; unset means "use the server default" |
presence_penalty / frequency_penalty / repetition_penalty |
Penalty parameters (llama.cpp, vLLM, OpenAI, Gemini) |
reasoning |
OpenRouter / xAI style reasoning block: { "effort": "low" … "auto" \| "max", "exclude": true, "max_tokens": … } — exclude keeps reasoning tokens out of the answer |
enable_thinking / thinking.type |
Zai-style thinking switch: true or { "type": "enabled" } turns thinking on, false / "disabled" turns it off |
include_reasoning_in_request |
Send reasoning_content back in assistant messages (required by deepseek-v3.2 and similar models) |
thinking_budget |
Reasoning token cap: -1 disables reasoning, 0 stops thinking immediately, positive sets a cap. Auto when unset: 512 + 140 per tool, capped at 12% of max_tokens and 2048. Overrides the server's --reasoning-budget |
reasoning_effort |
Forwarded to the API; "none" turns off all thinking for that request |
extra.reasoning_watchdog_ms |
Ends a stuck reasoning block (default 60000; 0 = off) |
vision |
Allow image input in chat |
cache_control |
Anthropic prompt-caching breakpoints (Anthropic mode only, default true) |
Configuration UI
laicopilot.openConfig opens a Webview panel (no JSON editing required):
- 📋 Add / edit / delete models — validated form for every field, no JSON editing
- ☁️ Manage cloud providers — add, edit and delete provider endpoints together with their keys
- 🔑 Key management — type keys straight into Secret Storage
- 🔎 Fetch models — pull the live model list of a provider and pick from it instead of typing an ID
- ⚙️ Global settings — delay, retry, auto-compaction, log level, commit language,
read_fileline count - ⇄ Export / import — move your whole setup (models, providers, keys) between machines; note the exported JSON holds keys in plain text
Git commit messages
Mark one model with "useForCommitGeneration": true (or pick it in the configuration UI), then click the wand button in the Source Control toolbar — laicopilot.generateGitCommitMessage does the same from the command palette. laicopilot.commitLanguage and laicopilot.commitMessagePrompt control the output; laicopilot.abortGitCommitMessage stops generation.
Status bar & logging
The L-AI status bar item shows the token usage of the current request (click it to open the configuration UI) and turns red when a key is missing or rejected. Logs are JSON lines under ~/.copilot/laicopilotdev/logs/; enable them with laicopilot.logLevel: "debug".
Troubleshooting
| Symptom | Fix |
|---|---|
A provider shows ⚠ … needs API key |
Run laicopilot.setProviderApikey and pick that provider |
| Model list empty | Check laicopilot.models / laicopilot.cloudProviders; the endpoint must expose GET /models |
| "exceeds the context window" | Set a realistic context_length, then lower max_tokens, set max_history_messages, or turn on laicopilot.autoCompact |
| No visible output / empty reply | Raise max_tokens, set context_length correctly, or set reasoning_effort: "none" |
| Tools never called (llama.cpp) | Start the server with --jinja |
License
MIT — see LICENSE. Release notes: docs/CHANGELOG.md.