models

A configuration guide for choosing and customizing the language model used by any-agent. any-llm provides one common way to connect agents to models from different providers, including local or self-hosted models.

In plain words
What is it for?
Use it to select a model, pass provider-specific settings, connect to Ollama or another local model server, route requests through a proxy, or provide authentication.
Why use it?
It avoids rewriting agent configuration for each model provider and lets you control settings such as the model, API endpoint, and API key.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/mozilla-ai/any-agent/models
Clone the repo
git clone --depth 1 https://github.com/mozilla-ai/any-agent
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 279 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00279
Opus 5 $0.00000 $0.00139
Sonnet 5 $0.00000 $0.00056
Haiku 4.5 $0.00000 $0.00028

Measured yesterday against content hash c2ada1944c3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

models scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/models.md · 24 lines

What it actually says

Model Configuration

Overview

Model configuration in any-agent is designed to be consistent across all supported frameworks. We use 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:

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 for the complete list of supported providers.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 24 lines · 0 tokens per session scan A c2ada1944c3c

Subscribe to this mod's changes

models is an agent published in the GitHub repository mozilla-ai/any-agent (1,197 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 279 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.