What do you want to do?
5 use cases
-
Call 100+ LLM providers through one OpenAI-format API
Switch between OpenAI, Anthropic and other providers in Python without rewriting request code.
- Litellm
- Software and DevOps
- Intermediate
View prompt
Using the litellm repo at <path>, write a short Python script that sends the message 'Hello!' to openai/gpt-4o and to anthropic/claude-sonnet-4-20250514 through litellm.completion. Expected output: two printed responses. Verify that both API keys are set in the environment before running.
-
Give LLM calls access to MCP server tools
Load tools from an MCP server and pass them to any LiteLLM model in OpenAI format.
- Litellm
- Cursor
- Software and DevOps
- Advanced
View prompt
Using the litellm repo at <path>, connect to the MCP server at <path>/mcp_server.py, load its tools in OpenAI format, and ask gpt-4o 'What is 3 + 5?' with those tools. Expected output: a model response that uses the MCP tool. Verify the tool list is not empty before the call.
-
Run Claude Code or Codex on any model through the gateway
Start a coding agent in a local repo and route all its model calls through your AI Gateway.
- Litellm
- Claude Code
- Codex
- Software and DevOps
- Advanced
View prompt
In the litellm repo at <path>, run litellm.agent with Harness.CLAUDE_CODE on the local repo at <repo_path> with the task 'Find why tests/test_router.py is flaky'. Expected output: the agent's text result, its cost, and a list of changed file paths. Verify that LITELLM_PROXY_API_BASE and LITELLM_PROXY_API_KEY are set before running.
-
Call A2A agents through the AI Gateway
Register an A2A agent on the gateway and send it messages from any A2A client.
- Litellm
- Software and DevOps
- Advanced
View prompt
Using the litellm repo at <path>, register the agent <agent_name> on the gateway and send it the message 'Hello!' through an A2A client pointed at http://localhost:4000/a2a/<agent_name>. Expected output: the agent's text reply printed to the console. Verify that the agent card loads before sending the message.
How to use Litellm
- Check you have what it needs: Python and the uv package manager installed; API keys for the LLM providers you plan to call, such as OpenAI or Anthropic; For the gateway use cases: a machine to run the proxy server on and a LiteLLM master key or virtual key for clients.
- Open BerriAI/litellm on GitHub and read the README and license.
- Install the SDK with
uv add litellm - Set the provider keys as environment variables, such as OPENAI_API_KEY and ANTHROPIC_API_KEY
- Call
completionfrom Litellm with a model such as openai/gpt-4o - Change the model string to anthropic/claude-sonnet-4-20250514 and run the same call again
These steps come from our top use case, Call 100+ LLM providers through one OpenAI-format API, which also has a copy-paste agent prompt.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeLitellm alternatives · Best AI repos for Software and DevOps
About this repo
- Who it is forDevelopers and platform teams who call several LLM providers and want one API format, or who need a shared gateway for a team.
- Why it is hot
- LanguagePython
- Sourcegithub.com/BerriAI/litellm · Back to Hot repos
Requirements
- Python and the uv package manager installed
- API keys for the LLM providers you plan to call, such as OpenAI or Anthropic
- For the gateway use cases: a machine to run the proxy server on and a LiteLLM master key or virtual key for clients
Add this badge to your README
Maintain Litellm? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/berriai-litellm/?utm_source=github&utm_medium=badge&utm_campaign=BerriAI-litellm)
HTML
<a href="https://dedupedai.com/use-cases/berriai-litellm/?utm_source=github&utm_medium=badge&utm_campaign=BerriAI-litellm"><img src="https://dedupedai.com/badge/BerriAI/litellm.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Litellm
What is Litellm?
LiteLLM is an open source AI Gateway and Python SDK that lets you call 100+ LLM providers through one OpenAI-format interface, with cost tracking, guardrails, and load balancing. It is an open-source project on GitHub: https://github.com/BerriAI/litellm.
Who is Litellm for?
Developers and platform teams who call several LLM providers and want one API format, or who need a shared gateway for a team.
What can I do with Litellm?
5 use cases so far, for example: Call 100+ LLM providers through one OpenAI-format API; Run a shared self-hosted AI Gateway for your team; Give LLM calls access to MCP server tools. Each has steps and a copy-paste agent prompt.
What do I need to run Litellm?
Python and the uv package manager installed; API keys for the LLM providers you plan to call, such as OpenAI or Anthropic; For the gateway use cases: a machine to run the proxy server on and a LiteLLM master key or virtual key for clients.
What are alternatives to Litellm?
Other hot AI repos in Software and DevOps: Omarchy Local AI, Hermes Plan Mode, Agent 2, Agnes Harness, Skills.
Is Litellm safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.