Skip to content

Latest commit

ย 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Copilot Amplify logo

Copilot Amplify

Extend GitHub Copilot Chat with the AI providers you choose.

Xiaomi MiMo ยท Z.ai GLM ยท Groq ยท NVIDIA NIM ยท OmniRoute โ€” all first-class, equal siblings inside the VS Code Language Model API.

Version VS Code Marketplace Open VSX Tests TypeScript License

Install ยท Quick Start ยท Configuration ยท Contributing


โœจ Why Copilot Amplify?

GitHub Copilot Chat is great โ€” but you're limited to GitHub's model catalog. Copilot Amplify opens it up:

๐Ÿ”Œ Bring your own provider Xiaomi MiMo, Z.ai GLM, Groq, NVIDIA NIM, and OmniRoute work out of the box
โš–๏ธ No privileged provider Every provider is an equal sibling โ€” no hidden routing, no forced hierarchy
๐Ÿ” Secrets done right API keys live in VS Code SecretStorage (OS keychain), never in settings.json or logs
๐Ÿง  Full AI capability surface Streaming, tool calling, reasoning/thinking output, vision input, system prompts
๐Ÿ›ก๏ธ Production-grade reliability Retries with Retry-After, per-provider circuit breakers, timeouts everywhere, saturation-aware errors
๐ŸŒŠ Live model catalogs OmniRoute discovers models from your server at runtime โ€” new models appear without updating the extension
๐Ÿ‘๏ธ Observable Unified diagnostics, per-request telemetry logs, live health states in the tree view

OmniRoute is a provider, not a middleman. Its internal multi-provider routing lives entirely on the OmniRoute server; this extension only ever talks to your configured base URL โ€” exactly like any other vendor endpoint.

๐Ÿ—บ๏ธ Contents

๐Ÿ“ฆ Installation

Option A โ€” from a marketplace (recommended)

Available on both major registries:

Registry Install
VS Code Marketplace Install for VS Code โ€” click Install, or inside VS Code: Extensions โ†’ Search "Copilot Amplify"
Open VSX Install for VSCodium / Gitpod / Cursor & friends โ€” or CLI: open-vsx compatible editors via code --install-extension mojahid2021.copilot-amplify

Or straight from the terminal:

# VS Code / Cursor / Windsurf
code --install-extension mojahid2021.copilot-amplify

Option B โ€” build from source

git clone https://github.com/mojahid2021/copilot-amplify.git
cd copilot-amplify
npm install
npm run compile

Then press F5 in VS Code to launch an Extension Development Host.

Option C โ€” packaged VSIX

npm install && npm run package   # โ†’ copilot-amplify-<version>.vsix

Install via Extensions: Install from VSIXโ€ฆ.

