之前在这个博客介绍了一些:litellm Proxy 的安装与配置
确实好用,简单易用。
在命令行中安装 litellm Proxy:
bashpip install 'litellm[proxy]'
启动本地服务时,可以指定一些参数:
bashlitellm --host 0.0.0.0 --port 8000 -c litellm_config.yaml --add_key "your_key_here"
以下是一个示例配置文件,展示了如何配置多个模型:
yamlmodel_list:
- model_name: 'GPT-4'
litellm_params:
model: 'azure/GPT-4'
api_base: https://your-openai-endpoint.openai.azure.com/
api_version: '2023-12-01-preview'
api_key: 'your_api_key_here'
- model_name: 'deepseek-v3'
litellm_params:
model: 'openai/your-model-name'
api_base: https://your-api-endpoint.com/api/v3
api_key: 'your_api_key_here'
- model_name: 'qwen2.5-32B'
litellm_params:
model: 'openai/your-model-name'
api_base: http://your-api-endpoint.com/v1
api_key: 'your_api_key_here'
- model_name: 'DeepSeek-R1-Distill-Qwen-32B'
litellm_params:
model: 'openai/your-model-name'
api_base: http://your-api-endpoint.com/v1
api_key: 'your_api_key_here'
请根据实际情况替换上述配置中的占位符(如 your_key_here
、your_api_key_here
等),以确保配置正确。
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!