LiteLLM
LiteLLM provides a unified API proxy for 100+ LLM providers.
Setup
- Set up LiteLLM Proxy server
- Configure LiteLLM client in BAML
- Use in BAML functions
Basic Example
client<llm> MyClient {
provider "openai-generic"
options {
base_url "http://0.0.0.0:4000"
api_key env.LITELLM_API_KEY
model "gpt-4o"
}
}
BAML-Specific Options
| Option | Type | Default | Description |
|---|---|---|---|
base_url | string | - | LiteLLM proxy URL |
api_key | string | env.LITELLM_API_KEY | API key |
model | string | - | Model identifier |
See OpenAI Generic for all supported options.