Requires VS Code โ‰ฅ 1.125 and an active GitHub Copilot subscription (the extension extends Copilot Chat's Language Model API).

๐Ÿš€ Quick Start

  1. Open the panel โ€” click the Copilot Amplify icon in the activity bar.
  2. Add a key โ€” click the ๐Ÿ”‘ icon on any provider row and paste your API key. It goes straight into your OS keychain.
  3. Pick a model โ€” open Copilot Chat's model picker and choose e.g. Z.ai ยท Glm 5.2.
  4. Chat. That's it.

No settings.json edits required. Full walkthrough with copy-paste recipes: docs/usage-examples.md

๐Ÿ”Œ Supported Providers

Provider Catalog Highlights
Xiaomi MiMo Static (2 models) Auto-routes token-plan (tp-) keys to the dedicated gateway; up to 1M-token context
Z.ai GLM Static (10 models) Reasoning-effort control on GLM-5.x; vision on glm-5v-turbo
Groq Static (7 models) Ultra-fast Llama & GPT-OSS serving
NVIDIA NIM Static (17 models) Broad open-model catalog with transparent ID mapping
OmniRoute ๐Ÿ”„ Dynamic Discovers models live from GET /models; custom chat endpoints supported; anonymous local operation

Capabilities shown in the picker are truthful by design โ€” a model is only advertised with vision/tools/reasoning if it actually supports them.

๐Ÿ—๏ธ Architecture

VS Code
    โ”‚
    โ–ผ
VS Code Language Model API
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          Copilot Amplify Core           โ”‚
โ”‚                                         โ”‚
โ”‚  Provider Registry   Model Catalogs     โ”‚
โ”‚  Authentication      HTTP Transport     โ”‚
โ”‚  Streaming / SSE     Retry / Timeout    โ”‚
โ”‚  Circuit Breaker     Error Taxonomy     โ”‚
โ”‚  Context / Converter Thinking / Tools   โ”‚
โ”‚  Logging / Redaction Diagnostics        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
              Provider Registry
                     โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ–ผ        โ–ผ        โ–ผ        โ–ผ           โ–ผ
 Xiaomi    Z.ai     Groq     NVIDIA    OmniRoute
 Provider  Provider Provider Provider  Provider
   โ”‚         โ”‚        โ”‚         โ”‚           โ”‚
   โ–ผ         โ–ผ        โ–ผ         โ–ผ           โ–ผ
 MiMo API  Z.ai API Groq API NVIDIA NIM OmniRoute Server
                                                 โ”‚
                                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                     โ–ผ           โ–ผ           โ–ผ
                                 Provider A  Provider B  Provider C

Adding a provider means adding one descriptor module + tests โ€” no core changes. See docs/adding-a-provider.md for the full guide.

Project layout
src/
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ api/            # GenericApiClient (OpenAI SDK), shared SSE parser
โ”‚   โ”œโ”€โ”€ auth/           # SecretStorage-backed BaseAuthManager
โ”‚   โ”œโ”€โ”€ context/        # LMโ†”wire converters, token estimation & truncation
โ”‚   โ”œโ”€โ”€ errors/         # Normalized error taxonomy + HTTP mapping
โ”‚   โ”œโ”€โ”€ logging/        # OutputChannel logger with secret redaction
โ”‚   โ”œโ”€โ”€ models/         # Static model catalogs per fixed-catalog provider
โ”‚   โ”œโ”€โ”€ provider/       # BaseChatProvider + ProviderRegistry
โ”‚   โ”œโ”€โ”€ resilience/     # TTLCache (coalescing), CircuitBreaker, saturation classifier
โ”‚   โ”œโ”€โ”€ retry/          # Backoff, jitter, Retry-After, cancellation
โ”‚   โ”œโ”€โ”€ thinking/       # <think>/<thought> stream extraction
โ”‚   โ”œโ”€โ”€ diagnostics.ts  # Unified credential-free report across providers
โ”‚   โ””โ”€โ”€ url.ts          # Base URL validation / normalization / joining
โ”œโ”€โ”€ providers/
โ”‚   โ”œโ”€โ”€ xiaomi/  zai/  groq/  nvidia/   # Fixed-catalog descriptors
โ”‚   โ”œโ”€โ”€ omniroute/                      # Full dynamic provider module
โ”‚   โ””โ”€โ”€ index.ts                        # Registry assembly
โ”œโ”€โ”€ commands/           # Command registrations
โ”œโ”€โ”€ ui/                 # Providers & Models tree view
โ”œโ”€โ”€ extension.ts        # Activation (lightweight, zero network I/O)
โ””โ”€โ”€ secretsMigration.ts # One-time plaintextโ†’SecretStorage migration
tests/
โ”œโ”€โ”€ mocks/vscode.ts     # Minimal vscode API mock for unit tests
โ”œโ”€โ”€ helpers/sse.ts      # SSE stream builders
โ””โ”€โ”€ unit/               # 21 files, 220+ cases incl. cross-provider contract tests

โš™๏ธ Configuration

API keys & SecretStorage

Set keys through the UI โ€” never edit settings files:

  • Tree view โ†’ ๐Ÿ”‘ icon on a provider row, or
  • Copilot Amplify: Manage Providersโ€ฆ โ†’ Set API Key

Keys are stored via vscode.SecretStorage (OS keychain-backed) and never appear in logs, diagnostics, or errors. Upgrading from 1.x? Plaintext settings entries are migrated automatically on first activation and then removed.

๐Ÿ’ก OmniRoute anonymous mode: no key needed for local servers โ€” they work out of the box.

General settings

Setting Default Purpose
copilot-amplify.enableReasoning true Global reasoning toggle for thinking-capable models
copilot-amplify.customSystemPrompt (empty) Injected into every request across providers
copilot-amplify.requestTimeoutMs 120000 Chat request timeout for fixed-catalog providers
copilot-amplify.debugLogging false Debug-level logs in the output channel
copilot-amplify.circuitBreaker.enabled true Fail-fast after repeated failures โ€” every provider
copilot-amplify.circuitBreaker.failureThreshold 5 Consecutive failures before a circuit opens
copilot-amplify.circuitBreaker.resetTimeoutSeconds 30 Cooldown before a half-open probe

OmniRoute settings

Setting Default Purpose
copilot-amplify.omniroute.baseUrl http://localhost:20128/v1 Server base URL (validated + normalized)
copilot-amplify.omniroute.chatEndpoint (empty) Custom chat-completions route โ€” absolute URL or path relative to Base URL
copilot-amplify.omniroute.noCache false Bypass the server-side semantic cache
copilot-amplify.omniroute.noMemory true Skip server-side memory/skills injection
copilot-amplify.omniroute.compression (empty) Compression override (off, default, engine:<id>)
copilot-amplify.omniroute.sessionId (empty) Explicit session tag for cost attribution/memory
copilot-amplify.omniroute.progress false Opt into server progress events
copilot-amplify.omniroute.modelCacheTtlSeconds 300 Model discovery cache TTL
copilot-amplify.omniroute.requestTimeoutMs 120000 Chat request timeout
copilot-amplify.omniroute.discoveryTimeoutMs 8000 Discovery / connection-test timeout
copilot-amplify.omniroute.warmupOnStartup false Discover models at activation instead of first use
copilot-amplify.omniroute.logTelemetry true Log routing/cost telemetry per request

Base URLs are normalized โ€” these are all equivalent, no //v1 accidents:

https://example.com        https://example.com/
https://example.com/v1     https://example.com/v1/

๐ŸŽฎ Commands

General

Command Description
Copilot Amplify: Manage Providersโ€ฆ QuickPick hub: keys, tests, refresh, diagnostics
Copilot Amplify: Refresh Providers & Models Invalidate caches + re-discover
Copilot Amplify: Show Diagnostics Credential-free report for all providers
Copilot Amplify: Set / Clear API Key Credential management (context-aware in the tree)
Copilot Amplify: Test Connection Lightweight reachability + auth probe
Copilot Amplify: Pin / Unpin / Select Model Favorites and active model

OmniRoute-specific

Command Description
OmniRoute: Configureโ€ฆ Guided: base URL โ†’ chat endpoint โ†’ optional key โ†’ test
OmniRoute: Edit Chat Endpoint Quick custom-endpoint override (also in the tree ACTIONS panel)
OmniRoute: Set / Remove API Key SecretStorage credential management
OmniRoute: Test Connection Latency + chat-model count report
OmniRoute: Refresh Models Force re-discovery of /models
OmniRoute: Show Diagnostics Full configuration & health report
OmniRoute: Reset Configuration Restore defaults + clear stored key
Show Omniroute Telemetry Open the per-request telemetry log channel

๐Ÿ›ก๏ธ Reliability

  • Retries โ€” exponential backoff with full jitter on 408/429/5xx and network errors; honors Retry-After on every transport path; never retries 400/401/403/404, cancellations, or open circuits.
  • Circuit breaker โ€” per-provider, settings-driven; open circuits reject instantly instead of burning backoff time; automatic half-open recovery probe.
  • Timeouts โ€” separate request/discovery budgets; nothing hangs indefinitely.
  • Saturation awareness โ€” 503/529 bodies are inspected to distinguish queue saturation from maintenance; errors tell you which and what it means.
  • Live health โ€” connected ยท not-configured ยท error ยท rate-limited ยท auth-failed, reflected in the tree in real time.
  • Streaming โ€” hardened SSE parser: fragmented chunks, multi-event frames, CRLF, comments, [DONE], malformed-frame tolerance, trailing flushes. Reasoning deltas stream as native thinking parts.
  • Cancellation โ€” every request wires VS Code tokens into abort signals; cancelled streams release resources immediately.

๐Ÿ”’ Security

  • ๐Ÿ”‘ Credentials only in SecretStorage; legacy plaintext settings migrated away automatically and never logged.
  • ๐Ÿ™ˆ Central logger redacts Authorization headers, bearer tokens, and sensitive keys; diagnostics expose only a boolean configured flag.
  • ๐ŸŒ Base URLs validated before any network call: http/https only, embedded credentials rejected (SSRF guard).
  • ๐Ÿงฐ Tool-call arguments parsed with prototype-pollution-safe JSON.
  • ๐Ÿ“‹ Telemetry logging uses a strict header allowlist โ€” nothing arbitrary is dumped.

๐Ÿฉบ Troubleshooting

Symptom Fix
"Authentication failed (401)" Re-set the key (tree ๐Ÿ”‘). Keys are never deleted automatically. 403 usually means region/access restrictions.
OmniRoute shows no models Run OmniRoute: Test Connection. Check diagnostics for the last discovery error; missing /v1 in the Base URL is the usual culprit.
"circuit open" errors The breaker tripped after repeated failures. Wait out the cooldown or lower failureThreshold; disable entirely via circuitBreaker.enabled.
New server model not in picker Refresh Providers & Models. Non-chat entries (embeddings/rerank/TTS) are filtered by design.
Requests feel stuck Lower requestTimeoutMs / omniroute.requestTimeoutMs; enable debugLogging and check the output channel.

More walkthroughs: docs/usage-examples.md ยง8.

๐Ÿ’ป Development

npm install
npm run compile     # tsc build โ†’ out/
npm run watch       # incremental build
npm run lint        # eslint (src + tests, typed)
npm run typecheck   # tsc --noEmit (strict + noUncheckedIndexedAccess)
npm test            # vitest โ€” 223 tests, fully mocked, no real keys needed
npm run package     # vsce โ†’ .vsix

The test suite covers URL normalization, SSE robustness, retry semantics, circuit-breaker transitions, cache coalescing, error taxonomy, secret redaction, tool-call parsing, context-truncation integrity, OmniRoute discovery/filtering, connection testing, session handling, telemetry normalization, secrets migration, and a cross-provider contract suite.

Publishing

Releases go to both registries:

npm run package                          # build copilot-amplify-<version>.vsix

# VS Code Marketplace (publisher: mojahid2021)
npx vsce publish

# Open VSX (VSCodium, Gitpod, and other VS Code forks)
npx ovsx publish --pat <OPEN_VSX_PAT>

๐Ÿค Contributing

Contributions are welcome! Good first steps:

  1. ๐Ÿ“– Read docs/adding-a-provider.md โ€” adding a provider requires exactly one descriptor module, registration wiring, and tests. No core changes.
  2. ๐Ÿ› Check open issues or file a bug with reproduction steps.
  3. โœ… Before opening a PR: npm run typecheck && npm run lint && npm test must pass.
  4. ๐Ÿ“ Follow Conventional Commits (feat:, fix:, docs: โ€ฆ).

Design decisions are documented as ADRs in docs/adr/.

๐Ÿ“š Documentation

Doc Contents
docs/usage-examples.md Copy-paste setup recipes, endpoint examples, tuning, troubleshooting
docs/adding-a-provider.md Step-by-step guide to contributing a new provider
docs/adr/ Architecture decision records
CHANGELOG.md Release history

๐Ÿ“„ License

ISC ยฉ Md Mojahid

โญ Found this useful? Star the repo โ€” it helps others discover it!

About

Extend GitHub Copilot Chat with the AI providers you choose.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages