copilot-multi-provider
v0.1.5
Published
Connect Copilot Chat to multiple custom LLM providers — configure API endpoints, track token usage, and monitor spending across providers.
Readme
Copilot Multi-Provider
Connect GitHub Copilot Chat to multiple custom LLM providers — OpenAI-compatible APIs, local models, or any endpoint you choose.
Configure providers with custom endpoints, API keys, model lists, and pricing. Track token usage and cost automatically across all providers.
🌐 Languages
English
Features
- Multi-Provider Support — Add as many API providers as you want (OpenAI, Anthropic, local LLMs, custom proxies...)
- Dynamic Settings UI — Add/remove providers with
+/-buttons, configure everything in a clean webview panel - Auto Model Fetch — Click "Fetch Models" to pull the model list from
{baseUrl}/models - Token Usage Tracking — Automatically captures input/output/cached tokens from each API call
- Cost Calculation — Configure per-token pricing (input, output, cache read, cache write) and get real-time cost totals
- Usage Dashboard — View total tokens, cost, per-provider breakdown, per-model breakdown, and recent usage history
- Secure Storage — API keys stored in VS Code's
SecretStorage, configs and usage inglobalState
Requirements
- VS Code
^1.116.0 - Node.js
>=20 - GitHub Copilot Chat extension installed
Installation
Quick Install (One Command)
npx copilot-multi-providerDownloads and installs the latest version automatically. Reload VS Code to activate.
Manual: .vsix Download
- Go to GitHub Releases
- Download
copilot-multi-provider-x.x.x.vsix - In VS Code:
Ctrl+Shift+P→ Extensions: Install from VSIX... - Select the downloaded file
Option 2: Build from Source
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
npm run package # produces copilot-multi-provider-x.x.x.vsixThen install the .vsix as in Option 1.
Option 3: Development (with debugger)
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
# Open in VS Code and press F5Commands (Ctrl+Shift+P)
| Command | Description | |---------|-------------| | Copilot Multi-Provider: Open Settings | Open the provider configuration panel | | Copilot Multi-Provider: Show Total Usage | View usage dashboard with cost breakdown | | Copilot Multi-Provider: Refresh Models | Re-fetch model lists from all configured providers | | Copilot Multi-Provider: Show Logs | View debug logs |
Setup
- Install the extension
Ctrl+Shift+P→ Copilot Multi-Provider: Open Settings- Click
+to add a provider - Fill in:
- Provider Name — Display name
- Base URL — API endpoint (e.g.
https://api.openai.com/v1) - API Key — Your API key (stored securely)
- Pricing — Per-token rates for cost tracking
- Click Fetch Models to load available models
- Click Save Provider
- The provider's models now appear in the Copilot Chat model picker as
Provider Name — Model Name
Pricing Configuration
| Field | Description | |-------|-------------| | Input $ | Cost per input token | | Output $ | Cost per output token | | Cache Read $ | Cost per cached read token (prompt caching) | | Cache Write $ | Cost per cache write token |
Pricing is per-token. For reference, OpenAI GPT-4o is approximately:
- Input:
$0.0000025per token ($2.50 / 1M tokens) - Output:
$0.00001per token ($10 / 1M tokens) - Cache Read:
$0.00000125per token ($1.25 / 1M tokens)
How It Works
Copilot Chat → selects model
↓
CopilotMultiProvider (LanguageModelChatProvider)
├─ Routes to correct provider's API
├─ Streams response via SSE
├─ Captures usage from final chunk
└─ Records to tracker → calculates costLicense
MIT
한국어
기능
- 다중 Provider 지원 — 여러 API 제공자를 동시에 등록 (OpenAI, Anthropic, 로컬 LLM, 프록시 등)
- 동적 설정 UI —
+/-버튼으로 Provider를 추가/삭제하고 Webview에서 모든 설정 관리 - 모델 자동 불러오기 — "Fetch Models" 버튼으로
{baseUrl}/models에서 모델 목록 자동 수집 - 토큰 사용량 자동 추적 — 매 API 호출 시 input/output/cache 토큰을 자동으로 캡쳐
- 비용 계산 — 토큰당 가격 (입력/출력/캐시 읽기/캐시 쓰기) 설정 → 실시간 총 비용 확인
- 사용량 대시보드 — 총 토큰, 총 비용, Provider별/모델별 분석, 최근 사용 기록
- 보안 저장 — API 키는 VS Code
SecretStorage에, 설정과 사용량은globalState에 저장
요구사항
- VS Code
^1.116.0 - Node.js
>=20 - GitHub Copilot Chat 확장 설치 필수
설치 방법
빠른 설치 (명령어 하나)
npx copilot-multi-provider최신 버전을 자동으로 다운로드하고 설치합니다. VS Code를 새로고침하면 적용됩니다.
수동: .vsix 다운로드
- GitHub Releases 에서
copilot-multi-provider-x.x.x.vsix다운로드 - VS Code에서
Ctrl+Shift+P→ Extensions: Install from VSIX... - 다운로드한 파일 선택
방법 2: 소스에서 빌드
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
npm run package # copilot-multi-provider-x.x.x.vsix 생성됨생성된 .vsix 파일을 방법 1처럼 설치.
방법 3: 개발 모드 (디버거 포함)
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
# VS Code에서 열고 F5명령어 (Ctrl+Shift+P)
| 명령어 | 설명 | |--------|------| | Copilot Multi-Provider: Open Settings | Provider 설정 패널 열기 | | Copilot Multi-Provider: Show Total Usage | 사용량 대시보드 보기 | | Copilot Multi-Provider: Refresh Models | 모든 Provider의 모델 목록 새로고침 | | Copilot Multi-Provider: Show Logs | 디버그 로그 보기 |
설정 방법
- 확장 프로그램 설치
Ctrl+Shift+P→ Copilot Multi-Provider: Open Settings+버튼 클릭해서 Provider 추가- 항목 입력:
- Provider Name — 표시 이름
- Base URL — API 엔드포인트 (예:
https://api.openai.com/v1) - API Key — API 키 (안전하게 저장됨)
- Pricing — 토큰당 가격 (비용 추적용)
- Fetch Models 클릭해서 모델 목록 불러오기
- Save Provider 클릭
- Copilot Chat 모델 선택기에
Provider명 — 모델명형식으로 표시됨
가격 설정
| 필드 | 설명 | |------|------| | Input $ | 입력 토큰당 가격 | | Output $ | 출력 토큰당 가격 | | Cache Read $ | 캐시 읽기 토큰당 가격 (CR) | | Cache Write $ | 캐시 쓰기 토큰당 가격 (CW) |
日本語
機能
- マルチプロバイダー対応 — 複数のAPIプロバイダーを同時登録(OpenAI、Anthropic、ローカルLLM、プロキシなど)
- 動的設定UI —
+/-ボタンでプロバイダーを追加/削除、Webviewですべての設定を管理 - モデル自動取得 — "Fetch Models" ボタンで
{baseUrl}/modelsからモデル一覧を自動取得 - トークン使用量の自動追跡 — 毎回のAPI呼び出しで input/output/cache トークンを自動キャプチャ
- コスト計算 — トークン単価(入力/出力/キャッシュ読み取り/キャッシュ書き込み)を設定し、リアルタイムで総コストを確認
- 使用量ダッシュボード — 総トークン数、総コスト、プロバイダー別/モデル別の内訳、最近の使用履歴
- 安全な保存 — APIキーはVS Codeの
SecretStorageに、設定と使用量はglobalStateに保存
要件
- VS Code
^1.116.0 - Node.js
>=20 - GitHub Copilot Chat 拡張機能が必要
インストール
クイックインストール(コマンド一つ)
npx copilot-multi-provider最新バージョンを自動ダウンロード&インストール。VS Codeを再読み込みで有効化。
手動: .vsix をダウンロード
- GitHub Releases から
copilot-multi-provider-x.x.x.vsixをダウンロード - VS Codeで
Ctrl+Shift+P→ Extensions: Install from VSIX... - ダウンロードしたファイルを選択
方法 2: ソースからビルド
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
npm run package # copilot-multi-provider-x.x.x.vsix が生成される生成された .vsix を方法1と同様にインストール。
方法 3: 開発モード(デバッガー付き)
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
# VS Codeで開いて F5コマンド (Ctrl+Shift+P)
| コマンド | 説明 | |----------|------| | Copilot Multi-Provider: Open Settings | プロバイダー設定パネルを開く | | Copilot Multi-Provider: Show Total Usage | 使用量ダッシュボードを表示 | | Copilot Multi-Provider: Refresh Models | 全プロバイダーのモデル一覧を更新 | | Copilot Multi-Provider: Show Logs | デバッグログを表示 |
中文
功能
- 多提供商支持 — 同时注册多个 API 提供商(OpenAI、Anthropic、本地 LLM、代理等)
- 动态设置界面 — 使用
+/-按钮添加/删除提供商,在 Webview 中管理所有设置 - 自动获取模型 — 点击 "Fetch Models" 从
{baseUrl}/models自动获取模型列表 - 自动追踪 Token 用量 — 每次 API 调用自动捕获 input/output/cache token
- 费用计算 — 配置每 token 价格(输入/输出/缓存读取/缓存写入),实时查看总费用
- 用量仪表板 — 总 Token、总费用、按提供商/模型分类、最近使用记录
- 安全存储 — API 密钥存储在 VS Code
SecretStorage,配置和用量存储在globalState
系统要求
- VS Code
^1.116.0 - Node.js
>=20 - 需要安装 GitHub Copilot Chat 扩展
安装方法
快速安装(一条命令)
npx copilot-multi-provider(未发布到 npm 时)
npx github:sadw1q/copilot-multi-provider从 GitHub Releases 下载 copilot-multi-provider-x.x.x.vsix
2. 在 VS Code 中按 Ctrl+Shift+P → Extensions: Install from VSIX...
3. 选择下载的文件
方式 2: 从源码构建
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
npm run package # 生成 copilot-multi-provider-x.x.x.vsix然后按方式 1 安装 .vsix。
方式 3: 开发模式(含调试器)
git clone https://github.com/sadw1q/copilot-multi-provider.git
cd copilot-multi-provider
npm install
npm run compile
# 在 VS Code 中打开并按 F5命令 (Ctrl+Shift+P)
| 命令 | 说明 | |------|------| | Copilot Multi-Provider: Open Settings | 打开提供商配置面板 | | Copilot Multi-Provider: Show Total Usage | 查看用量仪表板 | | Copilot Multi-Provider: Refresh Models | 刷新所有提供商的模型列表 | | Copilot Multi-Provider: Show Logs | 查看调试日志 |
