LiteLLM is a versatile tool designed to simplify interaction with over 100 Large Language Models (LLMs) by providing a consistent OpenAI Input/Output Format. It acts as a universal interface, translating your requests to various providers' completion, embedding, and image_generation endpoints.
Key Features:
- Unified API: Call 100+ LLMs using a single, familiar OpenAI-like interface.
- Consistent Output: Text responses are always available at
['choices'][0]['message']['content'], ensuring predictable data handling. - Robust Routing & Fallbacks: Implement retry and fallback logic across multiple deployments (e.g., Azure/OpenAI) using its built-in Router.
- Cost Management: Track spend and set budgets per project, especially useful with the LiteLLM Proxy Server.
How to Use LiteLLM: LiteLLM offers two primary modes of operation:
- LiteLLM Proxy Server (LLM Gateway): Ideal for Gen AI Enablement or ML Platform Teams, this server provides a central service to access and manage multiple LLMs. It enables unified access, LLM usage tracking, guardrail setup, and custom logging, guardrails, and caching per project.
- LiteLLM Python SDK: Perfect for developers building LLM projects in Python, this SDK offers a unified client to access 100+ LLMs directly within your code, complete with load balancing, cost tracking, and retry/fallback logic.

