Model Presets

yoagent's first-class model presets are the ModelConfig::* constructors. A preset sets provider routing, base URL, context metadata, default output limits, and provider compatibility flags.

Use a preset when the provider is listed here. Use a custom ModelConfig when you need a compatible provider or endpoint that does not have a constructor yet.

First-Class Constructors

ConstructorProviderProtocolDefault Base URLContextDefault Max Output
ModelConfig::anthropic(id, name)AnthropicAnthropicMessageshttps://api.anthropic.com/v1200K, or the model's own when yoagent knows its limits16,000, or derived from the model's own when yoagent knows its limits
ModelConfig::claude_fable_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_fable_5_1()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_fable_5_2()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_opus_5_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_opus_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_opus_4_8()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_sonnet_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_sonnet_5_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_sonnet_4_6()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_haiku_5_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v11M64,000
ModelConfig::claude_haiku_4_5()AnthropicAnthropicMessageshttps://api.anthropic.com/v1200K32,000
ModelConfig::openai(id, name)OpenAIOpenAiCompletionshttps://api.openai.com/v1128K4,096
ModelConfig::openai_responses(id, name)OpenAIOpenAiResponseshttps://api.openai.com/v1128K16,000
ModelConfig::gpt_5_5()OpenAIOpenAiCompletionshttps://api.openai.com/v11M64,000
ModelConfig::gpt_6_astra()OpenAIOpenAiResponseshttps://api.openai.com/v11,050,00064,000
ModelConfig::gpt_6_sol()OpenAIOpenAiResponseshttps://api.openai.com/v11,050,00064,000
ModelConfig::gpt_6_1_sol()OpenAIOpenAiResponseshttps://api.openai.com/v11,050,00064,000
ModelConfig::gpt_6_1_terra()OpenAIOpenAiResponseshttps://api.openai.com/v11,050,00064,000
ModelConfig::gpt_6_luna()OpenAIOpenAiResponseshttps://api.openai.com/v11,050,00064,000
ModelConfig::opencode_zen(model_id)OpenCode Zenby model familyhttps://opencode.ai/zen/v1128K16,000
ModelConfig::opencode_go(model_id)OpenCode Goby model familyhttps://opencode.ai/zen/go/v1128K16,000
ModelConfig::google(id, name)Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1M8,192
ModelConfig::gemini_4_carbon()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_4_neon()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_4_hydrogen()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_4_argon()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_3_8_flash()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_3_6_flash()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_3_5_flash_lite()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_3_1_flash_lite()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_3_flash_preview()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_2_5_flash_lite()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::gemini_3_1_pro_preview()Google GeminiGoogleGenerativeAihttps://generativelanguage.googleapis.com1,048,57665,536
ModelConfig::xai(id, name)xAIOpenAiCompletionshttps://api.x.ai/v1131,0724,096
ModelConfig::grok_4_7()xAIOpenAiCompletionshttps://api.x.ai/v1500,00064,000
ModelConfig::groq(id, name)GroqOpenAiCompletionshttps://api.groq.com/openai/v1128K4,096
ModelConfig::deepseek(id, name)DeepSeekOpenAiCompletionshttps://api.deepseek.com1M384K
ModelConfig::mistral(id, name)MistralOpenAiCompletionshttps://api.mistral.ai/v1128K4,096
ModelConfig::mistral_large_4()MistralOpenAiCompletionshttps://api.mistral.ai/v11M32,768
ModelConfig::minimax(id, name)MiniMaxOpenAiCompletionshttps://api.minimax.io/v11M4,096
ModelConfig::meta(id, name)Meta (Muse Spark, Muse Wonder) — US-only preview as of 2026-07OpenAiCompletionshttps://api.meta.ai/v11M131,072
ModelConfig::zai(id, name)Z.aiOpenAiCompletionshttps://api.z.ai/api/paas/v4128K4,096
ModelConfig::glm_5_3(), glm_5_3_flash(), glm_5_3_flashx()Z.aiOpenAiCompletionshttps://api.z.ai/api/paas/v41M128,000
ModelConfig::qwen(id, name)Qwen / DashScopeOpenAiCompletionshttps://dashscope-intl.aliyuncs.com/compatible-mode/v1128K4,096
ModelConfig::qwen_3_8_max(), qwen_3_8_flash(), qwen_3_8_omni_flash()Qwen / DashScopeOpenAiCompletionshttps://dashscope-intl.aliyuncs.com/compatible-mode/v11M131,072
ModelConfig::ollama(base_url, model_id)OllamaOpenAiCompletionscaller provided128K4,096
ModelConfig::openai_compat(base_url, model_id, provider, compat)Custom compatible serverOpenAiCompletionscaller provided128K4,096
ModelConfig::local(base_url, model_id)Local compatible serverOpenAiCompletionscaller provided128K4,096
ModelConfig::custom(api, provider, base_url, model_id, name)Any (Azure, Bedrock, Vertex, gateways)caller providedcaller provided128K16,000

