Engineering Deep Dive · Engineering · Developer Tools

Copilot Custom LLM Provider: Bring any OpenAI-compatible model into VS Code

VS Code extension bridging DashScope, MiniMax, OpenRouter, Ollama, LiteLLM, and vLLM into GitHub Copilot Chat.

Open Source

Challenge → Tradeoffs → Architecture → Implementation → Validation

IntrofinityView source

Copilot Chat is useful. The model picker is a bottleneck.

Teams increasingly want agentic coding in VS Code without being locked to a single hosted model family. Alibaba Cloud Coding Plan, MiniMax, OpenRouter, local Ollama, LiteLLM proxies, and vLLM deployments all speak a familiar dialect: OpenAI-compatible chat completions. GitHub Copilot Chat did not natively treat those endpoints as first-class models in the picker.

Copilot Custom LLM Provider was built to close that gap. The primary use case was bringing Alibaba Cloud Coding Plan — including Qwen Coder models in agent mode — into Copilot Chat. The architecture stayed general: any OpenAI-compatible /v1/chat/completions endpoint should work.

What had to work on day one

A thin proxy is not enough for Copilot Chat. The extension needed:

  • models appearing directly in the Copilot Chat model picker
  • full streaming over Server-Sent Events
  • tool calling so agent mode, /fix, /edit, and @workspace keep working
  • multi-provider support with separate URLs and API keys
  • dynamic model discovery from /v1/models (or LiteLLM-compatible /model/info)
  • stable provider IDs so renaming a display label does not break the model list
  • secret storage for keys instead of writing credentials into settings JSON
  • hot-reload when settings change

Those requirements define the product. If streaming or tools break, the extension is a novelty. If discovery is manual, it becomes settings debt.

Multi-provider by default

Developers rarely stay on one backend. The extension lets Alibaba DashScope and OpenRouter sit side by side, or a local Ollama instance next to a remote LiteLLM proxy. Providers are added through a command-palette wizard: name, base URL, API key. Models from every healthy provider merge into one picker list under Custom LLM.

An optional @qwen chat participant routes a single turn through the custom model without permanently hijacking the picker selection. That keeps native Copilot models usable in the same session.

Reliability edges that matter in an IDE

IDE traffic is bursty and failure-prone. The extension retries with exponential backoff for network failures and rate limits, caps output tokens, and supports per-model parameter overrides such as temperature. Image input is supported for multimodal models. The runtime dependency footprint is intentionally empty — the extension should not drag a package tree into every VS Code workspace.

What this case study claims

Custom model support for Copilot is an integration problem, not a prompt problem. The durable work is provider identity, discovery, streaming, tools, secrets, and failure handling — the boring machinery that makes an alternate model feel native.

Extension: github.com/syedsadiq27/copilot-custom-llm-provider

← All work