# LiteLLM Proxy · 统一 OpenAI 兼容网关 # 上游:vLLM(qwen3.6-27b) + Xinference(bge-m3) model_list: # ---- 对话 / 补全(183 vLLM)---- - model_name: qwen3.6-27b litellm_params: model: openai/qwen3.6-27b api_base: http://116.62.10.183:8000/v1 api_key: "123456" timeout: 300 max_retries: 2 # Qwen3 默认会产出 thinking;网关侧默认关掉,避免占满 max_tokens extra_body: chat_template_kwargs: enable_thinking: false # 别名,方便客户端用常见名字 - model_name: qwen litellm_params: model: openai/qwen3.6-27b api_base: http://116.62.10.183:8000/v1 api_key: "123456" timeout: 300 max_retries: 2 extra_body: chat_template_kwargs: enable_thinking: false # ---- 学习用新增示例:对外新名字,仍转发到同一上游 ---- # model_name = 客户端调用时填的名字(LiteLLM 对外暴露) # litellm_params.model = openai/<上游真实模型 id> # api_base / api_key = 上游地址与密钥 - model_name: demo-chat litellm_params: model: openai/qwen3.6-27b api_base: http://116.62.10.183:8000/v1 api_key: "123456" timeout: 300 max_retries: 2 extra_body: chat_template_kwargs: enable_thinking: false # ---- 向量(207 Xinference)---- - model_name: bge-m3 litellm_params: model: openai/bge-m3 api_base: http://host.docker.internal:9997/v1 api_key: "xf-K8H3LiS27H4188XdOyWJj74MWMOlIR9tZbiybDbxbSas7eAI" timeout: 120 # ---- 学习用:负载均衡 + 手动指定机器 ---- # api_base 故意指向不存在端口,仅模拟;真实调用失败属预期 # # ① 自动负载均衡:同名两条 → 客户端 model=demo-lb,由 router 选机 - model_name: demo-lb litellm_params: model: openai/fake-qwen-a api_base: http://127.0.0.1:18001/v1 api_key: "fake-key-machine-a" timeout: 10 max_retries: 0 - model_name: demo-lb litellm_params: model: openai/fake-qwen-b api_base: http://127.0.0.1:18002/v1 api_key: "fake-key-machine-b" timeout: 10 max_retries: 0 # ② 手动指定:唯一 model_name 钉死某一台(排障 / 灰度 / 压测常用) # 同一台机器可既挂在 demo-lb 里参与均衡,又单独起一个别名 - model_name: demo-lb-a litellm_params: model: openai/fake-qwen-a api_base: http://127.0.0.1:18001/v1 api_key: "fake-key-machine-a" timeout: 10 max_retries: 0 - model_name: demo-lb-b litellm_params: model: openai/fake-qwen-b api_base: http://127.0.0.1:18002/v1 api_key: "fake-key-machine-b" timeout: 10 max_retries: 0 litellm_settings: drop_params: true set_verbose: false request_timeout: 300 num_retries: 2 # 同名多部署时的分流策略(simple-shuffle = 随机选一台) router_settings: routing_strategy: simple-shuffle general_settings: master_key: os.environ/LITELLM_MASTER_KEY