any-llm provides a single interface to interact with multiple LLM providers via a unified API. It supports OpenAI, Anthropic, Atlas Cloud, Mistral, Ollama, and more, with provider-specific keys and environment variables for configuration.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
any-llm offers a unified interface to communicate with various LLM providers through a common API surface. It supports switching providers by changing model strings and provider identifiers, and leverages official provider SDKs where available.
How it works
The project exposes functions such as completion and a class AnyLLM for managing provider connections. It enables both direct API usage and an AnyLLM instance approach for reusable clients. It maintains compatibility with provider SDKs and supports environment variable-based API keys as well as direct key passing. The README shows examples using environment variables and model strings that encode provider and model information.
Getting started
Install a provider subset or all providers via Pip:
pip install 'any-llm-sdk[openai]'
pip install 'any-llm-sdk[mistral,ollama]'
pip install 'any-llm-sdk[all]'
Set API keys, for example:
export OPENAI_API_KEY="your-key-here"
export ANTHROPIC_API_KEY="your-key-here"
export MISTRAL_API_KEY="your-key-here"
Use the direct completion function or the AnyLLM class as shown:
from any_llm import completion
response = completion(
model="mistral-small-latest",
provider="mistral",
messages=[{"role": "user", "content": "Hello!"}]
)
Or:
from any_llm import AnyLLM
llm = AnyLLM.create("mistral", api_key="your-mistral-api-key")
response = llm.completion(
model="mistral-small-latest",
messages=[{"role": "user", "content": "Hello!"}]
)
Recent releases
Latest releases include 1.23.0 (2026-07-29) adding Kenari provider and cerebras annotation fix; 1.22.1 (2026-07-22) fix for replayed input items; 1.22.0 (2026-07-22) adds Eden AI provider and deprecation-related fixes; 1.21.0 (2026-07-16) fixes tests and bumps dependencies; 1.20.0 (2026-07-14) adds Atlas Cloud provider and Ollama feature.
Traction
stars_7d: 0 stars_1d: 0
Behind the repo
mozilla-ai is the organization behind this repository, with multiple provider integrations and a focus on unified LLM access.
Caveats
License: Apache-2.0. Created: 2025-07-14. Last push: 2026-08-04. Open issues: 43. Language: Python. The project targets Python 3.11+. Installation requires API keys for chosen providers.






