What you are going to build
You will finish this course with a model gateway for a support team: one address every app calls, with cheap and careful models, fallbacks when a provider fails, caching and cost tracking.
LiteLLM is an open-source Python library and server that calls more than a hundred model providers through one interface, in the OpenAI format. As a library it is a function you call. As a gateway, called the proxy in its docs, it is a server your whole company's apps send requests to.
No API key
LiteLLM can answer without calling anyone, and it lets you plug in your own provider class. In lesson 4 you write a stand-in provider that sorts support tickets, and in lesson 7 two that fail on purpose, so retries and fallbacks can be seen working. Every output is from a real run.
What you need
- Python 3.10 or later.
- Functions, classes, async and Pydantic from Python for AI, and the idea of an API from APIs for AI.
pip install "litellm[proxy]==1.101.0" tenacity prisma openai[proxy] adds the gateway server. tenacity is needed for retries in lesson 9 and prisma for the gateway's key checks in lesson 17; lessons 9 and 17 show what happens without them. openai is used to call the gateway in lesson 16.
Every expert started right here.