安装uv
uv venv
uv pip install litellm[proxy]
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
{
"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 --config config.yaml
注意:启动后会有设备码,你需要打开 Github 网页输入设备码授权
https://docs.litellm.ai/docs/providers/github_copilot#usage---litellm-proxy
1
ClericPy 1 天前
这个方案之前 v2 里没搜到,在老外那边搜到过
谢谢分享,cc-switch 这段时间貌似也有个 pr 合了就是这功能 |
2
FarAhead 1 天前
Codex 支持这么用吗?
|
3
SayHelloHi OP @FarAhead
看官方文档 理论上是可以的 老铁可以试一试~ # Point to your LiteLLM Proxy server export OPENAI_BASE_URL=http://0.0.0.0:4000 # Use your LiteLLM API key (if you've set up authentication) export OPENAI_API_KEY="sk-1234" https://docs.litellm.ai/docs/tutorials/openai_codex#4-configure-codex-to-use-litellm-proxy |