# mozilla-ai/any-llm

Communicate with an LLM provider using a single interface

Repository: https://github.com/mozilla-ai/any-llm
Canonical: https://ross.abutalabs.com/products/any-llm
Homepage: https://docs.mozilla.ai/any-llm
Language: Python
License: Apache-2.0
License Family: permissive
Topics: inference, llm, text-completion, ai, anthropic, developer-tools, openai, python
Last push: 2026-08-26T15:16:43+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 86, longevity 29
- inputs: {"age_days": 415, "days_push": 7, "days_rel": 16, "gap_med": 2.0, "n_releases_24m": 79}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2171, forks 216 (observed 2026-08-28T04:06:21.713852+00:00)

## What it is
any-llm is a Python library from Mozilla.ai that provides a single, unified interface for calling many LLM providers (OpenAI, Anthropic, Mistral, Ollama, Azure, and more) via one completion/embedding API. Switching providers requires only changing a provider parameter and API key, with unified exception handling, streaming, and tool calling support.

## Use cases
- switch between openai and anthropic without changing code
- unified python api for multiple llm providers
- call local ollama models with the same code as openai
- migrate from litellm to a lighter sdk
- compare llm provider costs with one interface
- add streaming and tool calling across providers
- build a library that lets users pick their llm provider

## When to choose
- you want a lightweight, provider-agnostic LLM client in Python
- you need to swap or benchmark multiple LLM providers with minimal code changes
- you want unified exception handling and streaming across providers
- you're migrating from LiteLLM and want compatible env vars and model strings

## When to avoid
- you only ever call a single provider's official SDK
- you need features like provider-side routing, caching, or spend tracking that gateway platforms offer
- you're not using Python 3.11+

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, sdk, http-client
- domain: large-language-models, artificial-intelligence, developer-tools, apis
- platform: python, cross-platform
- tags: unified-api, llm-providers, openai-compatible, provider-agnostic, litellm-alternative, streaming, tool-calling, embeddings

## Member repositories
- mozilla-ai/any-llm (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:21.713852+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:49:15.569703+00:00, confidence not recorded.
  - readme: https://github.com/mozilla-ai/any-llm (fetched 2026-08-28T04:06:21.713852+00:00, sha c4e36a5d66f4)
  - homepage: https://docs.mozilla.ai/any-llm (fetched 2026-08-29T10:29:24.135914+00:00, sha 383a948c569a)
  - site_page: https://docs.mozilla.ai/quickstart (fetched 2026-08-29T10:29:24.144981+00:00, sha 1e4b7f312c52)
  - site_page: https://docs.mozilla.ai/cookbooks/any-llm-getting-started (fetched 2026-08-29T10:29:24.146976+00:00, sha 27bbab8b628d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
