文件管理
include
在 config.yaml 中包含外部 YAML 文件
您可以使用 include
在 config.yaml 中包含外部 YAML 文件。
快速入门用法
要包含配置文件,请使用 include
并指定单个文件或文件列表。
parent_config.yaml
的内容
include:
- model_config.yaml # 👈 Key change, will include the contents of model_config.yaml
litellm_settings:
callbacks: ["prometheus"]
model_config.yaml
的内容
model_list:
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_base: https://exampleopenaiendpoint-production.up.railway.app/
- model_name: fake-anthropic-endpoint
litellm_params:
model: anthropic/fake
api_base: https://exampleanthropicendpoint-production.up.railway.app/
启动代理服务器
这将使用 `parent_config.yaml` 启动代理服务器。由于使用了 `include` 指令,服务器还将包含 `model_config.yaml` 的内容。
litellm --config parent_config.yaml --detailed_debug
使用 include
的示例
包含单个文件
include:
- model_config.yaml
包含多个文件
include:
- model_config.yaml
- another_config.yaml