Core Concepts of liteLLM Proxy
mainThe liteLLM Proxy acts as a middleware layer between your application and various LLM providers. Key features include:
- Consistent Interface: Call any model (Azure, OpenAI, Anthropic, etc.) using the standard OpenAI
completion(model, messages)format. - Error Handling & Fallbacks: Automatically handle failures by falling back to alternative models (e.g., if
GPT-4fails, tryllama2). - Observability: Log requests, responses, and errors to providers like Supabase, Posthog, Mixpanel, Sentry, Helicone, and more.
- Token Tracking: Monitor input/completion tokens and total spend per model.
- Semantic Caching: Implement caching to reduce latency and costs.
- Streaming & Async: Supports streaming text responses via generators and asynchronous calls.