LiteLLM

LiteLLM is a Python library and proxy server that provides a unified interface to call over 100 LLMs using the OpenAI format, with features like retry logic, co

Introduction

LiteLLM is an open-source tool designed to simplify interactions with large language models (LLMs) by offering a consistent API based on the OpenAI input/output format. It supports more than 100 LLMs from providers such as OpenAI, Anthropic, Azure, Hugging Face, and others, enabling developers to integrate multiple models without changing their code. Key features include:

  • Unified Interface: Translate inputs to various providers' endpoints for completions, embeddings, and image generation.
  • Retry and Fallback Logic: Automatically handle failures across deployments using the Router feature.
  • Cost Tracking and Budget Management: Monitor spend per project and set limits.
  • Observability: Log inputs and outputs with integrations for tools like MLflow, Langfuse, and Helicone.
  • Proxy Server: Acts as an LLM gateway for centralized access, rate limiting, and authentication hooks.
  • Streaming Support: Enable real-time responses for compatible models.
  • Exception Handling: Map errors to OpenAI exceptions for consistent error management.

Use cases include building AI applications, enabling ML platform teams to manage multiple LLMs, and developers seeking a scalable solution for model integration. It is ideal for projects requiring flexibility, cost control, and robust error handling.

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates