# Models

## Overview

Model configuration in `any-agent` is designed to be consistent across all supported frameworks. We use [any-llm](https://mozilla-ai.github.io/any-llm/) as the default model provider, which acts as a unified interface allowing you to use any language model from any provider with the same syntax.

## Configuration Parameters

The model configuration is defined through several parameters in [AgentConfig](https://docs.mozilla.ai/any-agent/api-reference/config):

The `model_id` parameter selects which language model your agent will use. The format depends on the provider.

The `model_args` parameter allows you to pass additional arguments to the model, such as `temperature`, `top_k`, and other provider-specific parameters.

The `api_base` parameter allows you to specify a custom API endpoint. This is useful when:

* Using a local model server (e.g., Ollama, llama.cpp, llamafile)
* Routing through a proxy
* Using a self-hosted model endpoint

The `api_key` parameter allows you to explicitly specify an API key for authentication. By default, `any-llm` will automatically search for common environment variables (like `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.).

See the [AnyLLM Provider Documentation](https://mozilla-ai.github.io/any-llm/providers/) for the complete list of supported providers.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mozilla.ai/any-agent/agents/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
