|
1 | 1 | model_list: |
2 | 2 | # 显式注册 OpenAI 系列模型,确保 `/models` 能直接返回可用模型名。 |
3 | 3 | - model_name: "gpt-5.4" |
4 | | - litellm_params: |
5 | | - # `model_name` 保持与上游模型 id 一致,便于客户端直接按 `/models` 结果发起调用。 |
6 | | - model: "openai/gpt-5.4" |
| 4 | + litellm_params: &newapi_openai_params |
| 5 | + # 这里顺手定义 NewAPI OpenAI 兼容入口的公共连接参数,后续同上游模型通过 merge 复用。 |
7 | 6 | api_base: "os.environ/NEWAPI_API_BASE" # 从环境变量读 NewAPI 地址 |
8 | 7 | api_key: "os.environ/NEWAPI_KEY" # 从环境变量读密钥 |
| 8 | + # `model_name` 保持与上游模型 id 一致,便于客户端直接按 `/models` 结果发起调用。 |
| 9 | + model: "openai/gpt-5.4" |
9 | 10 | # 显式注册 Gemini 系列模型,避免 wildcard 路由只返回 `*`。 |
10 | 11 | - model_name: "gemini-3.1-pro" |
11 | 12 | litellm_params: |
| 13 | + # 复用同一个 NewAPI OpenAI 兼容入口,只覆盖具体模型名。 |
| 14 | + <<: *newapi_openai_params |
12 | 15 | # 继续走 OpenAI 兼容入口,由 NewAPI 负责实际模型分发。 |
13 | 16 | model: "openai/gemini-3.1-pro" |
14 | | - api_base: "os.environ/NEWAPI_API_BASE" # 从环境变量读 NewAPI 地址 |
15 | | - api_key: "os.environ/NEWAPI_KEY" # 从环境变量读密钥 |
16 | 17 | # 显式注册 Claude 系列模型,便于 LiteLLM 直接暴露固定模型列表。 |
17 | 18 | - model_name: "claude-opus-4-6" |
18 | 19 | litellm_params: |
| 20 | + # 复用同一个 NewAPI OpenAI 兼容入口,只覆盖具体模型名。 |
| 21 | + <<: *newapi_openai_params |
19 | 22 | # 使用上游真实模型 id,避免代理别名与 NewAPI 模型名脱节。 |
20 | 23 | model: "openai/claude-opus-4-6" |
21 | | - api_base: "os.environ/NEWAPI_API_BASE" # 从环境变量读 NewAPI 地址 |
22 | | - api_key: "os.environ/NEWAPI_KEY" # 从环境变量读密钥 |
23 | 24 | # 显式注册 GLM Coding Plan 主模型,便于 `/models` 稳定暴露官方模型名。 |
24 | 25 | - model_name: "GLM-5.1" |
25 | | - litellm_params: |
26 | | - # 智谱 Coding Plan 走独立 OpenAI 兼容端点,继续复用 LiteLLM 的 OpenAI provider。 |
27 | | - model: "openai/GLM-5.1" |
| 26 | + litellm_params: &zai_openai_params |
| 27 | + # 这里定义智谱 Coding Plan OpenAI 兼容入口的公共连接参数,便于同系列模型复用。 |
28 | 28 | api_base: "os.environ/Z_AI_CODING_API_BASE" # 从环境变量读智谱 Coding Plan 地址 |
29 | 29 | api_key: "os.environ/Z_AI_API_KEY" # 从环境变量读智谱密钥 |
| 30 | + # 智谱 Coding Plan 走独立 OpenAI 兼容端点,继续复用 LiteLLM 的 OpenAI provider。 |
| 31 | + model: "openai/GLM-5.1" |
30 | 32 | # 为其它官方 GLM 模型保留专属兜底,避免误落到最后的全局 `* -> NewAPI`。 |
31 | 33 | - model_name: "GLM-*" |
32 | 34 | litellm_params: |
| 35 | + # 复用智谱 Coding Plan OpenAI 兼容入口,只覆盖具体模型名。 |
| 36 | + <<: *zai_openai_params |
33 | 37 | # 由 LiteLLM 按请求中的官方模型名透传,例如 `GLM-4.7`。 |
34 | 38 | model: "openai/GLM-*" |
35 | | - api_base: "os.environ/Z_AI_CODING_API_BASE" # 从环境变量读智谱 Coding Plan 地址 |
36 | | - api_key: "os.environ/Z_AI_API_KEY" # 从环境变量读智谱密钥 |
37 | 39 | # 把 wildcard 路由放在最后,优先命中显式模型,其余上游模型再走透传兜底。 |
38 | 40 | - model_name: "*" |
39 | 41 | litellm_params: |
| 42 | + # 复用同一个 NewAPI OpenAI 兼容入口,只覆盖具体模型名。 |
| 43 | + <<: *newapi_openai_params |
40 | 44 | # 对列表外但 NewAPI 已存在的模型保留透传能力,例如 `gpt-5.4-mini`。 |
41 | 45 | model: "openai/*" |
42 | | - api_base: "os.environ/NEWAPI_API_BASE" # 从环境变量读 NewAPI 地址 |
43 | | - api_key: "os.environ/NEWAPI_KEY" # 从环境变量读密钥 |
44 | 46 |
|
45 | 47 | litellm_settings: |
46 | 48 | # 本地代理统一关闭遥测,避免开发环境把调用元数据发送到外部。 |
|
0 commit comments