Add 100+ new LLMs to your application, with a drop-in replacement for the openai chat completion call.
Hello, Iām Ishaan - one of the maintainers of LiteLLM.
TLDR; LiteLLM letās you call all LLM APIs (Azure, Anthropic, Replicate, etc.) using the OpenAI format. We translate the inputs, standardize exceptions, and guarantee consistent outputs for completion() and embedding() calls
Calling LLM APIs involved multiple ~100 line if/else statements which made our debugging problems explode.
I remember when we added Azure and Cohere to our chatbot. Azureās API calls would fail so we implemented model fallbacks - (e.g. if Azure fails, try Cohere then OpenAI etc.). However, provider-specific logic meant our code became increasingly complex and hard to debug.
Thatās when we decided to abstract our LLM calls behind a single package - LiteLLM. We needed I/O that just worked, so we could spend time improving other parts of our system (error-handling/model-fallback logic, etc.).
LiteLLM does 3 things really well:
The next big challenge was adding new LLM APIs. Each addition involved 3 changes:
replicate/llama2-chat-...
to a user-facing alias llama2
.Since LiteLLM integrates with every LLM API - we provide all of this out of the box with zero configuration. With a single environment variable - LITELLM_EMAIL
you can automatically add 100+ new LLM API integrations into your production server, without modifying code / redeploying changes š LiteLLM UI