Blank white background with no objects or features visible.

Nous vous offrons un accès gratuit à l'intégralité du Gartner Hype Cycle for AI Governance 2026. Obtenez votre exemplaire →

LiteLLM Tutorial: Install, Configure, Run the Proxy

Par Abhilash Sanap

Published: October 16, 2026

TL;DR

To install LiteLLM, run uv tool install 'litellm[proxy]' (or use Docker / Docker Compose with Postgres), define models in config.yaml, set an sk- master key plus a permanent salt key, and point any OpenAI SDK client at http://localhost:4000. Add Redis before you scale past one worker or replica. This LiteLLM tutorial walks through each step and the misconfigs that bite in week one.

How to install LiteLLM (pick a path)

This LiteLLM tutorial walks platform engineers through installing the proxy, writing a minimal config.yaml, setting the master key, sending a first OpenAI-SDK request, adding models, enabling Redis for multi-worker setups, and avoiding the misconfigs that show up in the first week of production. Commands follow the official LiteLLM quickstarts. Pin versions when you promote beyond a laptop—LiteLLM ships minors roughly weekly. New to the pattern itself? Start with what an LLM gateway is and why platform teams put one in front of model providers.

Figure 1. Install paths: pip/uv, Docker + config, or Compose quickstart with Postgres.

Path A: pip / uv (gateway on your machine)

Official gateway quickstart installs the proxy extras with uv:

‍

Try now.

One gateway for all your models, MCP servers, and agents.
No credit card needed.

INSCRIVEZ-VOUS
Table des matières

Gouvernez, déployez et suivez l'IA dans votre propre infrastructure

Réservez un séjour de 30 minutes avec notre Expert en IA

Réservez une démo

Le moyen le plus rapide de créer, de gérer et de faire évoluer votre IA

Démo du livre
Summarize with
ChatGPT logo by OpenAI
Perplexity AI logo
Blurry red snowflake on white background, symmetrical frosty design with soft edges and abstract shape.

Découvrez-en plus

Aucun article n'a été trouvé.
October 16, 2026
|
5 min de lecture

LiteLLM Tutorial: Install, Configure, Run the Proxy

Aucun article n'a été trouvé.
October 16, 2026
|
5 min de lecture

LiteLLM Caching: Redis, Semantic Cache, What Breaks

Aucun article n'a été trouvé.
10 Best AI Observability Platforms for LLMs in 2026
October 16, 2026
|
5 min de lecture

10 meilleures plateformes d'observabilité de l'IA pour les LLM en 2026

Aucun article n'a été trouvé.
October 15, 2026
|
5 min de lecture

Bedrock Guardrails Through the AI Gateway: Setup and Cost

Aucun article n'a été trouvé.
Aucun article n'a été trouvé.

Blogs récents

Black left pointing arrow symbol on white background, directional indicator.
Black left pointing arrow symbol on white background, directional indicator.

Questions fréquemment posées

How do I install LiteLLM and run the proxy?

Install the proxy extras with uv tool install 'litellm[proxy]' (or pip install 'litellm[proxy]' in a virtualenv), write a config.yaml with a model_list, and start it with litellm --config config.yaml. The proxy listens on port 4000 by default. If you need the Admin UI, virtual keys, and spend tracking, use the Docker Compose quickstart, which adds Postgres.

How does an OpenAI SDK client talk to the LiteLLM proxy?

Set the client’s base_url to the proxy (for example http://localhost:4000 or your ingress) and pass a LiteLLM virtual key as api_key. The model field is the public model_name from config.yaml, and responses come back in OpenAI format. On a config-only run without a database, the master key is the Bearer credential, but apps should get virtual keys in any shared setup.

Why do I need Redis for a multi-replica LiteLLM deployment?

Without shared Redis, each worker or replica keeps its own rate-limit counters, router state, and cache. A 100 RPM limit across four workers then effectively allows about 400, revoked keys can linger on other workers, and cache hits stay local. Configure Redis in both router_settings and litellm_settings.cache_params—setting REDIS_HOST in the environment alone is not enough.

Does the TrueFoundry AI Gateway integrate with my existing observability stack?

Yes. The gateway is OpenTelemetry-compliant and plugs into Grafana, Datadog, Prometheus, or your preferred stack. Every request is traced from prompt to model execution, so metrics such as latency, cost, and errors land next to your existing dashboards.

Faites un rapide tour d'horizon des produits
Commencer la visite guidée du produit
Visite guidée du produit