any-llm

Active
GitHub Python Apache-2.0

Description

Mozilla's unified LLM interface to access multiple providers without switching SDKs.

Key Features

  • Unified API — Write once, run across providers
  • Full coverage — OpenAI, Anthropic, Mistral, Ollama, vLLM, etc.
  • Observable — Call trace and token stats
  • Streaming — Unified streaming interface
  • Local-first — Local LLM support by default
  • Open-source — Officially maintained by Mozilla

Use Cases

💡 Plug multiple LLM providers into an agent framework.
💡 Run cross-provider regression tests in CI.
💡 Seamlessly switch between local and cloud LLMs.

Quick Start

# Install
pip install any-llm
# Unified call
from any_llm import completion
resp = completion(
    model='openai/gpt-4o',
    messages=[{'role':'user','content':'hi'}],
)
print(resp.choices[0].message.content)

Related Projects