How to Install LiteLLM and Call 100+ AI Models With One API
LiteLLM is a gateway that lets you call more than 100 AI models through one consistent interface, with cost tracking and load balancing. This guide explains what it does and how to install it.
What is LiteLLM?
LiteLLM is an open-source gateway for AI models. Instead of learning a different API for every provider, you call them all through one consistent interface: the same code works for OpenAI, Anthropic, Google, and more than a hundred other models. It also tracks costs, enforces limits, and balances load, and it can run as a proxy so a whole team shares one endpoint.
The project is published as open source on GitHub, where you can read the source code and the README.
What can you do with it?
- Call many AI models with the same code, and switch models by changing one setting
- Track spending and set limits per key, user or team
- Balance load across providers and fall back to another model if one fails
- Run it as a shared proxy so a whole team uses one endpoint
How to install LiteLLM
Install it with uv, the Python package manager. Open a terminal and run:
uv add litellmThat adds LiteLLM to your project. You will also need API keys for the providers you want to use, because LiteLLM is a gateway: it forwards your requests to the model providers, and those providers bill you for the usage.
First steps after installing
Start by calling one model through LiteLLM with a key you already have, and confirm the answer comes back as expected. Then try the same code with a different provider by changing only the model name: that is the moment the idea clicks. Next, turn on spend tracking to see what each call costs, and try the proxy mode if you want your team to share one endpoint with limits per user.
Frequently asked questions
Is LiteLLM free? The software is free and open source. The models you call through it are billed by their providers, so you need API keys and you pay for usage.
Is it hard to install? No. One command adds it to your project, and the README covers the proxy setup.
How do I uninstall it? The README does not list uninstall steps, so check the project's GitHub page for the exact removal instructions.
Comments (0)