# any-llm Documentation
> Complete documentation for any-llm - A Python library providing a single interface to different llm providers.
This file contains all documentation pages concatenated for easy consumption by AI systems.
---
## index.md
`any-llm` is a Python library providing a single interface to different llm providers.
### Getting Started
Refer to the [Quickstart](#./quickstart.md) for instructions on installation and usage.
### Parameters
For a complete list of available functions and their parameters, see the [completion API documentation](#./api/completion.md).
### 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](#./api/exceptions.md).
## For AI Systems
This documentation is available in two AI-friendly formats:
- **[llms.txt](https://mozilla-ai.github.io/any-llm/llms.txt)** - A structured overview with curated links to key documentation sections
- **[llms-full.txt](https://mozilla-ai.github.io/any-llm/llms-full.txt)** - Complete documentation content concatenated into a single file
---
## quickstart.md
## Quickstart
### Requirements
- Python 3.11 or newer
- API_KEYS to access to whichever LLM you choose to use.
### Installation
In your pip install, include the [supported providers](#./providers.md) that you plan on using, or use the `all` option if you want to install support for all `any-llm` supported providers.
```bash
pip install 'any-llm-sdk[mistral,ollama]'
```
Make sure you have the appropriate API key environment variable set for your provider. Alternatively,
you could use the `api_key` parameter when making a completion call instead of setting an environment variable.
```bash
export MISTRAL_API_KEY="YOUR_KEY_HERE" # or OPENAI_API_KEY, etc
```
### Basic Usage
[`completion`][any_llm.completion] and [`acompletion`][any_llm.acompletion] use a unified interface across all providers.
The provider_id key of the model should be specified according the [provider ids supported by any-llm](#./providers.md).
The `model_id` portion is passed directly to the provider internals: to understand what model ids are available for a provider,
you will need to refer to the provider documentation.
```python
from any_llm import completion
import os
# Make sure you have the appropriate environment variable set
assert os.environ.get('MISTRAL_API_KEY')
model = "mistral/mistral-small-latest" # /
# Basic completion
response = completion(
model=model,
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
```
In that above script,
updating to use an ollama hosted mistral model (assuming that you have ollama installed and running)
is as easy as updating the model to specify the ollama provider and using
[ollama model syntax for mistral](https://ollama.com/library/mistral-small3.2)!
```python
model="ollama/mistral-small3.2:latest"
```
---
## providers.md
# Supported Providers
`any-llm` supports the below providers. In order to discover information about what models are supported by a provider
as well as what features the provider supports for each model, refer to the provider documentation.
---
## api/completion.md
## Completion
::: any_llm.completion
::: any_llm.acompletion
---
## api/exceptions.md
## Exceptions
::: any_llm.exceptions
---
## api/helpers.md
## Helpers
::: any_llm.verify_kwargs
---