LiteLLM CLI Cheatsheet - Unified LLM Gateway & Proxy Server

The moment one application must talk to OpenAI, Anthropic, Gemini and a couple of self-hosted endpoints, the code is not what breaks - the cross-cutting concerns do: scattered credentials, retry and rate-limit policy, cost attribution, and graceful degradation when one vendor degrades. LiteLLM collapses all four into a single proxy process so the application only ever sees one OpenAI-compatible endpoint and switching vendors is a base_url change. The rule for whether to adopt it is vendor count: with exactly one provider the official SDK is one less moving part; as soon as you need failover or budget-based routing, the cost visibility the proxy provides pays for itself. This sheet covers installation, the one-line CLI proxy, config.yaml-driven production setup, routing and operations. What matters most is learning how routing and budgets are declared, and then running the built-in connectivity check after every config edit instead of discovering a dead backend in production.

AI CLI·25 commands·Last updated 2026-08-23
litellmllm-gatewayaicliproxyopenai-compatible

Install 5

uv tool install 'litellm[proxy]'
Recommended: install proxy build via uv
pip install "litellm[proxy]"
Alternative: pip install proxy build
litellm --version
Show installed version
litellm --help
Show all subcommands
python -c "import litellm; print(litellm.__version__)"
Confirm the Python package loads

Start Proxy (one-liner) 5

litellm --model gpt-3.5-turbo
OpenAI-compatible proxy (default :4000)
litellm --model anthropic/claude-...
anthropic/ prefix routes to Claude
litellm --model ollama/
ollama/ prefix uses local Ollama
litellm --model bedrock/anthropic.claude-v2
bedrock/ prefix uses AWS Bedrock
litellm --model vllm/<model>
vllm/ prefix uses local vLLM

Config-driven (prod) 5

litellm --config config.yaml
Launch from a config (model list/keys/routing)
litellm --config config.yaml --detailed_debug
Verbose debug logging for troubleshooting
litellm --test
Self-test: send one request to the proxy
litellm --test <model>
Connectivity test for a specific model
export OPENAI_API_KEY=...
Set the backend provider key

Routing & Ops 5

openai_api_base=http://0.0.0.0:4000
Point clients at the LiteLLM proxy
curl http://0.0.0.0:4000/v1/models
List models exposed by the proxy
litellm --model <provider>/ --api_base <url>
Point at a custom OpenAI-compatible endpoint
litellm --drop_params
Drop unsupported params to improve compatibility
litellm --telemetry False
Disable telemetry (privacy/offline)

Tips 5

One-liner suits local validation
Quickly try different providers
Use --config in prod, not one-liners
Centralize keys/routing/budgets
provider/ prefix is the key
openai/ anthropic/ ollama/ decide routing
--test after config changes
Avoid discovering breakage in prod
Proxy unifies the OpenAI protocol
Old OpenAI clients just change base_url

Tips

  • LiteLLM uses the provider/ prefix to route 100+ models to one OpenAI-compatible interface — the de-facto gateway for multi-provider fallback, cost, and rate-limiting.
  • For quick local validation use a one-liner litellm --model <provider/model>; in production always use --config config.yaml to centralize keys, routing, and budgets.
  • The proxy listens on :4000 by default; legacy OpenAI clients switch providers by just changing base_url — near-zero migration cost.
  • After config changes, run litellm --test to self-check connectivity before shipping.

FAQ

What is the difference between the one-liner and a config file?

The one-liner litellm --model gpt-3.5-turbo is ideal for local verification — a proxy is up in seconds and you can try different providers quickly. Production should use --config config.yaml, centralizing model lists, keys, routing and budgets in a file that can be version controlled and permission restricted, and which keeps secrets out of your shell history.

What role do provider prefixes play in LiteLLM?

They route the request: openai/ to OpenAI, anthropic/ to Claude, ollama/ to a local Ollama, bedrock/ to AWS Bedrock, vllm/ to a local vLLM. With these prefixes, switching backends means changing only the model name rather than the client code. The proxy exposes the OpenAI protocol externally, so existing clients just need a different base_url.

How do I confirm connectivity after changing config?

Run litellm --test, which issues a test request against the current configuration and reports the result; litellm --test <model> checks one specific model. Once the proxy is up, curl http://0.0.0.0:4000/v1/models confirms the exposed model list is what you expect. Add --detailed_debug for verbose logs while troubleshooting.

What if the backend rejects an unsupported parameter?

Add --drop_params, which discards parameters the backend does not understand to improve compatibility. It lets a newer SDK work against an older provider without code changes. The trade-off is that the dropped parameter has no effect — if it mattered to your logic, switch to a backend that supports it rather than silently discarding it.

How do I disable telemetry in LiteLLM?

Use litellm --telemetry False. Telemetry reports usage upstream, so it should be disabled in privacy-sensitive or offline environments; it also makes outbound requests, which slows startup or fails outright on an air-gapped network. Production deployments normally declare this alongside logging settings in the config file.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Aug 23, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us