GoForum › 🌐 V2EX
利用 LiteLLM 让 Claude Code 调用 GitHub Copilot 提供的 Claude 模型
SayHelloHi ·
2026-03-16 20:57 ·
0 次点赞 · 0 条回复
创建 Python 虚拟环境
安装
uvuv venv
安装 LiteLLM
pip install litellm[proxy]
uv pip install litellm[proxy]
配置 config.yaml
litellm_settings:
drop_params: true
model_list:
- model_name: claude-opus-4-6
litellm_params:
model: github_copilot/claude-opus-4.6
- model_name: claude-sonnet-4-6
litellm_params:
model: github_copilot/claude-sonnet-4.6
配置 Claude Code
- 打开 ~/.claude/settings.json
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-996",
"ANTHROPIC_BASE_URL": "http://localhost:4000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"permissions": {
"allow": [],
"deny": []
},
"model": "sonnet[1m]",
"enabledPlugins": {
"playwright@claude-plugins-official": true,
"og-image@og-image-skill": true
}
}
启动 LiteLLM
litellm --config config.yaml
注意:启动后会有设备码,你需要打开 Github 网页输入设备码授权
参考
https://docs.litellm.ai/docs/providers/github_copilot#usage—litellm-proxy
0 条回复
添加回复
你还需要 登录
后发表回复