Who it is forA Python developer who calls more than one LLM provider and is tired of learning a different SDK and request format for each one.
The problemEach provider has its own SDK, auth pattern, request format and error types, so every new model adds integration work.
The outcomeOne completion call in OpenAI format returns responses from different providers by changing only the model string.
What you need first
- 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
Steps
- 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
Prompt for your agent
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.
Caveat. You still need a valid account and API key for each provider you call, and the provider's own pricing and limits apply.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page