The generic constructors (google(id, name), xai, mistral, …) assume conservative limits unless yoagent knows the model's (below); for a model with a named preset, use the preset — it carries the model's real context window and output limit (a generic ModelConfig::xai("grok-4.7", ..) compacts at 131K and stops replies at 4,096 tokens). The constructors do not validate model IDs. They send the id you pass through to the provider, which lets you use newly released model IDs before yoagent updates its examples.

Limits as data. A model with no named preset can still have its real limits: when yoagent's bundled limits (src/provider/limits.json), or a user or fetched price table — see Model Pricing — state context_window and max_output, the generic constructor uses them — the context window, and max_tokens as half of max_output, at most 64,000 (the presets' rule), but never below the provider's own default unless that exceeds max_output. The bundled limits apply whether or not any price is installed, and ModelLimits::of(provider, id) reads them. ModelConfig::anthropic("claude-opus-4-6", ..) gets 1M / 64K this way; so does ModelConfig::preset("openrouter", "anthropic/claude-opus-4.6"). A preset's own limits win.

When such a config becomes an agent's (Agent::from_config / from_provider / set_model, SubAgentTool's constructors) with both limits still at the generic constructor's defaults and no preset of those limits for that provider and id, yoagent logs one warn! per model per process saying the limits are guesses, and pointing at ModelConfig::preset(..) when one exists. A config built before a table listed its model's limits (say, before enable_live) still warns, hinting to build it again — or to ignore it if the limits were set on purpose. Setting context_window or max_tokens (or using the preset) silences it. Only configs a first-party generic constructor built, still at its base URL, are checked: gateways and custom endpoints (openai_compat, custom, a changed base_url, anthropic with an id not starting claude-) and local servers are not, whatever their provider string. The deprecated Agent::new + with_model_config path does not check.

yoagent bundles no prices. Nothing is priced until the process installs a price table — prices::enable_live(..) (native, fetches models.dev) or its own with prices::global::install_override(..) / YOAGENT_PRICES — see Model Pricing. After that, prices are looked up by (provider, id) when the config is built. The named presets and the generic first-party constructors (anthropic, openai, openai_responses, google, xai, groq, deepseek, mistral, zai, minimax, qwen, meta) are priced when the table lists the id — ModelConfig::anthropic("claude-sonnet-5", ..) gets the same rates as claude_sonnet_5() — and carry cost: None otherwise. A preset sets the model's limits and behaviour; it carries no rate. What a table should state per model is in the vendor's pricing page: context tiers (a higher rate above a prompt size, as OpenAI, xAI and some Claude and Gemini models have), separate audio input rates (a flat CostConfig cannot express them, so audio input is under-counted at the text rate) and promotions (a table shows whichever rate it lists). The models.dev mapping skips DeepSeek (see DeepSeek Models). Gateways and custom endpoints (custom, openai_compat, local, ollama, opencode_zen, opencode_go) are always cost: None, since what they bill is not the vendor's list price. None means pricing unknown, not free; set config.cost = Some(CostConfig::new(input, output)) yourself if you want cost reporting. The OpenCode presets select the API protocol from the model id — see OpenCode Zen & Go.

The claude_* presets also set AnthropicCompat::native_structured_output, so Agent::prompt_structured uses the API's native JSON outputs instead of a forced tool call. claude_fable_5_1, claude_fable_5_2 and claude_opus_5_5 depend on it, because those models reject forced tool_choice. ModelConfig::anthropic(id, name) infers it (and the thinking mode) from a Claude id, and leaves it off for any other id. See Structured Outputs.

Looking Up a Preset by Name

