Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>LAI Compatible ProviderNew to Visual Studio Code? Get it now.
LAI Compatible Provider

LAI Compatible Provider

kelvin.y

|
109 installs
| (1) | Free
An extension that integrates llama/vllm/Ollama/DeepSeek/Gemini API Providers into GitHub Copilot
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LAI Compatible Provider for Copilot

Turn 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.

English · 中文

Requires VS Code 1.120+ with GitHub Copilot Chat. Install from the Marketplace (kelviny.lai-compatible-copilot) or build a VSIX with npm run build. API keys live in VS Code Secret Storage, never in settings.json.


What it does

Copilot Chat normally talks only to GitHub's own models. This extension registers its own model provider, so the same chat UI can drive:

  • Local models — llama.cpp, Ollama, vLLM
  • Cloud models — OpenAI, Anthropic, Gemini, DeepSeek, Qwen, and any OpenAI-compatible endpoint
Feature Status
Tool calling (read file, search, run commands, …) ✅
Image input (vision models) ✅
Reasoning / thinking stream ✅
Multi-turn with tool results ✅
Context control (history caps, auto-compaction, overflow recovery) ✅
Git commit message generation ✅

Quick start

1. Zero config: the built-in free models

On a fresh install the picker already lists a set of free models shown as 🌙 cline … (the moon distinguishes them from your own ⭐ cloud models). They use a shared key bundled with the extension — nothing to configure. See Built-in free models.

2. Run a local server

# llama.cpp — --jinja lets the server render tool-call templates,
# --mmproj adds vision, --ctx-size must match your laicopilot.models[].context_length
llama-server --model /path/qwen3.6.gguf --mmproj /path/mmproj-f16.gguf \
  --host 0.0.0.0 --port 8080 --n-gpu-layers 999 --ctx-size 131072 --jinja

ollama serve                                    # Ollama
vllm serve Qwen/Qwen3-35B-A3B --port 11000     # vLLM

3. Add the model

In settings.json (or the configuration UI):

{
  "laicopilot.models": [
    {
      "id": "qwen3.6",
      "owned_by": "llamacpp",
      "apiMode": "llamacpp",
      "displayName": "Qwen 3.6 (local)",
      "baseUrl": "http://localhost:8080",
      "vision": true,
      "context_length": 131072,
      "max_tokens": 65536,
      "thinking_budget": 1024,
      "max_history_messages": 20
    }
  ]
}

Pick the model in the Copilot Chat model dropdown and start chatting — tools are called automatically.


Cloud models

Declare an endpoint once in laicopilot.cloudProviders and the extension fetches its model list automatically; fetched models are tagged ⭐ <provider> <model> and route to that endpoint and its own key:

{
  "laicopilot.cloudProviders": [
    { "id": "deepseek", "baseUrl": "https://api.deepseek.com", "apiMode": "openai" },
    { "id": "cline", "baseUrl": "https://api.cline.bot/api/v1", "modelFilterKeywords": ["free"] },
    { "id": "anthropic", "baseUrl": "https://api.anthropic.com", "apiMode": "anthropic" }
  ]
}

Prefer explicit entries? Put them in laicopilot.models instead:

{
  "laicopilot.models": [
    { "id": "gpt-4o", "owned_by": "openai", "baseUrl": "https://api.openai.com/v1", "apiMode": "openai" }
  ]
}

baseUrl may include or omit /v1 — the extension never doubles it (/v1/v1/…).


Built-in free models

A preset ships with the extension so a fresh install works out of the box:

Item Value
Provider id cline
Base URL https://api.cline.bot/api/v1
API mode openai
Model filter only models whose id/name contains free
API key shared key bundled in the extension (override it with your own)

Notes:

  • These models run on the upstream free tier, so availability and rate limits are decided upstream. If one errors or is throttled, switch to another free model.
  • The shared key is public by design: it is embedded in the published extension. To use your own quota, store a key for cline (it always wins over the bundled one).
  • If you configure your own provider with id cline, your configuration wins; the bundled key is only reused while it still points at the official base URL, so it is never sent to an unknown host.
  • Set laicopilot.enableDefaultFreeProvider to false to hide them.

API keys

The model list never prompts for a key. A provider without a key simply appears as a ⚠ <provider> needs API key row in the picker. A key is requested only when you actually send a chat request to that provider (or when you run one of the commands below).

Command What it does
laicopilot.setApikey Set the single global key (laicopilot.apiKey)
laicopilot.setProviderApikey Set a per-provider key (choose the provider from a list)
laicopilot.openConfig Open the graphical configuration panel

Leaving the input box empty and pressing Enter clears the stored key.

Storage in Secret Storage (OS keychain / Windows Credential Manager):

Scope Secret id
Global fallback laicopilot.apiKey
Model provider, chosen by owned_by laicopilot.apiKey.<owned_by> e.g. .openai, .anthropic, .gemini
Cloud provider entry laicopilot.apiKey.provider.<id> e.g. .provider.deepseek

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 --api-key sk-xxx, store it under the provider name.

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.


Settings

Global

Setting Description
laicopilot.baseUrl Fallback endpoint, used only when neither a cloud provider nor the model entry sets baseUrl. Manifest default: https://api.deepseek.com
laicopilot.models Explicit model list (see quick start)
laicopilot.cloudProviders Named endpoints { id, baseUrl, apiMode?, headers?, modelFilterKeywords? }; their models are auto-listed
laicopilot.enableDefaultFreeProvider Show the built-in free preset (default true)
laicopilot.delay Milliseconds between requests, to keep local servers responsive (0 = off)
laicopilot.retry { enabled, max_attempts, interval_ms, status_codes } — default 3 retries on 429/5xx, exponential backoff capped at 60s
laicopilot.autoCompact Cline-style auto-compaction: when the context nears 90% of the window, summarize older turns into a continuation note (one extra LLM call). Default false
laicopilot.autoCompactPreserveRecentTokens Recent tokens kept verbatim during auto-compaction (default 20000)
laicopilot.readFileLines Minimum lines the read_file tool returns (0 = leave tool arguments untouched)
laicopilot.logLevel off (default) / debug / info / warn / error
laicopilot.commitLanguage / laicopilot.commitMessagePrompt Language and system prompt for commit message generation

Per model (laicopilot.models[])

Identity & routing

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_file line 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.

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