Blank white background with no objects or features visible.

「Gartner Hype Cycle for AI Governance 2026」の全編を無料で公開しています。レポートを入手する →

LiteLLM Tutorial: Install, Configure, Run the Proxy

By 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.

Start free
Table of Contents

One Gateway for Every LLM, Agent and MCP Server

Book a 30-min with our AI expert

Book a Demo

The fastest way to build, govern and scale your AI

Book Demo
Summarize with
ChatGPT logo by OpenAI
Perplexity AI logo
Blurry red snowflake on white background, symmetrical frosty design with soft edges and abstract shape.

Discover More

No items found.
October 16, 2026
|
5 min read

LiteLLM Tutorial: Install, Configure, Run the Proxy

No items found.
October 16, 2026
|
5 min read

LiteLLM Caching: Redis, Semantic Cache, What Breaks

No items found.
10 Best AI Observability Platforms for LLMs in 2026
October 16, 2026
|
5 min read

2026年版 LLM向けAIオブザーバビリティプラットフォーム ベスト10

No items found.
October 15, 2026
|
5 min read

Bedrock Guardrails Through the AI Gateway: Setup and Cost

No items found.
No items found.

Recent Blogs

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

Frequently asked questions

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.

Take a quick product tour
Start Product Tour
Product Tour