- Direct SDK integration - Using the LiteLLM Python SDK
- Proxy Server integration - Using LiteLLM as an OpenAI-compatible proxy
Prerequisites
For both integration methods, you’ll need:LITELLM_API_KEY first. If it’s not set, it falls back to the provider-specific key for the model you’re using, e.g. OPENAI_API_KEY for an OpenAI model.
SDK Integration
TheLiteLLM class provides direct integration with the LiteLLM Python SDK.
Basic Usage
Using Hugging Face Models
LiteLLM can also work with Hugging Face models:Configuration Options
TheLiteLLM class accepts the following parameters:
Examples
View more examples here.