any-llm gives Python code a single interface to many LLM providers. A completion call takes a provider identifier and a model identifier, so moving from one provider to another is a string change rather than a code change, and a responses call covers providers that implement the OpenAI-style Responses API. It requires Python 3.11 or later plus API keys for the providers you use.
The library calls each provider's own official SDK instead of reimplementing its wire protocol, and it runs in your process with no proxy server in between. Providers are installed as extras — one provider, several, or all of them — and an OpenAI-compatible gateway or local server without a dedicated provider entry can be reached through a custom endpoint.
There are two entry points with the same feature set. Module-level functions create a client per call and suit scripts, notebooks, and single requests; a client class reuses a connection pool for applications that make many requests. Models can be addressed as separate provider and model arguments or as a combined provider:model string, and a list-models call enumerates what a provider offers where that is supported.
Migrating from LiteLLM keeps existing API keys and environment variables, changing only the import and the model string format. A separate gateway, Otari, adds budget management, API key management, usage analytics, and multi-tenant support on top.
Features
- Unified interface: one function signature across providers, selected by a provider identifier
- Official provider SDKs: each provider is called through its own maintained client library
- No proxy: requests go straight from your process to the provider
- Per-provider extras: install only the providers you need, or all of them at once
- Custom endpoints: OpenAI-compatible gateways and local servers work without a dedicated provider entry
- Responses API: a responses function returning an OpenAI-compatible Responses object
- Streaming and tools: both entry points support streaming and tool calling
- Connection reuse: the client class pools connections for production workloads
- Type hints: full typing for editor completion and explicit error messages
- Model discovery: a list-models call enumerates a provider's models where available
- Async variants: asynchronous counterparts for completions and responses
