HubLensLLMBerriAI/litellm
BerriAI

litellm

AI#LLM#Gateway#Proxy#API#Python
View on GitHub
45,389

// summary

LiteLLM provides a unified interface to interact with over 100 LLM providers using a consistent OpenAI-compatible format. Developers can utilize it as a Python SDK for direct integration or deploy it as a production-ready proxy server. The platform simplifies LLM management by offering features like load balancing, spend tracking, and virtual keys.

// technical analysis

LiteLLM is an open-source AI gateway designed to simplify the integration of over 100 large language model providers by offering a unified, OpenAI-compatible interface. By abstracting away the complexities of provider-specific SDKs, authentication patterns, and request formats, it enables developers to switch between models seamlessly without rewriting their codebase. The project provides both a Python SDK for direct application integration and a production-ready proxy server that includes enterprise features like spend tracking, load balancing, and guardrails, effectively solving the fragmentation issues inherent in modern LLM development.

// key highlights

01
Provides a unified API that allows developers to call 100+ LLM providers using a single, consistent OpenAI-compatible format.
02
Offers a production-ready AI Gateway (Proxy Server) with built-in features like virtual keys, spend tracking, and load balancing.
03
Supports advanced agentic workflows through the A2A (Agent-to-Agent) protocol, enabling interaction with various agent frameworks.
04
Includes an MCP (Model Context Protocol) bridge and gateway to connect external tools and servers to any supported LLM.
05
Delivers high-performance routing with a P95 latency of 8ms at 1k requests per second.
06
Enables seamless model swapping, allowing teams to change LLM providers without modifying their existing application logic.

// use cases

01
Unified API for 100+ LLM providers
02
Production-ready AI Gateway with load balancing and guardrails
03
Seamless integration with MCP tools and A2A agents

// getting started

To use the Python SDK, install it via 'uv add litellm' and use the 'completion' function to call models by specifying the provider prefix. For the AI Gateway, install the proxy using 'uv tool install litellm[proxy]' and launch it with 'litellm --model <model_name>'. Once running, you can interact with the proxy server using standard OpenAI client libraries by pointing the base_url to your local instance.