From 92532a1860f1e9180daea1dc53990f0d29f7618a Mon Sep 17 00:00:00 2001 From: AIGNLAI Date: Sun, 20 Sep 2026 16:07:49 +0800 Subject: [PATCH] feat: expand OpenRouter model priors --- CHANGELOG.md | 14 + CONTRIBUTING.md | 5 + README.md | 57 +- docs/MODEL_PROFILES.md | 99 + examples/basic.py | 6 +- examples/history.jsonl | 12 +- reflexroute/profiles.py | 2 + reflexroute/profiles/models.yaml | 3393 +++++++++++++++++++++++++++++- reflexroute/router.py | 8 +- reflexroute/schemas.py | 1 + scripts/build_model_profiles.py | 410 ++++ tests/test_context.py | 5 +- tests/test_profiles.py | 41 + tests/test_router.py | 18 +- 14 files changed, 4009 insertions(+), 62 deletions(-) create mode 100644 docs/MODEL_PROFILES.md create mode 100644 scripts/build_model_profiles.py create mode 100644 tests/test_profiles.py diff --git a/CHANGELOG.md b/CHANGELOG.md index cc6bbaa..34f758d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- Expanded built-in priors to 130 current OpenRouter models across 23 providers. +- Added reproducible profile generation from an official Models API snapshot. +- Added profile provenance, modalities, context length, feature support, and + token-price metadata. + +### Changed + +- Default routing now uses a bounded 14-model cross-provider shortlist instead + of every bundled profile. +- Hard-budget estimates now use a documented 2,000-input/1,000-output token + reference request. + ## [0.1.0] - 2026-09-20 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0b0f83..dc54deb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,11 @@ pytest Do not commit API keys, routing histories containing private prompts, generated build artifacts, or model-profile claims without a traceable source. +For catalog changes, follow +[`docs/MODEL_PROFILES.md`](docs/MODEL_PROFILES.md). Profile updates must include +the snapshot provenance, a deterministic regeneration check, and tests for the +new catalog invariants. + ## Design principles - Keep routing training-free and simple to adopt. diff --git a/README.md b/README.md index 6a1ae69..5d3cba2 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ from reflexroute import Router router = Router( models=[ - "openai/gpt-5.6", - "google/gemini-flash", - "anthropic/claude-sonnet", + "openai/gpt-5.6-sol", + "google/gemini-3.8-flash", + "anthropic/claude-sonnet-5", ] ) @@ -91,7 +91,7 @@ result = router.route("Implement a distributed rate limiter.") History can be JSONL or CSV. Its canonical shape is: ```json -{"query":"Solve this math problem...","model":"openai/gpt-5.6","performance":1.0,"cost":0.018,"latency":1.42} +{"query":"Solve this math problem...","model":"openai/gpt-5.6-sol","performance":1.0,"cost":0.014,"latency":1.42} ``` `query`, `model`, and numeric `performance` are required. `cost` and `latency` @@ -125,8 +125,10 @@ is never asked to perform budget arithmetic. - If nothing remains, ReflexRoute raises `BudgetError`. - If one candidate remains, ReflexRoute returns it locally without an API call. -Bundled costs are illustrative. Production deployments should maintain a -profile file with estimates appropriate to their workloads. +`estimated_cost` is reproducibly calculated from the catalog's token prices +using a reference request of 2,000 input and 1,000 output tokens. It excludes +cache, images, audio, web search, and provider-specific fees. Production +deployments should maintain estimates appropriate to their real workloads. ## CLI @@ -134,7 +136,7 @@ profile file with estimates appropriate to their workloads. reflexroute route "Write a CUDA kernel" reflexroute route \ - --models openai/gpt-5.6 google/gemini-flash \ + --models openai/gpt-5.6-sol google/gemini-3.8-flash \ "Write a CUDA kernel" reflexroute route \ @@ -149,11 +151,11 @@ limit. Quote multi-word queries. Typical output: ```text -Selected: openai/gpt-5.6 +Selected: openai/gpt-5.6-sol -openai/gpt-5.6 0.67 -google/gemini-flash 0.21 -model-c 0.12 +openai/gpt-5.6-sol 0.67 +google/gemini-3.8-flash 0.21 +model-c 0.12 Confidence: 0.74 ``` @@ -174,7 +176,7 @@ Jev receives structured state rather than a chat prompt: "target_query": "...", "candidate_models": { "model-a": { - "prior": {"description": "...", "profile_version": "0.1.0"}, + "prior": {"description": "...", "profile_version": "2026-09-20.1"}, "historical_evidence": [] } } @@ -188,9 +190,34 @@ rather than invented strengths. ## Model profiles +ReflexRoute includes **130 model profiles across 23 OpenRouter providers** as +of 2026-09-20. The catalog includes OpenAI, Anthropic, Google, Qwen, DeepSeek, +Mistral, Z.ai, Meta, xAI, Moonshot, MiniMax, Amazon, NVIDIA, Perplexity, +Cohere, ByteDance, and selected specialists. + Bundled profiles live in -[`reflexroute/profiles/models.yaml`](reflexroute/profiles/models.yaml). Supply a -deployment-specific file with `Router(profile_path="my-models.yaml")`: +[`reflexroute/profiles/models.yaml`](reflexroute/profiles/models.yaml). Each one +records: + +- A concise routing description and conservative strength tags. +- Context length and input/output modalities. +- Tool use, structured output, and reasoning support. +- Prompt and completion price per million tokens at snapshot time. +- Reproducible reference-request cost plus heuristic cost/latency tiers. +- Snapshot version and official source provenance. + +`Router()` uses a bounded 14-model cross-provider default shortlist so that a +cold-start request does not become a 130-way Jev decision. Every bundled model +remains available when explicitly named: + +```python +router = Router(models=["openai/gpt-6-astra", "deepseek/deepseek-v4.1-flash"]) +``` + +See [Model profile methodology](docs/MODEL_PROFILES.md) for provider coverage, +field provenance, heuristics, and update instructions. + +Supply a deployment-specific file with `Router(profile_path="my-models.yaml")`: ```yaml profile_version: "2026-09-20" @@ -214,7 +241,7 @@ context, making profiles traceable and extensible. | API | Purpose | | --- | --- | -| `Router(models, history_top_k=4)` | Create a router; omit `models` to use every bundled profile. | +| `Router(models, history_top_k=4)` | Create a router; omit `models` to use the bounded default shortlist. | | `router.load_history(path)` | Replace history from a JSONL or CSV file. | | `router.set_history(records)` | Replace history from Python objects. | | `router.eligible_models(budget)` | Inspect the result of hard budget filtering. | diff --git a/docs/MODEL_PROFILES.md b/docs/MODEL_PROFILES.md new file mode 100644 index 0000000..6f1695f --- /dev/null +++ b/docs/MODEL_PROFILES.md @@ -0,0 +1,99 @@ +# Model profile methodology + +ReflexRoute ships a broad but bounded snapshot of the models available through +OpenRouter. Profiles are routing priors—not benchmark verdicts, guarantees, or +live service telemetry. + +## Current coverage + +The `2026-09-20.1` snapshot contains 130 non-batch, non-free model IDs across +23 providers: + +| Provider | Profiles | +| --- | ---: | +| `openai` | 18 | +| `qwen` | 16 | +| `google` | 12 | +| `anthropic` | 10 | +| `deepseek` | 8 | +| `mistralai` | 8 | +| `z-ai` | 8 | +| `meta-llama` | 5 | +| `moonshotai` | 5 | +| `perplexity` | 5 | +| `x-ai` | 5 | +| `amazon` | 4 | +| `bytedance-seed` | 4 | +| `cohere` | 4 | +| `minimax` | 4 | +| `nvidia` | 4 | +| `inclusionai` | 2 | +| `inference-net` | 2 | +| `sakana` | 2 | +| `inception` | 1 | +| `microsoft` | 1 | +| `prism-ml` | 1 | +| `unbiased` | 1 | + +Batch variants and `:free` duplicates are omitted to keep model choices +distinct. Dynamic OpenRouter meta-routers are also omitted because their costs +cannot be represented as one hard-budget estimate. + +## Field provenance + +Directly sourced from the official OpenRouter Models API snapshot: + +- Model ID and display name. +- Context length. +- Input and output modalities. +- Supported request parameters. +- Prompt and completion token prices. +- Official description, used only as input to conservative tag inference. + +Derived by ReflexRoute: + +- `description`: a compact summary of structured metadata and inferred focus. +- `strengths`: keyword- and capability-based routing tags. +- `latency_level`: a family-name heuristic, not measured latency. +- `cost_level`: a tier derived from the reference-request estimate. +- `estimated_cost`: token-price estimate for 2,000 input plus 1,000 output + tokens. +- `default_candidate`: membership in the bounded cold-start shortlist. + +Cost tiers use that reference-request estimate: `low` is at most $0.001, +`medium` at most $0.01, `high` at most $0.05, and `premium` above $0.05. +Zero-priced models would use `free`, although free duplicates are not part of +this snapshot. + +The estimate excludes prompt caching, images, audio, web search, and +provider-specific fees. Users with different traffic shapes should maintain a +deployment-specific profile file. + +## Updating the snapshot + +Profile updates are explicit and reviewable. The generator never fetches the +network itself: + +```bash +curl -fsSL https://openrouter.ai/api/v1/models -o /tmp/openrouter-models.json +python scripts/build_model_profiles.py \ + --catalog /tmp/openrouter-models.json +pytest +``` + +To verify deterministic regeneration against the same snapshot: + +```bash +python scripts/build_model_profiles.py \ + --catalog /tmp/openrouter-models.json \ + --check +``` + +When updating, review `SELECTED_MODELS`, `DEFAULT_MODELS`, all inferred tags, +the snapshot date/version, and the generated diff before committing. + +## Precedence + +Profiles intentionally remain weak priors. When relevant user history conflicts +with a bundled profile, the Jev instruction tells the model to prefer the user +evidence. diff --git a/examples/basic.py b/examples/basic.py index ed8d11d..55222f6 100644 --- a/examples/basic.py +++ b/examples/basic.py @@ -6,9 +6,9 @@ models = [ - "openai/gpt-5.6", - "google/gemini-flash", - "anthropic/claude-sonnet", + "openai/gpt-5.6-sol", + "google/gemini-3.8-flash", + "anthropic/claude-sonnet-5", ] # Zero-shot: built-in, explicitly versioned priors only. diff --git a/examples/history.jsonl b/examples/history.jsonl index dd9fcbb..a8c75b4 100644 --- a/examples/history.jsonl +++ b/examples/history.jsonl @@ -1,6 +1,6 @@ -{"query":"Implement a distributed rate limiter with Redis and discuss failure modes.","model":"openai/gpt-5.6","performance":0.97,"cost":0.028,"latency":2.31} -{"query":"Debug a concurrent Python worker pool with intermittent deadlocks.","model":"openai/gpt-5.6","performance":0.95,"cost":0.027,"latency":2.08} -{"query":"Summarize this customer support email in three bullets.","model":"google/gemini-flash","performance":0.94,"cost":0.002,"latency":0.42} -{"query":"Classify a short product review by sentiment.","model":"google/gemini-flash","performance":0.92,"cost":0.001,"latency":0.31} -{"query":"Rewrite a sensitive policy memo with a clear and diplomatic tone.","model":"anthropic/claude-sonnet","performance":0.96,"cost":0.014,"latency":1.67} -{"query":"Review this TypeScript API design and suggest maintainable abstractions.","model":"anthropic/claude-sonnet","performance":0.93,"cost":0.015,"latency":1.75} +{"query":"Implement a distributed rate limiter with Redis and discuss failure modes.","model":"openai/gpt-5.6-sol","performance":0.97,"cost":0.014,"latency":2.31} +{"query":"Debug a concurrent Python worker pool with intermittent deadlocks.","model":"openai/gpt-5.6-sol","performance":0.95,"cost":0.013,"latency":2.08} +{"query":"Summarize this customer support email in three bullets.","model":"google/gemini-3.8-flash","performance":0.94,"cost":0.005,"latency":0.42} +{"query":"Classify a short product review by sentiment.","model":"google/gemini-3.8-flash","performance":0.92,"cost":0.004,"latency":0.31} +{"query":"Rewrite a sensitive policy memo with a clear and diplomatic tone.","model":"anthropic/claude-sonnet-5","performance":0.96,"cost":0.014,"latency":1.67} +{"query":"Review this TypeScript API design and suggest maintainable abstractions.","model":"anthropic/claude-sonnet-5","performance":0.93,"cost":0.015,"latency":1.75} diff --git a/reflexroute/profiles.py b/reflexroute/profiles.py index 16f6ac2..b8dc742 100644 --- a/reflexroute/profiles.py +++ b/reflexroute/profiles.py @@ -52,6 +52,7 @@ def load_profiles(path: str | Path | None = None) -> dict[str, ModelProfile]: "estimated_cost_per_request", "profile_version", "source", + "default_candidate", } result[name] = ModelProfile( model=name, @@ -62,6 +63,7 @@ def load_profiles(path: str | Path | None = None) -> dict[str, ModelProfile]: estimated_cost=estimated_cost, profile_version=_optional_string(raw_profile.get("profile_version", version)), source=raw_profile.get("source", source), + default_candidate=raw_profile.get("default_candidate") is True, extra={key: value for key, value in raw_profile.items() if key not in known}, ) return result diff --git a/reflexroute/profiles/models.yaml b/reflexroute/profiles/models.yaml index 86a1490..aa2ef8b 100644 --- a/reflexroute/profiles/models.yaml +++ b/reflexroute/profiles/models.yaml @@ -1,45 +1,3386 @@ -# These profiles are deliberately compact, fallible priors. Replace or extend -# them for your deployment; user history takes precedence in the Jev prompt. -profile_version: "0.1.0" -source: "ReflexRoute maintainers; illustrative priors, not benchmark guarantees" +# Generated by scripts/build_model_profiles.py; edit the generator, not this file. +profile_version: "2026-09-20.1" +source: + type: "OpenRouter Models API snapshot plus ReflexRoute heuristic annotations" + url: "https://openrouter.ai/api/v1/models" + retrieved_at: "2026-09-20" + catalog_models: 446 + selected_models: 130 + selected_providers: 23 +cost_estimate: + currency: "USD" + assumed_input_tokens: 2000 + assumed_output_tokens: 1000 + excludes: "cache, images, audio, web search, and provider-specific fees" +inference_notes: + strengths: "Conservative tags inferred from official descriptions, modalities, and supported parameters." + latency_level: "Heuristic tier inferred from model family naming; not measured latency." models: - openai/gpt-5.6: - description: "Strong general reasoning, coding, and complex instruction-following model." + openai/gpt-6-astra: + display_name: "OpenAI: GPT-6 Astra" + description: "OpenAI: GPT-6 Astra is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes coding, reasoning, vision, web research." strengths: - - reasoning - - coding - - complex instruction following + - "coding" + - "reasoning" + - "vision" + - "web research" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: premium + latency_level: high + estimated_cost: 0.07 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 10 + completion_cost_per_million: 50 + default_candidate: false + + openai/gpt-6-astra-pro: + display_name: "OpenAI: GPT-6 Astra Pro" + description: "OpenAI: GPT-6 Astra Pro is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: premium + latency_level: high + estimated_cost: 0.07 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 10 + completion_cost_per_million: 50 + default_candidate: false + + openai/gpt-5.6-luna-pro: + display_name: "OpenAI: GPT-5.6 Luna Pro" + description: "OpenAI: GPT-5.6 Luna Pro is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.0016 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.2 + completion_cost_per_million: 1.2 + default_candidate: false + + openai/gpt-5.6-luna: + display_name: "OpenAI: GPT-5.6 Luna" + description: "OpenAI: GPT-5.6 Luna is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0016 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.2 + completion_cost_per_million: 1.2 + default_candidate: true + + openai/gpt-5.6-terra-pro: + display_name: "OpenAI: GPT-5.6 Terra Pro" + description: "OpenAI: GPT-5.6 Terra Pro is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: high + latency_level: high + estimated_cost: 0.016 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 12 + default_candidate: false + + openai/gpt-5.6-terra: + display_name: "OpenAI: GPT-5.6 Terra" + description: "OpenAI: GPT-5.6 Terra is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.016 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 12 + default_candidate: false + + openai/gpt-5.6-sol-pro: + display_name: "OpenAI: GPT-5.6 Sol Pro" + description: "OpenAI: GPT-5.6 Sol Pro is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: high + latency_level: high + estimated_cost: 0.014 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 10 + default_candidate: false + + openai/gpt-5.6-sol: + display_name: "OpenAI: GPT-5.6 Sol" + description: "OpenAI: GPT-5.6 Sol is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.014 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 10 + default_candidate: true + + openai/gpt-5.5-pro: + display_name: "OpenAI: GPT-5.5 Pro" + description: "OpenAI: GPT-5.5 Pro is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: premium + latency_level: high + estimated_cost: 0.24 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 30 + completion_cost_per_million: 180 + default_candidate: false + + openai/gpt-5.5: + display_name: "OpenAI: GPT-5.5" + description: "OpenAI: GPT-5.5 is an OpenRouter model accepting file, image, text input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.04 + context_length: 1050000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 5 + completion_cost_per_million: 30 + default_candidate: false + + openai/gpt-5.4-nano: + display_name: "OpenAI: GPT-5.4 Nano" + description: "OpenAI: GPT-5.4 Nano is an OpenRouter model accepting file, image, text input with a 400,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.00165 + context_length: 400000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.2 + completion_cost_per_million: 1.25 + default_candidate: false + + openai/gpt-5.4-mini: + display_name: "OpenAI: GPT-5.4 Mini" + description: "OpenAI: GPT-5.4 Mini is an OpenRouter model accepting file, image, text input with a 400,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.006 + context_length: 400000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.75 + completion_cost_per_million: 4.5 + default_candidate: false + + openai/gpt-5.4-pro: + display_name: "OpenAI: GPT-5.4 Pro" + description: "OpenAI: GPT-5.4 Pro is an OpenRouter model accepting text, image, file input with a 1,050,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: premium + latency_level: high + estimated_cost: 0.24 + context_length: 1050000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 30 + completion_cost_per_million: 180 + default_candidate: false + + openai/gpt-5.4: + display_name: "OpenAI: GPT-5.4" + description: "OpenAI: GPT-5.4 is an OpenRouter model accepting text, image, file input with a 1,050,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.02 + context_length: 1050000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2.5 + completion_cost_per_million: 15 + default_candidate: false + + openai/gpt-5.3-codex: + display_name: "OpenAI: GPT-5.3-Codex" + description: "OpenAI: GPT-5.3-Codex is an OpenRouter model accepting text, image, file input with a 400,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.0175 + context_length: 400000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.75 + completion_cost_per_million: 14 + default_candidate: false + + openai/gpt-5.2-codex: + display_name: "OpenAI: GPT-5.2-Codex" + description: "OpenAI: GPT-5.2-Codex is an OpenRouter model accepting text, image input with a 400,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.0175 + context_length: 400000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.75 + completion_cost_per_million: 14 + default_candidate: false + + openai/gpt-5.1-codex-mini: + display_name: "OpenAI: GPT-5.1-Codex-Mini" + description: "OpenAI: GPT-5.1-Codex-Mini is an OpenRouter model accepting image, text input with a 400,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.0025 + context_length: 400000 + input_modalities: + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.25 + completion_cost_per_million: 2 + default_candidate: false + + openai/gpt-oss-120b: + display_name: "OpenAI: gpt-oss-120b" + description: "OpenAI: gpt-oss-120b is an OpenRouter model accepting text input with a 131,072-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.0009 + context_length: 131072 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.15 + completion_cost_per_million: 0.6 + default_candidate: false + + anthropic/claude-fable-5.1: + display_name: "Anthropic: Claude Fable 5.1" + description: "Anthropic: Claude Fable 5.1 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: premium + latency_level: medium + estimated_cost: 0.07 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 10 + completion_cost_per_million: 50 + default_candidate: false + + anthropic/claude-opus-5: + display_name: "Anthropic: Claude Opus 5" + description: "Anthropic: Claude Opus 5 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: high + estimated_cost: 0.035 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 5 + completion_cost_per_million: 25 + default_candidate: false + + anthropic/claude-sonnet-5: + display_name: "Anthropic: Claude Sonnet 5" + description: "Anthropic: Claude Sonnet 5 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.014 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 10 + default_candidate: true + + anthropic/claude-fable-5: + display_name: "Anthropic: Claude Fable 5" + description: "Anthropic: Claude Fable 5 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: premium + latency_level: medium + estimated_cost: 0.07 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 10 + completion_cost_per_million: 50 + default_candidate: false + + anthropic/claude-opus-4.8: + display_name: "Anthropic: Claude Opus 4.8" + description: "Anthropic: Claude Opus 4.8 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: high + latency_level: high + estimated_cost: 0.035 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 5 + completion_cost_per_million: 25 + default_candidate: false + + anthropic/claude-sonnet-4.6: + display_name: "Anthropic: Claude Sonnet 4.6" + description: "Anthropic: Claude Sonnet 4.6 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.021 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 3 + completion_cost_per_million: 15 + default_candidate: false + + anthropic/claude-opus-4.6: + display_name: "Anthropic: Claude Opus 4.6" + description: "Anthropic: Claude Opus 4.6 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: high + estimated_cost: 0.035 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 5 + completion_cost_per_million: 25 + default_candidate: false + + anthropic/claude-haiku-4.5: + display_name: "Anthropic: Claude Haiku 4.5" + description: "Anthropic: Claude Haiku 4.5 is an OpenRouter model accepting text, image, file input with a 200,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.007 + context_length: 200000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1 + completion_cost_per_million: 5 + default_candidate: true + + anthropic/claude-sonnet-4.5: + display_name: "Anthropic: Claude Sonnet 4.5" + description: "Anthropic: Claude Sonnet 4.5 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.021 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 3 + completion_cost_per_million: 15 + default_candidate: false + + anthropic/claude-opus-4.5: + display_name: "Anthropic: Claude Opus 4.5" + description: "Anthropic: Claude Opus 4.5 is an OpenRouter model accepting file, image, text input with a 200,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: high + latency_level: high + estimated_cost: 0.035 + context_length: 200000 + input_modalities: + - "file" + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 5 + completion_cost_per_million: 25 + default_candidate: false + + google/gemini-3.8-flash: + display_name: "Google: Gemini 3.8 Flash" + description: "Google: Gemini 3.8 Flash is an OpenRouter model accepting text, image, video, file, audio input with a 1,048,576-token context window. This routing prior emphasizes coding, reasoning, vision, video understanding." + strengths: + - "coding" + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + cost_level: medium + latency_level: low + estimated_cost: 0.00525 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + - "file" + - "audio" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.75 + completion_cost_per_million: 3.75 + default_candidate: true + + google/gemini-3.7-flash: + display_name: "Google: Gemini 3.7 Flash" + description: "Google: Gemini 3.7 Flash is an OpenRouter model accepting text, image, video, file, audio input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.00525 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + - "file" + - "audio" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.75 + completion_cost_per_million: 3.75 + default_candidate: false + + google/gemini-3.6-flash: + display_name: "Google: Gemini 3.6 Flash" + description: "Google: Gemini 3.6 Flash is an OpenRouter model accepting text, image, video, file, audio input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.00525 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + - "file" + - "audio" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.75 + completion_cost_per_million: 3.75 + default_candidate: false + + google/gemini-3.5-flash-lite: + display_name: "Google: Gemini 3.5 Flash Lite" + description: "Google: Gemini 3.5 Flash Lite is an OpenRouter model accepting text, image, video, file, audio input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.0031 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + - "file" + - "audio" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.3 + completion_cost_per_million: 2.5 + default_candidate: false + + google/gemini-3.5-flash: + display_name: "Google: Gemini 3.5 Flash" + description: "Google: Gemini 3.5 Flash is an OpenRouter model accepting text, image, video, file, audio input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: high + latency_level: low + estimated_cost: 0.012 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + - "file" + - "audio" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.5 + completion_cost_per_million: 9 + default_candidate: false + + google/gemini-3.1-flash-lite: + display_name: "Google: Gemini 3.1 Flash Lite" + description: "Google: Gemini 3.1 Flash Lite is an OpenRouter model accepting text, image, video, file, audio input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.002 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + - "file" + - "audio" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.25 + completion_cost_per_million: 1.5 + default_candidate: false + + google/gemini-3.1-pro-preview: + display_name: "Google: Gemini 3.1 Pro Preview" + description: "Google: Gemini 3.1 Pro Preview is an OpenRouter model accepting audio, file, image, text, video input with a 1,048,576-token context window. This routing prior emphasizes coding, reasoning, vision, video understanding." + strengths: + - "coding" + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + cost_level: high + latency_level: high + estimated_cost: 0.016 + context_length: 1048576 + input_modalities: + - "audio" + - "file" + - "image" + - "text" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 12 + default_candidate: false + + google/gemini-3-flash-preview: + display_name: "Google: Gemini 3 Flash Preview" + description: "Google: Gemini 3 Flash Preview is an OpenRouter model accepting text, image, file, audio, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.004 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "file" + - "audio" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.5 + completion_cost_per_million: 3 + default_candidate: false + + google/gemini-2.5-flash-lite: + display_name: "Google: Gemini 2.5 Flash Lite" + description: "Google: Gemini 2.5 Flash Lite is an OpenRouter model accepting text, image, file, audio, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, audio understanding." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: low + latency_level: low + estimated_cost: 0.0006 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "file" + - "audio" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.1 + completion_cost_per_million: 0.4 + default_candidate: false + + google/gemini-2.5-flash: + display_name: "Google: Gemini 2.5 Flash" + description: "Google: Gemini 2.5 Flash is an OpenRouter model accepting file, image, text, audio, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, mathematics, vision, video understanding." + strengths: + - "reasoning" + - "mathematics" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" + cost_level: medium + latency_level: low + estimated_cost: 0.0031 + context_length: 1048576 + input_modalities: + - "file" + - "image" + - "text" + - "audio" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.3 + completion_cost_per_million: 2.5 + default_candidate: false + + google/gemini-2.5-pro: + display_name: "Google: Gemini 2.5 Pro" + description: "Google: Gemini 2.5 Pro is an OpenRouter model accepting text, image, file, audio, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, mathematics, vision, video understanding." + strengths: + - "reasoning" + - "mathematics" + - "vision" + - "video understanding" + - "audio understanding" + - "tool use" + - "structured output" cost_level: high + latency_level: high + estimated_cost: 0.0125 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "file" + - "audio" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.25 + completion_cost_per_million: 10 + default_candidate: false + + google/gemma-4-31b-it: + display_name: "Google: Gemma 4 31B" + description: "Google: Gemma 4 31B is an OpenRouter model accepting image, text, video input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.00052 + context_length: 262144 + input_modalities: + - "image" + - "text" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.09 + completion_cost_per_million: 0.34 + default_candidate: false + + qwen/qwen3.8-max-0902: + display_name: "Qwen: Qwen3.8 Max (0902)" + description: "Qwen: Qwen3.8 Max (0902) is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.01 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 6 + default_candidate: true + + qwen/qwen3.8-flash: + display_name: "Qwen: Qwen3.8 Flash" + description: "Qwen: Qwen3.8 Flash is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes coding, reasoning, vision, video understanding." + strengths: + - "coding" + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: low + latency_level: low + estimated_cost: 0.00077 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.15 + completion_cost_per_million: 0.47 + default_candidate: false + + qwen/qwen3.8-27b: + display_name: "Qwen: Qwen3.8 27B" + description: "Qwen: Qwen3.8 27B is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.00384 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.42 + completion_cost_per_million: 3 + default_candidate: false + + qwen/qwen3.8-2.4t-a95b: + display_name: "Qwen: Qwen3.8 2.4T A95B" + description: "Qwen: Qwen3.8 2.4T A95B is an OpenRouter model accepting text input with a 1,048,576-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.01 + context_length: 1048576 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 6 + default_candidate: false + + qwen/qwen3.7-flash: + display_name: "Qwen: Qwen3.7 Flash" + description: "Qwen: Qwen3.7 Flash is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "agentic tasks" + - "long-context tasks" + - "fast responses" + cost_level: low + latency_level: low + estimated_cost: 0.00019 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 0.03 + completion_cost_per_million: 0.13 + default_candidate: false + + qwen/qwen3.7-plus: + display_name: "Qwen: Qwen3.7 Plus" + description: "Qwen: Qwen3.7 Plus is an OpenRouter model accepting text, image input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.00192 + context_length: 1000000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.32 + completion_cost_per_million: 1.28 + default_candidate: false + + qwen/qwen3.7-max: + display_name: "Qwen: Qwen3.7 Max" + description: "Qwen: Qwen3.7 Max is an OpenRouter model accepting text input with a 1,000,000-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.007375 + context_length: 1000000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.475 + completion_cost_per_million: 4.425 + default_candidate: false + + qwen/qwen3.6-flash: + display_name: "Qwen: Qwen3.6 Flash" + description: "Qwen: Qwen3.6 Flash is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.0015 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.1875 + completion_cost_per_million: 1.125 + default_candidate: false + + qwen/qwen3.6-35b-a3b: + display_name: "Qwen: Qwen3.6 35B A3B" + description: "Qwen: Qwen3.6 35B A3B is an OpenRouter model accepting text, image, video input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: medium + latency_level: medium + estimated_cost: 0.0011 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.1 + completion_cost_per_million: 0.9 + default_candidate: false + + qwen/qwen3.6-plus: + display_name: "Qwen: Qwen3.6 Plus" + description: "Qwen: Qwen3.6 Plus is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0026 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.325 + completion_cost_per_million: 1.95 + default_candidate: false + + qwen/qwen3.5-122b-a10b: + display_name: "Qwen: Qwen3.5-122B-A10B" + description: "Qwen: Qwen3.5-122B-A10B is an OpenRouter model accepting text, image, video input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0026 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.26 + completion_cost_per_million: 2.08 + default_candidate: false + + qwen/qwen3.5-flash-02-23: + display_name: "Qwen: Qwen3.5-Flash" + description: "Qwen: Qwen3.5-Flash is an OpenRouter model accepting text, image, video input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: low + latency_level: low + estimated_cost: 0.00039 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.065 + completion_cost_per_million: 0.26 + default_candidate: false + + qwen/qwen3-max-thinking: + display_name: "Qwen: Qwen3 Max Thinking" + description: "Qwen: Qwen3 Max Thinking is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.00546 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.78 + completion_cost_per_million: 3.9 + default_candidate: false + + qwen/qwen3-coder-next: + display_name: "Qwen: Qwen3 Coder Next" + description: "Qwen: Qwen3 Coder Next is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes coding, tool use, structured output, agentic tasks." + strengths: + - "coding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: medium + latency_level: medium + estimated_cost: 0.00104 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.12 + completion_cost_per_million: 0.8 + default_candidate: false + + qwen/qwen3-vl-235b-a22b-thinking: + display_name: "Qwen: Qwen3 VL 235B A22B Thinking" + description: "Qwen: Qwen3 VL 235B A22B Thinking is an OpenRouter model accepting text, image input with a 131,072-token context window. This routing prior emphasizes reasoning, mathematics, vision, tool use." + strengths: + - "reasoning" + - "mathematics" + - "vision" + - "tool use" + - "structured output" + cost_level: medium + latency_level: high + estimated_cost: 0.0048 + context_length: 131072 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.4 + completion_cost_per_million: 4 + default_candidate: false + + qwen/qwen3-coder-plus: + display_name: "Qwen: Qwen3 Coder Plus" + description: "Qwen: Qwen3 Coder Plus is an OpenRouter model accepting text input with a 1,000,000-token context window. This routing prior emphasizes coding, tool use, structured output, agentic tasks." + strengths: + - "coding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.00455 + context_length: 1000000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.65 + completion_cost_per_million: 3.25 + default_candidate: false + + deepseek/deepseek-v4.1-flash: + display_name: "DeepSeek: DeepSeek V4.1 Flash" + description: "DeepSeek: DeepSeek V4.1 Flash is an OpenRouter model accepting text, image input with a 1,048,576-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: low + latency_level: low + estimated_cost: 0.0009 + context_length: 1048576 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.15 + completion_cost_per_million: 0.6 + default_candidate: true + + deepseek/deepseek-v4-pro-0813: + display_name: "DeepSeek: DeepSeek V4 Pro 0813" + description: "DeepSeek: DeepSeek V4 Pro 0813 is an OpenRouter model accepting text input with a 1,048,576-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.0033 + context_length: 1048576 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.66 + completion_cost_per_million: 1.98 + default_candidate: false + + deepseek/deepseek-v4-flash-0731: + display_name: "DeepSeek: DeepSeek V4 Flash 0731" + description: "DeepSeek: DeepSeek V4 Flash 0731 is an OpenRouter model accepting text input with a 1,310,720-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00016 + context_length: 1310720 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.04 + completion_cost_per_million: 0.08 + default_candidate: false + + deepseek/deepseek-v4-pro: + display_name: "DeepSeek: DeepSeek V4 Pro 0423" + description: "DeepSeek: DeepSeek V4 Pro 0423 is an OpenRouter model accepting text input with a 1,048,576-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.00168919 + context_length: 1048576 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.422298 + completion_cost_per_million: 0.844596 + default_candidate: false + + deepseek/deepseek-v4-flash: + display_name: "DeepSeek: DeepSeek V4 Flash 0423" + description: "DeepSeek: DeepSeek V4 Flash 0423 is an OpenRouter model accepting text input with a 1,048,576-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00014672 + context_length: 1048576 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.03668 + completion_cost_per_million: 0.07336 + default_candidate: false + + deepseek/deepseek-v3.2: + display_name: "DeepSeek: DeepSeek V3.2" + description: "DeepSeek: DeepSeek V3.2 is an OpenRouter model accepting text input with a 163,840-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: low + latency_level: medium + estimated_cost: 0.000938 + context_length: 163840 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.269 + completion_cost_per_million: 0.4 + default_candidate: false + + deepseek/deepseek-r1-0528: + display_name: "DeepSeek: R1 0528" + description: "DeepSeek: R1 0528 is an OpenRouter model accepting text input with a 163,840-token context window. This routing prior emphasizes reasoning, tool use, structured output." + strengths: + - "reasoning" + - "tool use" + - "structured output" + cost_level: medium + latency_level: medium + estimated_cost: 0.00315 + context_length: 163840 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.5 + completion_cost_per_million: 2.15 + default_candidate: false + + deepseek/deepseek-r1: + display_name: "DeepSeek: R1" + description: "DeepSeek: R1 is an OpenRouter model accepting text input with a 64,000-token context window. This routing prior emphasizes reasoning, tool use, general instruction following." + strengths: + - "reasoning" + - "tool use" + - "general instruction following" + cost_level: medium + latency_level: medium + estimated_cost: 0.0039 + context_length: 64000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 0.7 + completion_cost_per_million: 2.5 + default_candidate: false + + mistralai/mistral-medium-3-5: + display_name: "Mistral: Mistral Medium 3.5" + description: "Mistral: Mistral Medium 3.5 is an OpenRouter model accepting text, image, file input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.0105 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.5 + completion_cost_per_million: 7.5 + default_candidate: true + + mistralai/mistral-small-2603: + display_name: "Mistral: Mistral Small 4" + description: "Mistral: Mistral Small 4 is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.0009 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.15 + completion_cost_per_million: 0.6 + default_candidate: false + + mistralai/devstral-2512: + display_name: "Mistral: Devstral 2 2512" + description: "Mistral: Devstral 2 2512 is an OpenRouter model accepting text, file input with a 262,144-token context window. This routing prior emphasizes coding, tool use, structured output, agentic tasks." + strengths: + - "coding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0028 + context_length: 262144 + input_modalities: + - "text" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.4 + completion_cost_per_million: 2 + default_candidate: false + + mistralai/ministral-14b-2512: + display_name: "Mistral: Ministral 3 14B 2512" + description: "Mistral: Ministral 3 14B 2512 is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes vision, tool use, structured output, long-context tasks." + strengths: + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.0006 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.2 + completion_cost_per_million: 0.2 + default_candidate: false + + mistralai/mistral-medium-3.1: + display_name: "Mistral: Mistral Medium 3.1" + description: "Mistral: Mistral Medium 3.1 is an OpenRouter model accepting text, image, file input with a 131,072-token context window. This routing prior emphasizes vision, tool use, structured output." + strengths: + - "vision" + - "tool use" + - "structured output" + cost_level: medium + latency_level: medium + estimated_cost: 0.0028 + context_length: 131072 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.4 + completion_cost_per_million: 2 + default_candidate: false + + mistralai/codestral-2508: + display_name: "Mistral: Codestral 2508" + description: "Mistral: Codestral 2508 is an OpenRouter model accepting text, file input with a 256,000-token context window. This routing prior emphasizes coding, tool use, structured output, long-context tasks." + strengths: + - "coding" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0015 + context_length: 256000 + input_modalities: + - "text" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.3 + completion_cost_per_million: 0.9 + default_candidate: false + + mistralai/mistral-small-3.2-24b-instruct: + display_name: "Mistral: Mistral Small 3.2 24B" + description: "Mistral: Mistral Small 3.2 24B is an OpenRouter model accepting image, text input with a 256,000-token context window. This routing prior emphasizes vision, tool use, structured output, long-context tasks." + strengths: + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.0004375 + context_length: 256000 + input_modalities: + - "image" + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.09375 + completion_cost_per_million: 0.25 + default_candidate: false + + mistralai/mistral-nemo: + display_name: "Mistral: Mistral Nemo" + description: "Mistral: Mistral Nemo is an OpenRouter model accepting text input with a 131,072-token context window. This routing prior emphasizes tool use, structured output, multilingual tasks, cost-efficient workloads." + strengths: + - "tool use" + - "structured output" + - "multilingual tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.000068 + context_length: 131072 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.019 + completion_cost_per_million: 0.03 + default_candidate: false + + z-ai/glm-5.3-flashx: + display_name: "Z.ai: GLM 5.3 FlashX" + description: "Z.ai: GLM 5.3 FlashX is an OpenRouter model accepting text, image, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "long-context tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.00199 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 0.37 + completion_cost_per_million: 1.25 + default_candidate: false + + z-ai/glm-5.3-flash: + display_name: "Z.ai: GLM 5.3 Flash" + description: "Z.ai: GLM 5.3 Flash is an OpenRouter model accepting text, image, video input with a 1,310,720-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: low + latency_level: low + estimated_cost: 0.00048 + context_length: 1310720 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.09 + completion_cost_per_million: 0.3 + default_candidate: false + + z-ai/glm-5.3: + display_name: "Z.ai: GLM 5.3" + description: "Z.ai: GLM 5.3 is an OpenRouter model accepting text input with a 1,310,720-token context window. This routing prior emphasizes coding, reasoning, tool use, structured output." + strengths: + - "coding" + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.004608 + context_length: 1310720 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.896 + completion_cost_per_million: 2.816 + default_candidate: true + + z-ai/glm-5.2: + display_name: "Z.ai: GLM 5.2" + description: "Z.ai: GLM 5.2 is an OpenRouter model accepting text input with a 1,048,576-token context window. This routing prior emphasizes coding, reasoning, tool use, structured output." + strengths: + - "coding" + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0033408 + context_length: 1048576 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.6496 + completion_cost_per_million: 2.0416 + default_candidate: false + + z-ai/glm-5.1: + display_name: "Z.ai: GLM 5.1" + description: "Z.ai: GLM 5.1 is an OpenRouter model accepting text input with a 204,800-token context window. This routing prior emphasizes reasoning, tool use, structured output." + strengths: + - "reasoning" + - "tool use" + - "structured output" + cost_level: medium + latency_level: medium + estimated_cost: 0.004968 + context_length: 204800 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.966 + completion_cost_per_million: 3.036 + default_candidate: false + + z-ai/glm-5v-turbo: + display_name: "Z.ai: GLM 5V Turbo" + description: "Z.ai: GLM 5V Turbo is an OpenRouter model accepting image, text, video input with a 202,752-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "agentic tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.0064 + context_length: 202752 + input_modalities: + - "image" + - "text" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 1.2 + completion_cost_per_million: 4 + default_candidate: false + + z-ai/glm-5: + display_name: "Z.ai: GLM 5" + description: "Z.ai: GLM 5 is an OpenRouter model accepting text input with a 204,800-token context window. This routing prior emphasizes coding, reasoning, tool use, structured output." + strengths: + - "coding" + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium latency_level: medium - estimated_cost: 0.030 + estimated_cost: 0.00312 + context_length: 204800 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.6 + completion_cost_per_million: 1.92 + default_candidate: false - google/gemini-flash: - description: "Fast and inexpensive general-purpose model for straightforward tasks." + z-ai/glm-4.7: + display_name: "Z.ai: GLM 4.7" + description: "Z.ai: GLM 4.7 is an OpenRouter model accepting text input with a 204,800-token context window. This routing prior emphasizes coding, reasoning, tool use, structured output." strengths: - - simple QA - - summarization - - fast responses + - "coding" + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.00255 + context_length: 204800 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.4 + completion_cost_per_million: 1.75 + default_candidate: false + + meta-llama/llama-4-maverick: + display_name: "Meta: Llama 4 Maverick" + description: "Meta: Llama 4 Maverick is an OpenRouter model accepting text, image input with a 1,048,576-token context window. This routing prior emphasizes vision, tool use, structured output, long-context tasks." + strengths: + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: medium + latency_level: medium + estimated_cost: 0.0010275 + context_length: 1048576 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.1875 + completion_cost_per_million: 0.6525 + default_candidate: true + + meta-llama/llama-4-scout: + display_name: "Meta: Llama 4 Scout" + description: "Meta: Llama 4 Scout is an OpenRouter model accepting text, image input with a 1,310,720-token context window. This routing prior emphasizes vision, tool use, structured output, long-context tasks." + strengths: + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "cost-efficient workloads" cost_level: low + latency_level: medium + estimated_cost: 0.0005 + context_length: 1310720 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.1 + completion_cost_per_million: 0.3 + default_candidate: false + + meta-llama/llama-3.3-70b-instruct: + display_name: "Meta: Llama 3.3 70B Instruct" + description: "Meta: Llama 3.3 70B Instruct is an OpenRouter model accepting text input with a 131,072-token context window. This routing prior emphasizes tool use, structured output, multilingual tasks, cost-efficient workloads." + strengths: + - "tool use" + - "structured output" + - "multilingual tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.00052 + context_length: 131072 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.1 + completion_cost_per_million: 0.32 + default_candidate: false + + meta-llama/llama-3.1-70b-instruct: + display_name: "Meta: Llama 3.1 70B Instruct" + description: "Meta: Llama 3.1 70B Instruct is an OpenRouter model accepting text input with a 131,072-token context window. This routing prior emphasizes tool use, structured output, general instruction following." + strengths: + - "tool use" + - "structured output" + - "general instruction following" + cost_level: medium + latency_level: medium + estimated_cost: 0.0012 + context_length: 131072 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.4 + completion_cost_per_million: 0.4 + default_candidate: false + + meta-llama/llama-3.1-8b-instruct: + display_name: "Meta: Llama 3.1 8B Instruct" + description: "Meta: Llama 3.1 8B Instruct is an OpenRouter model accepting text input with a 131,072-token context window. This routing prior emphasizes tool use, structured output, cost-efficient workloads." + strengths: + - "tool use" + - "structured output" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.00018 + context_length: 131072 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.05 + completion_cost_per_million: 0.08 + default_candidate: false + + x-ai/grok-4.6: + display_name: "SpaceXAI: Grok 4.6" + description: "SpaceXAI: Grok 4.6 is an OpenRouter model accepting text, image, file input with a 500,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.01 + context_length: 500000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 6 + default_candidate: true + + x-ai/grok-4.5: + display_name: "SpaceXAI: Grok 4.5" + description: "SpaceXAI: Grok 4.5 is an OpenRouter model accepting text, image, file input with a 500,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.01 + context_length: 500000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 6 + default_candidate: false + + x-ai/grok-build-0.1: + display_name: "SpaceXAI: Grok Build 0.1" + description: "SpaceXAI: Grok Build 0.1 is an OpenRouter model accepting text, image, file input with a 256,000-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.004 + context_length: 256000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1 + completion_cost_per_million: 2 + default_candidate: false + + x-ai/grok-4.3: + display_name: "SpaceXAI: Grok 4.3" + description: "SpaceXAI: Grok 4.3 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.005 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.25 + completion_cost_per_million: 2.5 + default_candidate: false + + x-ai/grok-4.20: + display_name: "SpaceXAI: Grok 4.20" + description: "SpaceXAI: Grok 4.20 is an OpenRouter model accepting text, image, file input with a 2,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.005 + context_length: 2000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.25 + completion_cost_per_million: 2.5 + default_candidate: false + + moonshotai/kimi-k3: + display_name: "MoonshotAI: Kimi K3" + description: "MoonshotAI: Kimi K3 is an OpenRouter model accepting text, image, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.0119 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 1.7 + completion_cost_per_million: 8.5 + default_candidate: true + + moonshotai/kimi-k2.7-code: + display_name: "MoonshotAI: Kimi K2.7 Code" + description: "MoonshotAI: Kimi K2.7 Code is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes coding, reasoning, vision, tool use." + strengths: + - "coding" + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0046224 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.7062 + completion_cost_per_million: 3.21 + default_candidate: false + + moonshotai/kimi-k2.6: + display_name: "MoonshotAI: Kimi K2.6" + description: "MoonshotAI: Kimi K2.6 is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.0059 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.95 + completion_cost_per_million: 4 + default_candidate: false + + moonshotai/kimi-k2.5: + display_name: "MoonshotAI: Kimi K2.5" + description: "MoonshotAI: Kimi K2.5 is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.00315 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.45 + completion_cost_per_million: 2.25 + default_candidate: false + + moonshotai/kimi-k2-thinking: + display_name: "MoonshotAI: Kimi K2 Thinking" + description: "MoonshotAI: Kimi K2 Thinking is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.0037 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.6 + completion_cost_per_million: 2.5 + default_candidate: false + + minimax/minimax-m3: + display_name: "MiniMax: MiniMax M3" + description: "MiniMax: MiniMax M3 is an OpenRouter model accepting text, image, video input with a 1,048,576-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.0018 + context_length: 1048576 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.3 + completion_cost_per_million: 1.2 + default_candidate: true + + minimax/minimax-m2.7: + display_name: "MiniMax: MiniMax M2.7" + description: "MiniMax: MiniMax M2.7 is an OpenRouter model accepting text input with a 204,800-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.0018 + context_length: 204800 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.3 + completion_cost_per_million: 1.2 + default_candidate: false + + minimax/minimax-m2.5: + display_name: "MiniMax: MiniMax M2.5" + description: "MiniMax: MiniMax M2.5 is an OpenRouter model accepting text input with a 204,800-token context window. This routing prior emphasizes reasoning, tool use, structured output, fast responses." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.00162 + context_length: 204800 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.27 + completion_cost_per_million: 1.08 + default_candidate: false + + minimax/minimax-m1: + display_name: "MiniMax: MiniMax M1" + description: "MiniMax: MiniMax M1 is an OpenRouter model accepting text input with a 1,000,000-token context window. This routing prior emphasizes reasoning, tool use, long-context tasks, fast responses." + strengths: + - "reasoning" + - "tool use" + - "long-context tasks" + - "fast responses" + cost_level: medium latency_level: low estimated_cost: 0.003 + context_length: 1000000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 0.4 + completion_cost_per_million: 2.2 + default_candidate: false + + amazon/nova-2-lite-v1: + display_name: "Amazon: Nova 2 Lite" + description: "Amazon: Nova 2 Lite is an OpenRouter model accepting text, image, video, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "long-context tasks" + - "fast responses" + cost_level: medium + latency_level: low + estimated_cost: 0.0031 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "video" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 0.3 + completion_cost_per_million: 2.5 + default_candidate: true + + amazon/nova-premier-v1: + display_name: "Amazon: Nova Premier 1.0" + description: "Amazon: Nova Premier 1.0 is an OpenRouter model accepting text, image input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, long-context tasks." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.0175 + context_length: 1000000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: false + prompt_cost_per_million: 2.5 + completion_cost_per_million: 12.5 + default_candidate: false + + amazon/nova-micro-v1: + display_name: "Amazon: Nova Micro 1.0" + description: "Amazon: Nova Micro 1.0 is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes tool use, fast responses, cost-efficient workloads." + strengths: + - "tool use" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00021 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: false + prompt_cost_per_million: 0.035 + completion_cost_per_million: 0.14 + default_candidate: false + + amazon/nova-pro-v1: + display_name: "Amazon: Nova Pro 1.0" + description: "Amazon: Nova Pro 1.0 is an OpenRouter model accepting text, image input with a 300,000-token context window. This routing prior emphasizes vision, tool use, long-context tasks." + strengths: + - "vision" + - "tool use" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.0048 + context_length: 300000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: false + prompt_cost_per_million: 0.8 + completion_cost_per_million: 3.2 + default_candidate: false + + nvidia/nemotron-3.5-lightning: + display_name: "NVIDIA: Nemotron 3.5 Lightning" + description: "NVIDIA: Nemotron 3.5 Lightning is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00034 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.07 + completion_cost_per_million: 0.2 + default_candidate: false + + nvidia/nemotron-3-ultra-550b-a55b: + display_name: "NVIDIA: Nemotron 3 Ultra" + description: "NVIDIA: Nemotron 3 Ultra is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.0036 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.6 + completion_cost_per_million: 2.4 + default_candidate: false + + nvidia/nemotron-3-super-120b-a12b: + display_name: "NVIDIA: Nemotron 3 Super" + description: "NVIDIA: Nemotron 3 Super is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.00061 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.08 + completion_cost_per_million: 0.45 + default_candidate: false + + nvidia/nemotron-3-nano-30b-a3b: + display_name: "NVIDIA: Nemotron 3 Nano 30B A3B" + description: "NVIDIA: Nemotron 3 Nano 30B A3B is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, structured output, agentic tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00036 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.06 + completion_cost_per_million: 0.24 + default_candidate: false + + perplexity/sonar-pro-search: + display_name: "Perplexity: Sonar Pro Search" + description: "Perplexity: Sonar Pro Search is an OpenRouter model accepting text, image input with a 200,000-token context window. This routing prior emphasizes reasoning, vision, web research, structured output." + strengths: + - "reasoning" + - "vision" + - "web research" + - "structured output" + - "agentic tasks" + cost_level: high + latency_level: high + estimated_cost: 0.021 + context_length: 200000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 3 + completion_cost_per_million: 15 + default_candidate: false + + perplexity/sonar-reasoning-pro: + display_name: "Perplexity: Sonar Reasoning Pro" + description: "Perplexity: Sonar Reasoning Pro is an OpenRouter model accepting text, image input with a 128,000-token context window. This routing prior emphasizes reasoning, vision, web research." + strengths: + - "reasoning" + - "vision" + - "web research" + cost_level: high + latency_level: high + estimated_cost: 0.012 + context_length: 128000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 8 + default_candidate: false + + perplexity/sonar-pro: + display_name: "Perplexity: Sonar Pro" + description: "Perplexity: Sonar Pro is an OpenRouter model accepting text, image input with a 200,000-token context window. This routing prior emphasizes reasoning, vision, web research." + strengths: + - "reasoning" + - "vision" + - "web research" + cost_level: high + latency_level: high + estimated_cost: 0.021 + context_length: 200000 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: false + supports_reasoning: false + prompt_cost_per_million: 3 + completion_cost_per_million: 15 + default_candidate: false + + perplexity/sonar-deep-research: + display_name: "Perplexity: Sonar Deep Research" + description: "Perplexity: Sonar Deep Research is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes reasoning, web research, general instruction following." + strengths: + - "reasoning" + - "web research" + - "general instruction following" + cost_level: high + latency_level: high + estimated_cost: 0.012 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 8 + default_candidate: false - anthropic/claude-sonnet: - description: "Balanced model for careful writing, analysis, and software engineering." + perplexity/sonar: + display_name: "Perplexity: Sonar" + description: "Perplexity: Sonar is an OpenRouter model accepting text, image input with a 127,072-token context window. This routing prior emphasizes vision, web research, general instruction following." strengths: - - writing - - analysis - - coding + - "vision" + - "web research" + - "general instruction following" cost_level: medium latency_level: medium + estimated_cost: 0.003 + context_length: 127072 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: false + supports_reasoning: false + prompt_cost_per_million: 1 + completion_cost_per_million: 1 + default_candidate: false + + cohere/command-a: + display_name: "Cohere: Command A" + description: "Cohere: Command A is an OpenRouter model accepting text input with a 256,000-token context window. This routing prior emphasizes structured output, multilingual tasks, agentic tasks, long-context tasks." + strengths: + - "structured output" + - "multilingual tasks" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium estimated_cost: 0.015 + context_length: 256000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 2.5 + completion_cost_per_million: 10 + default_candidate: false - meta-llama/llama-3.3-70b-instruct: - description: "Open-weight general instruction model with broad language capabilities." + cohere/command-r7b-12-2024: + display_name: "Cohere: Command R7B (12-2024)" + description: "Cohere: Command R7B (12-2024) is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes reasoning, structured output, agentic tasks, fast responses." strengths: - - general QA - - multilingual tasks - - instruction following + - "reasoning" + - "structured output" + - "agentic tasks" + - "fast responses" + - "cost-efficient workloads" cost_level: low latency_level: medium - estimated_cost: 0.006 + estimated_cost: 0.000225 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.0375 + completion_cost_per_million: 0.15 + default_candidate: false + + cohere/command-r-08-2024: + display_name: "Cohere: Command R (08-2024)" + description: "Cohere: Command R (08-2024) is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes coding, reasoning, mathematics, tool use." + strengths: + - "coding" + - "reasoning" + - "mathematics" + - "tool use" + - "structured output" + - "multilingual tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.0009 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.15 + completion_cost_per_million: 0.6 + default_candidate: false + + cohere/command-r-plus-08-2024: + display_name: "Cohere: Command R+ (08-2024)" + description: "Cohere: Command R+ (08-2024) is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes tool use, structured output, general instruction following." + strengths: + - "tool use" + - "structured output" + - "general instruction following" + cost_level: high + latency_level: medium + estimated_cost: 0.015 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 2.5 + completion_cost_per_million: 10 + default_candidate: false + + bytedance-seed/seed-2-1-turbo: + display_name: "ByteDance Seed: Seed 2.1 Turbo" + description: "ByteDance Seed: Seed 2.1 Turbo is an OpenRouter model accepting text, image, video input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.0035 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.5 + completion_cost_per_million: 2.5 + default_candidate: false + + bytedance-seed/seed-2.0-code: + display_name: "ByteDance Seed: Seed-2.0-Code" + description: "ByteDance Seed: Seed-2.0-Code is an OpenRouter model accepting text, image, video input with a 262,144-token context window. This routing prior emphasizes coding, reasoning, vision, video understanding." + strengths: + - "coding" + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "multilingual tasks" + cost_level: medium + latency_level: medium + estimated_cost: 0.004 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.5 + completion_cost_per_million: 3 + default_candidate: false + + bytedance-seed/seed-2.0-lite: + display_name: "ByteDance Seed: Seed-2.0-Lite" + description: "ByteDance Seed: Seed-2.0-Lite is an OpenRouter model accepting text, image, video input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: low + estimated_cost: 0.0025 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.25 + completion_cost_per_million: 2 + default_candidate: false + + bytedance-seed/seed-2.0-mini: + display_name: "ByteDance Seed: Seed-2.0-Mini" + description: "ByteDance Seed: Seed-2.0-Mini is an OpenRouter model accepting text, image, video input with a 262,144-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "long-context tasks" + - "fast responses" + cost_level: low + latency_level: low + estimated_cost: 0.0006 + context_length: 262144 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.1 + completion_cost_per_million: 0.4 + default_candidate: false + + microsoft/phi-4: + display_name: "Microsoft: Phi 4" + description: "Microsoft: Phi 4 is an OpenRouter model accepting text input with a 16,384-token context window. This routing prior emphasizes reasoning, structured output, fast responses, cost-efficient workloads." + strengths: + - "reasoning" + - "structured output" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00028 + context_length: 16384 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.07 + completion_cost_per_million: 0.14 + default_candidate: false + + inception/mercury-2.5: + display_name: "Inception: Mercury 2.5" + description: "Inception: Mercury 2.5 is an OpenRouter model accepting text input with a 260,000-token context window. This routing prior emphasizes reasoning, tool use, structured output, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "structured output" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.00023 + context_length: 260000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.04 + completion_cost_per_million: 0.15 + default_candidate: false + + inference-net/schematron-v2-turbo: + display_name: "Inference.net: Schematron V2 Turbo" + description: "Inference.net: Schematron V2 Turbo is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes structured extraction, structured output, fast responses, cost-efficient workloads." + strengths: + - "structured extraction" + - "structured output" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00021 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.03 + completion_cost_per_million: 0.15 + default_candidate: false + + inference-net/schematron-v2-small: + display_name: "Inference.net: Schematron V2 Small" + description: "Inference.net: Schematron V2 Small is an OpenRouter model accepting text input with a 128,000-token context window. This routing prior emphasizes structured extraction, structured output, fast responses, cost-efficient workloads." + strengths: + - "structured extraction" + - "structured output" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.00033 + context_length: 128000 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: false + supports_structured_outputs: true + supports_reasoning: false + prompt_cost_per_million: 0.05 + completion_cost_per_million: 0.23 + default_candidate: false + + sakana/fugu-ultra-v2: + display_name: "Sakana: Fugu Ultra v2" + description: "Sakana: Fugu Ultra v2 is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: high + estimated_cost: 0.04 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 5 + completion_cost_per_million: 30 + default_candidate: false + + sakana/fugu-max: + display_name: "Sakana: Fugu Max" + description: "Sakana: Fugu Max is an OpenRouter model accepting text, image, file input with a 1,000,000-token context window. This routing prior emphasizes reasoning, vision, tool use, structured output." + strengths: + - "reasoning" + - "vision" + - "tool use" + - "structured output" + - "agentic tasks" + - "long-context tasks" + cost_level: medium + latency_level: high + estimated_cost: 0.01 + context_length: 1000000 + input_modalities: + - "text" + - "image" + - "file" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 2 + completion_cost_per_million: 6 + default_candidate: false + + unbiased/pareto: + display_name: "Pareto" + description: "Pareto is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes vision, tool use, agentic tasks, long-context tasks." + strengths: + - "vision" + - "tool use" + - "agentic tasks" + - "long-context tasks" + cost_level: high + latency_level: medium + estimated_cost: 0.0125 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: false + prompt_cost_per_million: 2.5 + completion_cost_per_million: 7.5 + default_candidate: false + + prism-ml/ternary-bonsai-2-27b: + display_name: "PrismML: Ternary Bonsai 2 27B" + description: "PrismML: Ternary Bonsai 2 27B is an OpenRouter model accepting text, image input with a 262,144-token context window. This routing prior emphasizes reasoning, mathematics, vision, tool use." + strengths: + - "reasoning" + - "mathematics" + - "vision" + - "tool use" + - "structured output" + - "long-context tasks" + - "cost-efficient workloads" + cost_level: low + latency_level: medium + estimated_cost: 0.00065 + context_length: 262144 + input_modalities: + - "text" + - "image" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.075 + completion_cost_per_million: 0.5 + default_candidate: false + + inclusionai/ling-3.0-flash-vl: + display_name: "inclusionAI: Ling 3.0 Flash VL" + description: "inclusionAI: Ling 3.0 Flash VL is an OpenRouter model accepting text, image, video input with a 131,072-token context window. This routing prior emphasizes reasoning, vision, video understanding, tool use." + strengths: + - "reasoning" + - "vision" + - "video understanding" + - "tool use" + - "structured output" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.0003 + context_length: 131072 + input_modalities: + - "text" + - "image" + - "video" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: true + supports_reasoning: true + prompt_cost_per_million: 0.06 + completion_cost_per_million: 0.18 + default_candidate: false + + inclusionai/ling-3.0-flash: + display_name: "inclusionAI: Ling 3.0 Flash" + description: "inclusionAI: Ling 3.0 Flash is an OpenRouter model accepting text input with a 262,144-token context window. This routing prior emphasizes reasoning, tool use, agentic tasks, long-context tasks." + strengths: + - "reasoning" + - "tool use" + - "agentic tasks" + - "long-context tasks" + - "fast responses" + - "cost-efficient workloads" + cost_level: low + latency_level: low + estimated_cost: 0.000105 + context_length: 262144 + input_modalities: + - "text" + output_modalities: + - "text" + supports_tools: true + supports_structured_outputs: false + supports_reasoning: true + prompt_cost_per_million: 0.021 + completion_cost_per_million: 0.063 + default_candidate: false diff --git a/reflexroute/router.py b/reflexroute/router.py index c7505f2..a3fc764 100644 --- a/reflexroute/router.py +++ b/reflexroute/router.py @@ -34,7 +34,13 @@ def __init__( client: JevClient | None = None, ) -> None: self.profiles = load_profiles(profile_path) - selected = list(self.profiles) if models is None else _validate_models(models) + selected = ( + [name for name, profile in self.profiles.items() if profile.default_candidate] + if models is None + else _validate_models(models) + ) + if models is None and not selected: + selected = list(self.profiles) if not selected: raise ConfigurationError("At least one candidate model is required.") self.models = tuple(selected) diff --git a/reflexroute/schemas.py b/reflexroute/schemas.py index ccbdcf6..ff6e93e 100644 --- a/reflexroute/schemas.py +++ b/reflexroute/schemas.py @@ -86,6 +86,7 @@ class ModelProfile: estimated_cost: float | None = None profile_version: str | None = None source: Any = None + default_candidate: bool = False extra: Mapping[str, Any] = field(default_factory=dict) def to_context(self) -> dict[str, Any]: diff --git a/scripts/build_model_profiles.py b/scripts/build_model_profiles.py new file mode 100644 index 0000000..ebb5690 --- /dev/null +++ b/scripts/build_model_profiles.py @@ -0,0 +1,410 @@ +#!/usr/bin/env python3 +"""Build the checked-in model priors from an OpenRouter Models API snapshot. + +This script deliberately consumes a local JSON snapshot instead of fetching the +network itself. Updating the catalog is therefore an explicit, reviewable act: + + curl -fsSL https://openrouter.ai/api/v1/models -o /tmp/models.json + python scripts/build_model_profiles.py --catalog /tmp/models.json +""" + +from __future__ import annotations + +import argparse +from decimal import Decimal +import json +from pathlib import Path +from typing import Any, Mapping + + +SNAPSHOT_DATE = "2026-09-20" +PROFILE_VERSION = "2026-09-20.1" +ASSUMED_INPUT_TOKENS = 2_000 +ASSUMED_OUTPUT_TOKENS = 1_000 + +# Non-batch, non-free entries selected for provider breadth and common routing +# use cases. Existence is checked against every input snapshot. +SELECTED_MODELS = [ + # OpenAI (18) + "openai/gpt-6-astra", + "openai/gpt-6-astra-pro", + "openai/gpt-5.6-luna-pro", + "openai/gpt-5.6-luna", + "openai/gpt-5.6-terra-pro", + "openai/gpt-5.6-terra", + "openai/gpt-5.6-sol-pro", + "openai/gpt-5.6-sol", + "openai/gpt-5.5-pro", + "openai/gpt-5.5", + "openai/gpt-5.4-nano", + "openai/gpt-5.4-mini", + "openai/gpt-5.4-pro", + "openai/gpt-5.4", + "openai/gpt-5.3-codex", + "openai/gpt-5.2-codex", + "openai/gpt-5.1-codex-mini", + "openai/gpt-oss-120b", + # Anthropic (10) + "anthropic/claude-fable-5.1", + "anthropic/claude-opus-5", + "anthropic/claude-sonnet-5", + "anthropic/claude-fable-5", + "anthropic/claude-opus-4.8", + "anthropic/claude-sonnet-4.6", + "anthropic/claude-opus-4.6", + "anthropic/claude-haiku-4.5", + "anthropic/claude-sonnet-4.5", + "anthropic/claude-opus-4.5", + # Google (12) + "google/gemini-3.8-flash", + "google/gemini-3.7-flash", + "google/gemini-3.6-flash", + "google/gemini-3.5-flash-lite", + "google/gemini-3.5-flash", + "google/gemini-3.1-flash-lite", + "google/gemini-3.1-pro-preview", + "google/gemini-3-flash-preview", + "google/gemini-2.5-flash-lite", + "google/gemini-2.5-flash", + "google/gemini-2.5-pro", + "google/gemma-4-31b-it", + # Qwen (16) + "qwen/qwen3.8-max-0902", + "qwen/qwen3.8-flash", + "qwen/qwen3.8-27b", + "qwen/qwen3.8-2.4t-a95b", + "qwen/qwen3.7-flash", + "qwen/qwen3.7-plus", + "qwen/qwen3.7-max", + "qwen/qwen3.6-flash", + "qwen/qwen3.6-35b-a3b", + "qwen/qwen3.6-plus", + "qwen/qwen3.5-122b-a10b", + "qwen/qwen3.5-flash-02-23", + "qwen/qwen3-max-thinking", + "qwen/qwen3-coder-next", + "qwen/qwen3-vl-235b-a22b-thinking", + "qwen/qwen3-coder-plus", + # DeepSeek (8) + "deepseek/deepseek-v4.1-flash", + "deepseek/deepseek-v4-pro-0813", + "deepseek/deepseek-v4-flash-0731", + "deepseek/deepseek-v4-pro", + "deepseek/deepseek-v4-flash", + "deepseek/deepseek-v3.2", + "deepseek/deepseek-r1-0528", + "deepseek/deepseek-r1", + # Mistral (8) + "mistralai/mistral-medium-3-5", + "mistralai/mistral-small-2603", + "mistralai/devstral-2512", + "mistralai/ministral-14b-2512", + "mistralai/mistral-medium-3.1", + "mistralai/codestral-2508", + "mistralai/mistral-small-3.2-24b-instruct", + "mistralai/mistral-nemo", + # Z.ai (8) + "z-ai/glm-5.3-flashx", + "z-ai/glm-5.3-flash", + "z-ai/glm-5.3", + "z-ai/glm-5.2", + "z-ai/glm-5.1", + "z-ai/glm-5v-turbo", + "z-ai/glm-5", + "z-ai/glm-4.7", + # Meta (5) + "meta-llama/llama-4-maverick", + "meta-llama/llama-4-scout", + "meta-llama/llama-3.3-70b-instruct", + "meta-llama/llama-3.1-70b-instruct", + "meta-llama/llama-3.1-8b-instruct", + # xAI (5) + "x-ai/grok-4.6", + "x-ai/grok-4.5", + "x-ai/grok-build-0.1", + "x-ai/grok-4.3", + "x-ai/grok-4.20", + # Moonshot (5) + "moonshotai/kimi-k3", + "moonshotai/kimi-k2.7-code", + "moonshotai/kimi-k2.6", + "moonshotai/kimi-k2.5", + "moonshotai/kimi-k2-thinking", + # MiniMax (4) + "minimax/minimax-m3", + "minimax/minimax-m2.7", + "minimax/minimax-m2.5", + "minimax/minimax-m1", + # Amazon (4) + "amazon/nova-2-lite-v1", + "amazon/nova-premier-v1", + "amazon/nova-micro-v1", + "amazon/nova-pro-v1", + # NVIDIA (4) + "nvidia/nemotron-3.5-lightning", + "nvidia/nemotron-3-ultra-550b-a55b", + "nvidia/nemotron-3-super-120b-a12b", + "nvidia/nemotron-3-nano-30b-a3b", + # Perplexity (5) + "perplexity/sonar-pro-search", + "perplexity/sonar-reasoning-pro", + "perplexity/sonar-pro", + "perplexity/sonar-deep-research", + "perplexity/sonar", + # Cohere (4) + "cohere/command-a", + "cohere/command-r7b-12-2024", + "cohere/command-r-08-2024", + "cohere/command-r-plus-08-2024", + # ByteDance Seed (4) + "bytedance-seed/seed-2-1-turbo", + "bytedance-seed/seed-2.0-code", + "bytedance-seed/seed-2.0-lite", + "bytedance-seed/seed-2.0-mini", + # Additional useful specialists and provider coverage (10) + "microsoft/phi-4", + "inception/mercury-2.5", + "inference-net/schematron-v2-turbo", + "inference-net/schematron-v2-small", + "sakana/fugu-ultra-v2", + "sakana/fugu-max", + "unbiased/pareto", + "prism-ml/ternary-bonsai-2-27b", + "inclusionai/ling-3.0-flash-vl", + "inclusionai/ling-3.0-flash", +] + +DEFAULT_MODELS = { + "openai/gpt-5.6-sol", + "openai/gpt-5.6-luna", + "anthropic/claude-sonnet-5", + "anthropic/claude-haiku-4.5", + "google/gemini-3.8-flash", + "qwen/qwen3.8-max-0902", + "deepseek/deepseek-v4.1-flash", + "mistralai/mistral-medium-3-5", + "z-ai/glm-5.3", + "meta-llama/llama-4-maverick", + "x-ai/grok-4.6", + "moonshotai/kimi-k3", + "minimax/minimax-m3", + "amazon/nova-2-lite-v1", +} + + +def _decimal(value: Any) -> Decimal: + try: + return Decimal(str(value or "0")) + except Exception as exc: + raise ValueError(f"Invalid price value: {value!r}") from exc + + +def _contains(text: str, *needles: str) -> bool: + return any(needle in text for needle in needles) + + +def infer_strengths(model: Mapping[str, Any]) -> list[str]: + """Conservatively infer routing tags from official metadata.""" + + model_id = str(model["id"]) + text = " ".join( + (model_id, str(model.get("name", "")), str(model.get("description", ""))) + ).casefold() + architecture = model.get("architecture") or {} + inputs = set(architecture.get("input_modalities") or []) + parameters = set(model.get("supported_parameters") or []) + strengths: list[str] = [] + + def add(value: str) -> None: + if value not in strengths: + strengths.append(value) + + if _contains(text, "safety", "guard", "moderation"): + add("safety classification") + if _contains(text, "html-to-json", "extraction", "schema extraction"): + add("structured extraction") + if _contains(text, "code", "coder", "codex", "devstral", "software engineering", "programming"): + add("coding") + if model.get("reasoning") or _contains(text, "reasoning", "thinking", "math", "scientific", "analysis"): + add("reasoning") + if _contains(text, "math", "mathematics"): + add("mathematics") + if "image" in inputs: + add("vision") + if "video" in inputs: + add("video understanding") + if "audio" in inputs or _contains(text, "audio", "speech", "transcription"): + add("audio understanding") + if model_id.startswith("perplexity/") or _contains(text, "web search", "deep research", "search model"): + add("web research") + if "tools" in parameters or "tool_choice" in parameters: + add("tool use") + if "structured_outputs" in parameters: + add("structured output") + if _contains(text, "multilingual", "translation", "many languages"): + add("multilingual tasks") + if _contains(text, "agentic", "agent", "multi-agent"): + add("agentic tasks") + if _contains(text, "creative", "writing", "roleplay"): + add("writing") + if int(model.get("context_length") or 0) >= 250_000: + add("long-context tasks") + if _contains(text, "flash", "nano", "mini", "lite", "haiku", "lightning", "turbo", "micro", "small"): + add("fast responses") + + prompt = _decimal((model.get("pricing") or {}).get("prompt")) + completion = _decimal((model.get("pricing") or {}).get("completion")) + if prompt * 1_000_000 <= Decimal("0.25") and completion * 1_000_000 <= Decimal("1"): + add("cost-efficient workloads") + if len(strengths) < 3: + add("general instruction following") + return strengths[:7] + + +def infer_latency(model: Mapping[str, Any]) -> str: + text = f"{model['id']} {model.get('name', '')}".casefold() + if _contains(text, "deep-research", "reasoning-pro", "ultra", "astra", "opus", "thinking", "-pro", " max"): + return "high" + if _contains(text, "flash", "nano", "mini", "lite", "haiku", "lightning", "turbo", "micro", "small"): + return "low" + return "medium" + + +def cost_data(model: Mapping[str, Any]) -> tuple[Decimal, Decimal, Decimal, str]: + pricing = model.get("pricing") or {} + prompt = _decimal(pricing.get("prompt")) + completion = _decimal(pricing.get("completion")) + if prompt < 0 or completion < 0: + raise ValueError(f"Dynamic/negative pricing is unsupported for {model['id']}") + estimated = prompt * ASSUMED_INPUT_TOKENS + completion * ASSUMED_OUTPUT_TOKENS + if estimated == 0: + level = "free" + elif estimated <= Decimal("0.001"): + level = "low" + elif estimated <= Decimal("0.01"): + level = "medium" + elif estimated <= Decimal("0.05"): + level = "high" + else: + level = "premium" + return prompt * 1_000_000, completion * 1_000_000, estimated, level + + +def build_description(model: Mapping[str, Any], strengths: list[str]) -> str: + architecture = model.get("architecture") or {} + inputs = architecture.get("input_modalities") or ["text"] + context = int(model.get("context_length") or 0) + focus = ", ".join(strengths[:4]) + return ( + f"{model.get('name') or model['id']} is an OpenRouter model accepting " + f"{', '.join(inputs)} input with a {context:,}-token context window. " + f"This routing prior emphasizes {focus}." + ) + + +def yaml_string(value: str) -> str: + return json.dumps(value, ensure_ascii=False) + + +def yaml_number(value: Decimal) -> str: + rendered = format(value.quantize(Decimal("0.00000001")), "f").rstrip("0").rstrip(".") + return rendered or "0" + + +def render(catalog: Mapping[str, Any]) -> str: + data = catalog.get("data") + if not isinstance(data, list): + raise ValueError("Catalog must contain a data list.") + by_id = {str(item["id"]): item for item in data} + missing = [model_id for model_id in SELECTED_MODELS if model_id not in by_id] + if missing: + raise ValueError(f"Selected models missing from snapshot: {', '.join(missing)}") + if len(SELECTED_MODELS) != len(set(SELECTED_MODELS)): + raise ValueError("SELECTED_MODELS contains duplicates.") + if len(SELECTED_MODELS) < 100: + raise ValueError("At least 100 model profiles are required.") + + providers = {model_id.split("/", 1)[0] for model_id in SELECTED_MODELS} + lines = [ + "# Generated by scripts/build_model_profiles.py; edit the generator, not this file.", + f"profile_version: {yaml_string(PROFILE_VERSION)}", + "source:", + f" type: {yaml_string('OpenRouter Models API snapshot plus ReflexRoute heuristic annotations')}", + f" url: {yaml_string('https://openrouter.ai/api/v1/models')}", + f" retrieved_at: {yaml_string(SNAPSHOT_DATE)}", + f" catalog_models: {len(data)}", + f" selected_models: {len(SELECTED_MODELS)}", + f" selected_providers: {len(providers)}", + "cost_estimate:", + " currency: \"USD\"", + f" assumed_input_tokens: {ASSUMED_INPUT_TOKENS}", + f" assumed_output_tokens: {ASSUMED_OUTPUT_TOKENS}", + " excludes: \"cache, images, audio, web search, and provider-specific fees\"", + "inference_notes:", + " strengths: \"Conservative tags inferred from official descriptions, modalities, and supported parameters.\"", + " latency_level: \"Heuristic tier inferred from model family naming; not measured latency.\"", + "", + "models:", + ] + + for model_id in SELECTED_MODELS: + model = by_id[model_id] + strengths = infer_strengths(model) + prompt_million, completion_million, estimated, cost_level = cost_data(model) + architecture = model.get("architecture") or {} + inputs = architecture.get("input_modalities") or ["text"] + outputs = architecture.get("output_modalities") or ["text"] + parameters = set(model.get("supported_parameters") or []) + lines.extend( + [ + f" {model_id}:", + f" display_name: {yaml_string(str(model.get('name') or model_id))}", + f" description: {yaml_string(build_description(model, strengths))}", + " strengths:", + *[f" - {yaml_string(value)}" for value in strengths], + f" cost_level: {cost_level}", + f" latency_level: {infer_latency(model)}", + f" estimated_cost: {yaml_number(estimated)}", + f" context_length: {int(model.get('context_length') or 0)}", + " input_modalities:", + *[f" - {yaml_string(str(value))}" for value in inputs], + " output_modalities:", + *[f" - {yaml_string(str(value))}" for value in outputs], + f" supports_tools: {str('tools' in parameters or 'tool_choice' in parameters).lower()}", + f" supports_structured_outputs: {str('structured_outputs' in parameters).lower()}", + f" supports_reasoning: {str(bool(model.get('reasoning'))).lower()}", + f" prompt_cost_per_million: {yaml_number(prompt_million)}", + f" completion_cost_per_million: {yaml_number(completion_million)}", + f" default_candidate: {str(model_id in DEFAULT_MODELS).lower()}", + "", + ] + ) + return "\n".join(lines).rstrip() + "\n" + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--catalog", required=True, type=Path, help="OpenRouter models JSON snapshot") + parser.add_argument( + "--output", + type=Path, + default=Path("reflexroute/profiles/models.yaml"), + help="generated YAML path", + ) + parser.add_argument("--check", action="store_true", help="fail when output is not up to date") + args = parser.parse_args() + + catalog = json.loads(args.catalog.read_text(encoding="utf-8")) + rendered = render(catalog) + if args.check: + if not args.output.exists() or args.output.read_text(encoding="utf-8") != rendered: + raise SystemExit(f"{args.output} is not up to date") + print(f"{args.output}: up to date ({len(SELECTED_MODELS)} profiles)") + return 0 + args.output.write_text(rendered, encoding="utf-8") + print(f"Wrote {len(SELECTED_MODELS)} profiles to {args.output}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/test_context.py b/tests/test_context.py index d421bb7..a10cade 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -5,7 +5,7 @@ def test_context_has_priors_balanced_evidence_and_one_choice(): profiles = load_profiles() - models = ["openai/gpt-5.6", "google/gemini-flash"] + models = ["openai/gpt-5.6-sol", "google/gemini-3.8-flash"] history = [ HistoryRecord("write concurrent code", models[0], 0.9), HistoryRecord("write simple code", models[0], 0.7), @@ -23,7 +23,8 @@ def test_context_has_priors_balanced_evidence_and_one_choice(): candidates = state["candidate_models"] assert len(candidates[models[0]]["historical_evidence"]) == 1 assert len(candidates[models[1]]["historical_evidence"]) == 1 - assert candidates[models[0]]["prior"]["profile_version"] == "0.1.0" + assert candidates[models[0]]["prior"]["profile_version"] == "2026-09-20.1" + assert candidates[models[0]]["prior"]["context_length"] == 1_050_000 def test_unknown_model_gets_honest_fallback_prior(): diff --git a/tests/test_profiles.py b/tests/test_profiles.py new file mode 100644 index 0000000..c506602 --- /dev/null +++ b/tests/test_profiles.py @@ -0,0 +1,41 @@ +import pytest + +from reflexroute import Router +from reflexroute.profiles import load_profiles + + +def test_catalog_has_at_least_one_hundred_traceable_profiles(): + profiles = load_profiles() + assert len(profiles) == 130 + assert len({model.split("/", 1)[0] for model in profiles}) >= 20 + + for model, profile in profiles.items(): + assert "/" in model + assert not model.endswith(":batch") + assert not model.endswith(":free") + assert profile.description + assert profile.strengths + assert profile.estimated_cost is not None + assert profile.estimated_cost >= 0 + assert profile.profile_version == "2026-09-20.1" + assert profile.source["url"] == "https://openrouter.ai/api/v1/models" + assert profile.source["retrieved_at"] == "2026-09-20" + assert profile.extra["context_length"] > 0 + assert profile.extra["input_modalities"] + assert profile.extra["output_modalities"] + + +def test_estimated_cost_uses_documented_token_assumption(): + for profile in load_profiles().values(): + prompt = float(profile.extra["prompt_cost_per_million"]) + completion = float(profile.extra["completion_cost_per_million"]) + expected = prompt / 1_000_000 * 2_000 + completion / 1_000_000 * 1_000 + assert profile.estimated_cost == pytest.approx(expected, abs=1e-8) + + +def test_default_router_uses_bounded_cross_provider_shortlist(): + router = Router() + assert 10 <= len(router.models) <= 20 + assert len({model.split("/", 1)[0] for model in router.models}) >= 10 + assert all(router.profiles[model].default_candidate for model in router.models) + assert len(router.models) < len(router.profiles) diff --git a/tests/test_router.py b/tests/test_router.py index eea203e..2451c48 100644 --- a/tests/test_router.py +++ b/tests/test_router.py @@ -18,10 +18,10 @@ def choose(self, state, question, choice_to_model): def test_zero_shot_route_builds_structured_decision(): client = FakeClient() router = Router( - ["openai/gpt-5.6", "google/gemini-flash"], client=client + ["openai/gpt-5.6-sol", "google/gemini-3.8-flash"], client=client ) result = router.route("Implement a rate limiter") - assert result.model == "openai/gpt-5.6" + assert result.model == "openai/gpt-5.6-sol" state, question, choice_map = client.calls[0] assert "messages" not in state assert set(state["candidate_models"]) == set(router.models) @@ -32,18 +32,18 @@ def test_zero_shot_route_builds_structured_decision(): def test_budget_filters_before_api_and_single_candidate_short_circuits(): client = FakeClient() router = Router( - ["openai/gpt-5.6", "google/gemini-flash"], client=client + ["openai/gpt-5.6-sol", "google/gemini-3.8-flash"], client=client ) result = router.route("Summarize", budget=0.01) - assert result.model == "google/gemini-flash" - assert result.probabilities == {"google/gemini-flash": 1.0} + assert result.model == "google/gemini-3.8-flash" + assert result.probabilities == {"google/gemini-3.8-flash": 1.0} assert result.usage["local_short_circuit"] is True assert client.calls == [] def test_impossible_budget_and_unknown_cost_raise(): with pytest.raises(BudgetError, match="No candidate"): - Router(["openai/gpt-5.6"]).route("query", budget=0.001) + Router(["openai/gpt-5.6-sol"]).route("query", budget=0.001) with pytest.raises(BudgetError, match="unknown/private"): Router(["unknown/private"]).route("query", budget=10) @@ -82,13 +82,13 @@ def test_invalid_history_has_line_context(tmp_path): def test_build_decision_applies_budget_to_choice_map(): router = Router([ - "openai/gpt-5.6", - "google/gemini-flash", + "openai/gpt-5.6-sol", + "google/gemini-3.8-flash", "meta-llama/llama-3.3-70b-instruct", ]) state, _, choice_map = router.build_decision("query", budget=0.01) assert set(choice_map.values()) == { - "google/gemini-flash", + "google/gemini-3.8-flash", "meta-llama/llama-3.3-70b-instruct", } assert set(state["candidate_models"]) == set(choice_map.values())