Zum Hauptinhalt springen

Datei-Verwaltung

include externe YAML-Dateien in einer config.yaml

Sie können include verwenden, um externe YAML-Dateien in einer config.yaml einzubinden.

Schnellstart-Nutzung

Um eine Konfigurationsdatei einzubinden, verwenden Sie include mit entweder einer einzelnen Datei oder einer Liste von Dateien.

Inhalt von parent_config.yaml

include:
- model_config.yaml # 👈 Key change, will include the contents of model_config.yaml

litellm_settings:
callbacks: ["prometheus"]

Inhalt von 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/

Proxy-Server starten

Dies startet den Proxy-Server mit der Konfiguration parent_config.yaml. Da die Direktive include verwendet wird, werden auch die Inhalte von model_config.yaml eingebunden.

litellm --config parent_config.yaml --detailed_debug

Beispiele für die Verwendung von include

Eine einzelne Datei einbinden

include:
- model_config.yaml

Mehrere Dateien einbinden

include:
- model_config.yaml
- another_config.yaml