Skip to main content
any-llm is a unified interface for calling OpenAI, Anthropic, Google, local models (via Ollama/LocalAI), and more. Switch between providers just by changing a string.

Installation and setup

pip install langchain-anyllm
You need the appropriate API key for your chosen provider. API keys can be passed via the api_key parameter or set as environment variables (e.g., OPENAI_API_KEY, ANTHROPIC_API_KEY). See the any-llm documentation for provider-specific requirements.

Chat models

from langchain_anyllm import ChatAnyLLM

API reference

For detailed documentation of all ChatAnyLLM features and configurations, head to the API reference: https://github.com/mozilla-ai/langchain-any-llm
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.