For a host that takes the model as text (openai/gpt-6-sol, a config file, a flag):

  • ModelConfig::presets() — every named preset, as built configs.
  • ModelConfig::preset(provider, id) — the named preset for exactly that provider and id (as the preset's provider and id spell them), else None. Case-sensitive, no aliases: ("openai", "gpt-6-sol") finds gpt_6_sol(); ("openai_responses", "gpt-6-sol") and ("opencode-zen", "gpt-6-sol") find nothing.
  • ModelConfig::preset("bedrock", id) — a Claude preset on Amazon Bedrock, by Bedrock model id (anthropic.claude-sonnet-4-6) or cross-Region inference profile id (us.anthropic.claude-sonnet-4-6, global.…, and the us-gov, eu, apac, jp, au, ca, in geographies). The config is BedrockConverseStream on https://bedrock-runtime.us-east-1.amazonaws.com — set base_url to a Region the profile serves — with the Anthropic preset's limits and cost: None: Bedrock bills its own rates (regional and geographic profiles 10% above global ones, per AWS), which yoagent does not carry. Bedrock spells Haiku 4.5 anthropic.claude-haiku-4-5-20251001-v1:0; the other Claude presets are the Anthropic id after anthropic.. ARNs, unknown prefixes and other vendors' models find nothing. See Amazon Bedrock for thinking on Bedrock.
  • ModelConfig::preset("openrouter", "vendor/model") — a vendor preset behind OpenRouter (https://openrouter.ai/api/v1, Chat Completions, OpenAiCompat::openrouter(), key from OPENROUTER_API_KEY), for the vendors anthropic, openai, google, x-ai, z-ai and qwen, with the vendor preset's limits and cost: None (a gateway). The model is the vendor's id as OpenRouter lists it, which for Claude writes the version with a dot: anthropic/claude-sonnet-4.6, anthropic/claude-opus-5, openai/gpt-6-sol, x-ai/grok-4.7. A vendor model with no preset whose limits yoagent knows (ModelLimits::of) is found too (anthropic/claude-opus-4.6). The dashed Anthropic spelling and variants such as :batch find nothing.
  • ModelConfig::generic(provider, id) — the provider's generic constructor (anthropic, openai, google, xai, groq, deepseek, mistral, zai, minimax, qwen, meta), never a preset: the context window and output limit are the provider's defaults from the table above, not the model's, unless yoagent knows the model's limits (above). For openai, a reasoning id (anything but gpt-3*, gpt-4*, chatgpt-*, *-chat*) gets openai_responses. None for any other provider (gateways and local servers need a base URL).
#![allow(unused)]
fn main() {
// Split at the first `/` (Groq's and OpenRouter's ids contain one).
let (provider, id) = "groq/openai/gpt-oss-120b".split_once('/').unwrap();
let config = ModelConfig::preset(provider, id).or_else(|| {
    // No preset: the limits are guesses. Say so to the user.
    ModelConfig::generic(provider, id)
});
}

OpenAI-Compatible Presets

These constructors all use OpenAiCompatProvider:

#![allow(unused)]
fn main() {
use yoagent::provider::ModelConfig;

let agent = Agent::from_config(ModelConfig::deepseek(
    "deepseek-flash",
    "DeepSeek Flash",
));
}

OpenAI-compatible presets also set OpenAiCompat flags for provider-specific API differences, such as max_tokens vs. max_completion_tokens, reasoning fields, tool result formatting, and streaming usage support. See OpenAI Compatible for the full quirk-flag list.

OpenAI Presets

The OpenAI presets also declare each model's reasoning-effort ceiling (OpenAiCompat::max_reasoning_effort), so ThinkingLevel::XHigh/Max reach the model's real top rung instead of being clamped to high:

PresetProtocolEffort ceilingXHigh →Max →
gpt_5_5()Chat Completionsxhighxhighxhigh
gpt_6_astra(), gpt_6_sol(), gpt_6_1_sol(), gpt_6_1_terra(), gpt_6_luna()Responsesmaxxhighmax

ThinkingLevel::Off omits the effort on every preset, so the model runs at its own default (medium on GPT-5.5, Sol, Terra and Luna) — it does not turn reasoning off. The crate never sends OpenAI's none rung (GPT-6 Astra, among others, rejects it with a 400).

The GPT-6 presets use the Responses API because Chat Completions does not support function calling with GPT-6 Astra, and allows it on Sol/Luna only at effort none. GPT-6 rejects temperature while the effort is not none, and this crate never sends none, so the presets turn accepts_sampling_params off and the agent loop sends no temperature. The Responses provider does not enforce prompt_structured schemas (it warns and ignores the schema), so structured outputs on the GPT-6 presets are not guaranteed to match. There is no bare gpt-6 model id.

Ollama Models

Use ModelConfig::ollama for Ollama's OpenAI-compatible endpoint:

#![allow(unused)]
fn main() {
let llama = ModelConfig::ollama("http://localhost:11434/v1", "llama3.1:8b");
}

Ollama remains separate from ModelConfig::local(...) because some Ollama-served models need an assistant message after tool results, while other local OpenAI-compatible servers may not. The Ollama preset enables that transcript workaround; the generic local preset stays neutral.

Qwen Models

Use ModelConfig::qwen for hosted Qwen / DashScope:

#![allow(unused)]
fn main() {
let qwen = ModelConfig::qwen("qwen3.6-plus", "Qwen 3.6 Plus");
}

The default base URL is the international DashScope endpoint. For other regions, override base_url after construction:

#![allow(unused)]
fn main() {
let mut qwen = ModelConfig::qwen("qwen3.6-plus", "Qwen 3.6 Plus");
qwen.base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1".into();
}

Region endpoints:

  • International/Singapore: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
  • China/Beijing: https://dashscope.aliyuncs.com/compatible-mode/v1
  • US/Virginia: https://dashscope-us.aliyuncs.com/compatible-mode/v1

qwen_3_8_omni_flash() (an omni model: this crate sends it text and images; text out; JSON mode but no JSON Schema, so not Agent::prompt_structured) keeps the international base URL, but Alibaba's examples for it use the workspace endpoint ({WorkspaceId}.ap-southeast-1.maas.aliyuncs.com) and nothing confirms it is served on dashscope-intl; set base_url if requests fail.

For locally deployed Qwen, keep the local endpoint and opt into Qwen's model-family compat flags:

#![allow(unused)]
fn main() {
let qwen_local = ModelConfig::openai_compat(
    "http://localhost:1234/v1",
    "qwen3-local",
    "qwen",
    OpenAiCompat::qwen(),
);
}

If a local serving layer also has its own quirks, combine the compat flags explicitly. For example, Qwen served by Ollama may need both Qwen reasoning parsing and Ollama's tool-result transcript workaround:

#![allow(unused)]
fn main() {
let mut compat = OpenAiCompat::qwen();
compat.requires_assistant_after_tool_result = true;

let qwen_ollama = ModelConfig::openai_compat(
    "http://localhost:11434/v1",
    "qwen2.5-coder:7b",
    "ollama",
    compat,
);
}

DeepSeek Models

Use the current DeepSeek API model IDs:

#![allow(unused)]
fn main() {
let flash = ModelConfig::deepseek("deepseek-flash", "DeepSeek Flash"); // V4.1 Flash (1017), takes images
let pro = ModelConfig::deepseek("deepseek-v4-pro", "DeepSeek V4 Pro");
}

Pricing: DeepSeek bills half its peak rate off-peak (every hour but 01:00–04:00 and 06:00–10:00 UTC on weekdays). A CostConfig has no time of day, and models.dev lists only one of the two rates, so prices::enable_live leaves DeepSeek's models unpriced. State the rate to bill at in your own table, or on config.cost: with the peak rate, reported costs are an upper bound and a Budget stops early rather than late (Model Pricing).

The legacy names deepseek-chat and deepseek-reasoner were discontinued on 2026-07-24; requests using them fail. deepseek-v4-flash (and deepseek-v4-flash-vision-exp) are still accepted, but the V4 Flash model behind them is retired — DeepSeek serves those requests with V4.1 Flash. Prefer deepseek-flash. Since the V4.1-Flash-1017 snapshot, deepseek-flash accepts images (deepseek-v4-pro does not); yoagent sends them as OpenAI-style image_url parts, as for every OpenAI-compatible provider.

yoagent also sends DeepSeek's current request shape:

  • max_tokens, not max_completion_tokens
  • thinking: { "type": "enabled" | "disabled" }
  • reasoning_effort when ThinkingLevel is not Off
  • DeepSeek cache hit/miss usage fields when present

Both models default to thinking mode. What used to be deepseek-chat is the same model with thinking off:

#![allow(unused)]
fn main() {
let non_thinking = Agent::from_config(ModelConfig::deepseek("deepseek-flash", "DeepSeek Flash"))
    .with_thinking(ThinkingLevel::Off);
}

Compat Flags Without Constructors

OpenAiCompat also has quirk presets such as OpenAiCompat::cerebras() and OpenAiCompat::openrouter(). Those are compatibility profiles, not full ModelConfig constructors (for an OpenRouter model with a vendor preset, ModelConfig::preset("openrouter", "vendor/model") builds the whole config; see Looking Up a Preset by Name). To use them, call ModelConfig::openai_compat(...) with the provider name, base URL, and compat value you need. The API key is resolved from the provider string, so pass "cerebras" / "openrouter" as provider to pick up CEREBRAS_API_KEY / OPENROUTER_API_KEY; any other name falls back to YOAGENT_API_KEY / API_KEY (see API keys).