Intro
any-llm
is a Python library providing a single interface to different llm providers.
Demo
Try any-llm
in action with our interactive chat demo that showcases streaming completions and provider switching:
The demo features real-time streaming responses, multiple provider support, and collapsible "thinking" content display.
Getting Started
Refer to the Quickstart for instructions on installation and usage.
API Documentation
any-llm
provides two main interfaces:
Direct API Functions (recommended for simple use cases): - completion - Chat completions with any provider - embedding - Text embeddings - responses - OpenAI-style Responses API
AnyLLM Class (recommended for advanced use cases): - Provider API - Lower-level provider interface with metadata access and reusability
Error Handling
any-llm
provides custom exceptions to indicate common errors like missing API keys
and parameters that are unsupported by a specific provider.
For more details on exceptions, see the exceptions API documentation.
For AI Systems
This documentation is available in two AI-friendly formats:
- llms.txt - A structured overview with curated links to key documentation sections
- llms-full.txt - Complete documentation content concatenated into a single file