Coverage for app / db / postgres / providers / registry.py: 100%
75 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-10-31 11:23 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-10-31 11:23 +0000
1"""
2Built-in LLM provider and model registry.
4Providers and models are seeded into the DB on startup via the seeder.
5Using an upsert pattern means cost, context window, and capability data
6stay in sync with this registry on every deploy — no migration required
7when adding or updating models.
9Adding a new provider:
10 1. Add a ProviderSeed entry to BUILTIN_PROVIDERS below.
11 2. Add model entries referencing the provider name to BUILTIN_MODELS.
12 3. The seeder in lifespan.py will upsert on next startup.
14Adding a new model:
15 1. Add a ModelSeed entry to BUILTIN_MODELS below.
16 2. The seeder in lifespan.py will upsert on next startup.
18Cost fields (input_cost_per_token, output_cost_per_token) are in USD per token.
19Use high-precision decimal strings (10 d.p.) to avoid floating-point drift.
20"""
22from __future__ import annotations
24from datetime import date
25from typing import NotRequired, TypedDict
27from app.db.postgres.enums import ModelEnum
28from app.common.settings import get_settings
29from app.services.inference_routes import SERVING_PLATFORM
30from app.util.registry import BuiltinRegistry
32settings = get_settings()
34DataRegion = ModelEnum.DataRegion
35Effort = ModelEnum.Effort
36Latency = ModelEnum.Latency
39# ---------------------------------------------------------------------------
40# Type definitions
41# ---------------------------------------------------------------------------
44class ProviderSeed(TypedDict):
45 id: str
46 name: str # Must match ModelEnum.Provider
47 display_name: str
48 is_enabled: bool
51class BedrockRoute(TypedDict):
52 """How a catalogue model is reached through Amazon Bedrock from
53 ``BEDROCK_REGION`` (``app.services.inference_routes``), and what it costs
54 and where it runs there. On a ``bedrock`` deployment the seeder writes
55 these over the vendor's figures, so prices, region and limits describe
56 the route actually taken."""
58 #: The Converse ``modelId``: a base model id for in-region inference, or
59 #: an inference-profile id (``eu.…``, ``global.…``).
60 model_id: str
61 #: Where Bedrock processes the request on this route.
62 data_region: DataRegion
63 input_cost_per_token: str
64 output_cost_per_token: str
65 cache_read_cost_per_token: str | None
66 cache_write_cost_per_token: str | None
67 cache_write_1h_cost_per_token: str | None
68 #: Whether Bedrock decodes to a JSON schema natively for this model, as
69 #: its card lists "Structured outputs" — narrower than the vendors' own
70 #: support: Claude 4.5 and 4.6, gpt-oss, Qwen3 235B; no Claude 5.x.
71 native_structured_output: bool
72 #: Whether a call may force the model to use a tool (Converse
73 #: ``toolChoice`` ``any`` / ``tool``), which function calling does to
74 #: make it fill a schema. Not Claude 5.x, which thinks by default and
75 #: will not be forced while it thinks, nor the open-weight models: the
76 #: probe (20 October 2026) found gpt-oss accepts a forced choice and
77 #: ignores it, and Qwen3's one forced call cannot say whether it was
78 #: forced. Those are offered the tool and asked to call it. Absent (the
79 #: embedding route) means no.
80 forced_tool_choice: NotRequired[bool]
81 #: Whether a tool's arguments are held to its schema here
82 #: (``toolSpec.strict``) — the other half of "Structured outputs" on the
83 #: card, so never without ``native_structured_output``, and set only where
84 #: the structured probe (``app/diagnostics/structured_probe.py``) measured
85 #: it: accepted, no compile cost a turn would notice, no recompile when a
86 #: tool set changes. On 20 October 2026 that was gpt-oss-120b and Qwen3
87 #: 235B; the Claude 4.5 / 4.6 routes wait for Anthropic access and a run.
88 #: Used only for tools whose schema the platform wrote, and only while
89 #: ``STRICT_BUILTIN_TOOLS`` is on (``app/tools/wire.py``). Absent means no.
90 strict_tools: NotRequired[bool]
91 #: Whether the model reasons before it answers here, so its reasoning
92 #: counts against an output cap (``ModelCapabilities.reasons_before_answering``:
93 #: triage's and the quality check's caps). For a model whose name says
94 #: nothing (``model_capabilities._OPEN_WEIGHT_THINKING``), set only where
95 #: the reply probe (``app/diagnostics/reply_probe.py``) saw it reason by
96 #: default. Absent means no.
97 reasons_before_answering: NotRequired[bool]
98 #: Where Bedrock's limits differ from the vendor's; None keeps the
99 #: vendor's.
100 context_window: int | None
101 max_output_tokens: int | None
102 #: The prompt size past which Bedrock reprices the whole request, and by
103 #: how much; absent where the route has no such tier.
104 long_context_threshold: NotRequired[int | None]
105 long_context_input_multiplier: NotRequired[str | None]
106 long_context_output_multiplier: NotRequired[str | None]
107 #: Where a source states these figures, and when they were checked.
108 source: str
111class ModelSeed(TypedDict):
112 id: str
113 provider_id: str
114 model_name: str # Bare identifier passed to LiteLLM (no provider prefix)
115 display_name: str
116 description: str | None
117 is_chat: bool
118 is_embedding: bool
119 is_vision: bool
120 # The platform's picks. Written on INSERT only — see the seeder — so an
121 # operator who changes them in the UI is not overruled on the next deploy.
122 is_default: bool
123 is_recommended: bool
124 context_window: int | None
125 max_output_tokens: int | None
126 input_cost_per_token: str | None # USD per token, 10 d.p. decimal string
127 output_cost_per_token: str | None # USD per token, 10 d.p. decimal string
128 # The rest of the price card (services/provider_usage.py): what a cache
129 # read, a cache write and an Anthropic 1-hour cache write cost per token,
130 # and the prompt size past which the whole request is repriced. None
131 # where the model has no such rate.
132 cache_read_cost_per_token: str | None
133 cache_write_cost_per_token: str | None
134 cache_write_1h_cost_per_token: str | None
135 long_context_threshold: int | None
136 long_context_input_multiplier: str | None
137 long_context_output_multiplier: str | None
138 data_region: DataRegion | None # Region where requests are processed
139 effort: Effort | None # Provider-independent reasoning tier
140 latency: Latency | None # Comparative speed within this catalogue
141 knowledge_cutoff: date | None # Reliable knowledge cutoff, as published
142 #: The route through Amazon Bedrock, or absent where Bedrock does not
143 #: offer the model from ``BEDROCK_REGION``: on a ``bedrock`` deployment
144 #: such a model is unavailable (``is_available`` false).
145 bedrock: NotRequired[BedrockRoute]
146 #: Whether the vendor's own API serves the model. False for a model only
147 #: Bedrock offers (gpt-oss): unavailable on a ``direct`` deployment.
148 direct: NotRequired[bool]
149 #: The default model on a ``bedrock`` deployment — UK- or EU-resident,
150 #: per the residency decision. Exactly one seed sets it.
151 is_default_on_bedrock: NotRequired[bool]
152 #: The default that stands in while that one is unavailable, from another
153 #: vendor (its account access missing, ``BEDROCK_MODEL_ACCESS``). Exactly
154 #: one seed sets it (seeder ``_keep_default_usable``).
155 is_fallback_default_on_bedrock: NotRequired[bool]
158# ---------------------------------------------------------------------------
159# Providers — stable UUIDs so the seeder can target rows precisely
160# ---------------------------------------------------------------------------
162# Named so a model entry says which provider it belongs to rather than
163# repeating a UUID that has to be matched by eye.
164_OPENAI = "a0000000-0000-0000-0000-000000000001"
165_ANTHROPIC = "a0000000-0000-0000-0000-000000000002"
166_BEDROCK = "a0000000-0000-0000-0000-000000000008"
168_BUILTIN_PROVIDERS: list[ProviderSeed] = [
169 {
170 "id": _OPENAI,
171 "name": ModelEnum.Provider.openai,
172 "display_name": "OpenAI",
173 "is_enabled": True,
174 },
175 {
176 "id": _ANTHROPIC,
177 "name": ModelEnum.Provider.anthropic,
178 "display_name": "Anthropic",
179 "is_enabled": True,
180 },
181 # Disabled and seeded with no models. Groq serves open-weight models,
182 # which lag the proprietary providers on the tool calling and structured
183 # output the agent graph depends on; the three Llama/Mixtral models a
184 # migration once seeded under it were never supported and are dropped by
185 # migration 17. OpenAI and Anthropic are the two supported providers.
186 {
187 "id": "a0000000-0000-0000-0000-000000000003",
188 "name": ModelEnum.Provider.groq,
189 "display_name": "Groq",
190 "is_enabled": False,
191 },
192 {
193 "id": "a0000000-0000-0000-0000-000000000004",
194 "name": ModelEnum.Provider.google,
195 "display_name": "Google",
196 "is_enabled": False,
197 },
198 {
199 "id": "a0000000-0000-0000-0000-000000000005",
200 "name": ModelEnum.Provider.mistral,
201 "display_name": "Mistral",
202 "is_enabled": False,
203 },
204 {
205 "id": "a0000000-0000-0000-0000-000000000006",
206 "name": ModelEnum.Provider.cohere,
207 "display_name": "Cohere",
208 "is_enabled": False,
209 },
210 # Self-hosted / sovereign inference. Seeded with no models: "local" is not a
211 # LiteLLM route and Provider.base_url is not read by app/services/llm.py yet,
212 # so any model under this provider is unreachable at inference time.
213 {
214 "id": "a0000000-0000-0000-0000-000000000007",
215 "name": ModelEnum.Provider.local,
216 "display_name": settings.app_name,
217 "is_enabled": False,
218 },
219 # The catalogue's models are reached through Bedrock by their ``bedrock``
220 # route; the models only Bedrock serves (the open-weight stand-ins, Titan
221 # embeddings) are registered under it. Enabled exactly when the
222 # deployment's backend is Bedrock — the seeder sets it, and reads it on
223 # the next start to see whether the backend has changed.
224 #
225 # Named for the platform that runs them, not the cloud it runs on: the
226 # cloud is a sub-processor (docs/business/sub-processors.md), not
227 # something a person choosing a model needs to see. Each model's maker is
228 # named on its own (fe-core ``objects/modelOrigin.ts``).
229 {
230 "id": _BEDROCK,
231 "name": ModelEnum.Provider.bedrock,
232 "display_name": SERVING_PLATFORM,
233 "is_enabled": False,
234 },
235]
237BUILTIN_PROVIDERS: BuiltinRegistry[ProviderSeed] = BuiltinRegistry(
238 _BUILTIN_PROVIDERS, key=lambda p: p["name"]
239)
242# ---------------------------------------------------------------------------
243# Models — stable UUIDs so the seeder can target rows precisely
244#
245# OpenAI and Anthropic are the two vendors whose own APIs are seeded; every
246# model Bedrock alone serves (the other makers, Titan) is registered under
247# the bedrock provider, its maker named by its id. Each lineup is listed
248# strongest first, followed by the previous generation.
249#
250# input_cost_per_token / output_cost_per_token are USD per token.
251# context_window, max_output_tokens, knowledge_cutoff and pricing come from
252# the providers' own model pages:
253# https://platform.claude.com/docs/en/models/overview
254# https://developers.openai.com/api/docs/models/all
255# Verified 19 Sep 2026 — re-check on a lineup change rather than assuming
256# these still hold.
257#
258# The cache and long-context rates come from the providers' pricing pages
259# (verified 4 Oct 2026):
260# https://platform.claude.com/docs/en/about-claude/pricing
261# https://developers.openai.com/api/docs/pricing
262# They are per model, not a rule: Anthropic cache reads are 0.1× input except
263# Fable 5.1 (0.025×); 5-minute writes 1.25× and 1-hour writes 2×. OpenAI's
264# GPT-5.6 and GPT-6 read at 0.1× and write at 1.25×, and past 272K prompt
265# tokens reprice the whole request at 2× input / 1.5× output; GPT-4o reads at
266# 0.5× and has no cache-write charge (writes bill as ordinary input). Claude
267# 4.6 and later bill the full 1M window at standard rates.
268#
269# effort pairs the two catalogues: a model's tier is the band it occupies in
270# its own lineup, so Haiku ↔ Luna, Sonnet ↔ Terra, Opus ↔ Sol and Fable ↔
271# Astra are each one row of a table a user can filter.
272#
273# latency is Anthropic's published comparative band. OpenAI publishes no
274# equivalent, so an OpenAI model takes the band of the tier it shares — which
275# is what "comparative" means here: a position in this catalogue, not a
276# measured figure.
277# ---------------------------------------------------------------------------
279#: Where the Bedrock routes' London prices come from. GPT-5.6 and GPT-6 have
280#: no route yet: from the EU they are reachable only through Global routing,
281#: and AWS documents their tool calling through the Responses API, not the
282#: Converse API this service uses — a live check comes first
283#: (``docs/system/deployment/bedrock-migration.md``). GPT-4o and GPT-4o Mini
284#: are not on Bedrock.
285_LONDON_PRICES = (
286 "AWS Price List API eu-west-2 (2026-10-07) and the Bedrock model card, "
287 "checked 2026-10-08."
288)
290#: Where the other makers' London prices come from (DeepSeek, Moonshot,
291#: Mistral, Amazon Nova). The Bedrock pricing page lists no London
292#: price for several of them; the Price List file lists all of them.
293_LONDON_PRICES_OCT30 = (
294 "AWS Price List API eu-west-2 (published 2026-10-30) and the Bedrock "
295 "model card, checked 2026-10-30."
296)
298#: Where NVIDIA's London prices come from. The Price List holds no cache
299#: rates for Nemotron.
300_NVIDIA_PRICES = (
301 "AWS Price List API eu-west-2 (published 2026-10-30) and the Bedrock "
302 "model card, checked 2026-10-31."
303)
305_BUILTIN_MODELS: list[ModelSeed] = [
306 # ── OpenAI ───────────────────────────────────────────────────────────────
307 {
308 "id": "b0000000-0000-0000-0000-000000000011",
309 "provider_id": _OPENAI,
310 "model_name": "gpt-6-astra",
311 "display_name": "GPT-6 Astra",
312 "description": (
313 "OpenAI's most capable model, built for the hardest end-to-end work."
314 ),
315 "is_chat": True,
316 "is_embedding": False,
317 "is_vision": True,
318 "is_default": False,
319 "is_recommended": False,
320 "context_window": 1_050_000,
321 "max_output_tokens": 128_000,
322 "input_cost_per_token": "0.0000100000",
323 "output_cost_per_token": "0.0000500000",
324 "cache_read_cost_per_token": "0.0000010000",
325 "cache_write_cost_per_token": "0.0000125000",
326 "cache_write_1h_cost_per_token": None,
327 "long_context_threshold": 272_000,
328 "long_context_input_multiplier": "2.000",
329 "long_context_output_multiplier": "1.500",
330 "data_region": DataRegion.us,
331 "effort": Effort.frontier,
332 "latency": Latency.slower,
333 "knowledge_cutoff": date(2026, 4, 30),
334 },
335 {
336 "id": "b0000000-0000-0000-0000-000000000012",
337 "provider_id": _OPENAI,
338 "model_name": "gpt-5.6-sol",
339 "display_name": "GPT-5.6 Sol",
340 "description": "Flagship model for complex professional work.",
341 "is_chat": True,
342 "is_embedding": False,
343 "is_vision": True,
344 "is_default": False,
345 "is_recommended": False,
346 "context_window": 1_050_000,
347 "max_output_tokens": 128_000,
348 "input_cost_per_token": "0.0000040000",
349 "output_cost_per_token": "0.0000200000",
350 "cache_read_cost_per_token": "0.0000004000",
351 "cache_write_cost_per_token": "0.0000050000",
352 "cache_write_1h_cost_per_token": None,
353 "long_context_threshold": 272_000,
354 "long_context_input_multiplier": "2.000",
355 "long_context_output_multiplier": "1.500",
356 "data_region": DataRegion.us,
357 "effort": Effort.deep,
358 "latency": Latency.moderate,
359 "knowledge_cutoff": date(2026, 2, 16),
360 },
361 {
362 "id": "b0000000-0000-0000-0000-000000000013",
363 "provider_id": _OPENAI,
364 "model_name": "gpt-5.6-terra",
365 "display_name": "GPT-5.6 Terra",
366 "description": "Balances intelligence and cost.",
367 "is_chat": True,
368 "is_embedding": False,
369 "is_vision": True,
370 "is_default": False,
371 "is_recommended": False,
372 "context_window": 1_050_000,
373 "max_output_tokens": 128_000,
374 "input_cost_per_token": "0.0000020000",
375 "output_cost_per_token": "0.0000120000",
376 "cache_read_cost_per_token": "0.0000002000",
377 "cache_write_cost_per_token": "0.0000025000",
378 "cache_write_1h_cost_per_token": None,
379 "long_context_threshold": 272_000,
380 "long_context_input_multiplier": "2.000",
381 "long_context_output_multiplier": "1.500",
382 "data_region": DataRegion.us,
383 "effort": Effort.balanced,
384 "latency": Latency.fast,
385 "knowledge_cutoff": date(2026, 2, 16),
386 },
387 {
388 "id": "b0000000-0000-0000-0000-000000000014",
389 "provider_id": _OPENAI,
390 "model_name": "gpt-5.6-luna",
391 "display_name": "GPT-5.6 Luna",
392 "description": "Optimised for cost-sensitive workloads.",
393 "is_chat": True,
394 "is_embedding": False,
395 "is_vision": True,
396 # The platform default (migration 18). Stated here too so a *fresh*
397 # database gets it: migrations run before the seeder, so migration 18
398 # updates a row that does not exist yet on a first boot.
399 "is_default": True,
400 "is_recommended": False,
401 "context_window": 1_050_000,
402 "max_output_tokens": 128_000,
403 "input_cost_per_token": "0.0000002000",
404 "output_cost_per_token": "0.0000012000",
405 "cache_read_cost_per_token": "0.0000000200",
406 "cache_write_cost_per_token": "0.0000002500",
407 "cache_write_1h_cost_per_token": None,
408 "long_context_threshold": 272_000,
409 "long_context_input_multiplier": "2.000",
410 "long_context_output_multiplier": "1.500",
411 "data_region": DataRegion.us,
412 "effort": Effort.light,
413 "latency": Latency.fastest,
414 "knowledge_cutoff": date(2026, 2, 16),
415 },
416 # Previous generation. Kept because agents, conversations and evaluation
417 # runs already point at them by id, and a comparison against the model a
418 # result was produced on is the point of the version trail.
419 {
420 "id": "b0000000-0000-0000-0000-000000000001",
421 "provider_id": _OPENAI,
422 "model_name": "gpt-4o",
423 "display_name": "GPT-4o",
424 "description": "Previous-generation flagship. Superseded by GPT-5.6 Terra.",
425 "is_chat": True,
426 "is_embedding": False,
427 "is_vision": True,
428 "is_default": False,
429 "is_recommended": False,
430 "context_window": 128_000,
431 "max_output_tokens": 16_384,
432 "input_cost_per_token": "0.0000025000",
433 "output_cost_per_token": "0.0000100000",
434 "cache_read_cost_per_token": "0.0000012500",
435 "cache_write_cost_per_token": "0.0000025000",
436 "cache_write_1h_cost_per_token": None,
437 "long_context_threshold": None,
438 "long_context_input_multiplier": None,
439 "long_context_output_multiplier": None,
440 "data_region": DataRegion.us,
441 "effort": Effort.balanced,
442 "latency": Latency.fast,
443 "knowledge_cutoff": date(2023, 10, 1),
444 },
445 {
446 "id": "b0000000-0000-0000-0000-000000000002",
447 "provider_id": _OPENAI,
448 "model_name": "gpt-4o-mini",
449 "display_name": "GPT-4o Mini",
450 "description": "Previous-generation small model. Superseded by GPT-5.6 Luna.",
451 "is_chat": True,
452 "is_embedding": False,
453 "is_vision": True,
454 "is_default": False,
455 "is_recommended": False,
456 "context_window": 128_000,
457 "max_output_tokens": 16_384,
458 "input_cost_per_token": "0.0000001500",
459 "output_cost_per_token": "0.0000006000",
460 "cache_read_cost_per_token": "0.0000000750",
461 "cache_write_cost_per_token": "0.0000001500",
462 "cache_write_1h_cost_per_token": None,
463 "long_context_threshold": None,
464 "long_context_input_multiplier": None,
465 "long_context_output_multiplier": None,
466 "data_region": DataRegion.us,
467 "effort": Effort.light,
468 "latency": Latency.fastest,
469 "knowledge_cutoff": date(2023, 10, 1),
470 },
471 # ── Anthropic ────────────────────────────────────────────────────────────
472 {
473 "id": "b0000000-0000-0000-0000-000000000015",
474 "provider_id": _ANTHROPIC,
475 "model_name": "claude-fable-5-1",
476 "display_name": "Claude Fable 5.1",
477 "description": "For demanding reasoning and long-horizon agentic work.",
478 "is_chat": True,
479 "is_embedding": False,
480 "is_vision": True,
481 "is_default": False,
482 "is_recommended": False,
483 "context_window": 1_000_000,
484 "max_output_tokens": 128_000,
485 "input_cost_per_token": "0.0000100000",
486 "output_cost_per_token": "0.0000500000",
487 "cache_read_cost_per_token": "0.0000002500",
488 "cache_write_cost_per_token": "0.0000125000",
489 "cache_write_1h_cost_per_token": "0.0000200000",
490 "long_context_threshold": None,
491 "long_context_input_multiplier": None,
492 "long_context_output_multiplier": None,
493 "data_region": DataRegion.us,
494 "effort": Effort.frontier,
495 "latency": Latency.slower,
496 "knowledge_cutoff": date(2026, 6, 1),
497 # No Bedrock route, by decision (8 October 2026). Bedrock serves Claude
498 # Fable 5 and 5.1 only once the account opts in to the `aws_review`
499 # data-retention mode: AWS then keeps every prompt and answer for up
500 # to 30 days, may review them, and stores them where the Global
501 # profile processed them (Bedrock user guide, "Data retention" and
502 # "Abuse detection", checked that day). Every route the hosted platform
503 # takes is zero-retention in the UK or EU, and
504 # tests/services/test_inference_routes.py keeps it so. The route was
505 # global.anthropic.claude-fable-5-1, at the list price.
506 },
507 {
508 "id": "b0000000-0000-0000-0000-000000000016",
509 "provider_id": _ANTHROPIC,
510 "model_name": "claude-opus-5",
511 "display_name": "Claude Opus 5",
512 "description": "For complex agentic coding and enterprise work.",
513 "is_chat": True,
514 "is_embedding": False,
515 "is_vision": True,
516 "is_default": False,
517 "is_recommended": False,
518 "context_window": 1_000_000,
519 "max_output_tokens": 128_000,
520 "input_cost_per_token": "0.0000050000",
521 "output_cost_per_token": "0.0000250000",
522 "cache_read_cost_per_token": "0.0000005000",
523 "cache_write_cost_per_token": "0.0000062500",
524 "cache_write_1h_cost_per_token": "0.0000100000",
525 "long_context_threshold": None,
526 "long_context_input_multiplier": None,
527 "long_context_output_multiplier": None,
528 "data_region": DataRegion.us,
529 "effort": Effort.deep,
530 "latency": Latency.moderate,
531 "knowledge_cutoff": date(2026, 5, 1),
532 "bedrock": {
533 "model_id": "eu.anthropic.claude-opus-5",
534 "data_region": DataRegion.eu,
535 "input_cost_per_token": "0.0000055000",
536 "output_cost_per_token": "0.0000275000",
537 "cache_read_cost_per_token": "0.0000005500",
538 "cache_write_cost_per_token": "0.0000068750",
539 "cache_write_1h_cost_per_token": "0.0000110000",
540 "native_structured_output": False,
541 "forced_tool_choice": False,
542 "strict_tools": False,
543 "context_window": None,
544 "max_output_tokens": None,
545 "source": _LONDON_PRICES + " EU profile: not in-region in London.",
546 },
547 },
548 {
549 "id": "b0000000-0000-0000-0000-000000000017",
550 "provider_id": _ANTHROPIC,
551 "model_name": "claude-sonnet-5",
552 "display_name": "Claude Sonnet 5",
553 "description": "The best combination of speed and intelligence.",
554 "is_chat": True,
555 "is_embedding": False,
556 "is_vision": True,
557 "is_default": False,
558 # The recommended model for new agents and conversations, for the
559 # same reason as gpt-5.6-luna above.
560 "is_recommended": True,
561 "context_window": 1_000_000,
562 "max_output_tokens": 128_000,
563 "input_cost_per_token": "0.0000020000",
564 "output_cost_per_token": "0.0000100000",
565 "cache_read_cost_per_token": "0.0000002000",
566 "cache_write_cost_per_token": "0.0000025000",
567 "cache_write_1h_cost_per_token": "0.0000040000",
568 "long_context_threshold": None,
569 "long_context_input_multiplier": None,
570 "long_context_output_multiplier": None,
571 "data_region": DataRegion.us,
572 "effort": Effort.balanced,
573 "latency": Latency.fast,
574 "knowledge_cutoff": date(2026, 1, 1),
575 "bedrock": {
576 "model_id": "anthropic.claude-sonnet-5",
577 "data_region": DataRegion.uk,
578 "input_cost_per_token": "0.0000022000",
579 "output_cost_per_token": "0.0000110000",
580 "cache_read_cost_per_token": "0.0000002200",
581 "cache_write_cost_per_token": "0.0000027500",
582 "cache_write_1h_cost_per_token": "0.0000044000",
583 "native_structured_output": False,
584 "forced_tool_choice": False,
585 "strict_tools": False,
586 "context_window": None,
587 "max_output_tokens": None,
588 "source": _LONDON_PRICES + " In-region London.",
589 },
590 },
591 {
592 "id": "b0000000-0000-0000-0000-000000000005",
593 "provider_id": _ANTHROPIC,
594 "model_name": "claude-haiku-4-5-20251001",
595 "display_name": "Claude Haiku 4.5",
596 "description": "The fastest model with near-frontier intelligence.",
597 "is_chat": True,
598 "is_embedding": False,
599 "is_vision": True,
600 "is_default": False,
601 "is_recommended": False,
602 "context_window": 200_000,
603 "max_output_tokens": 64_000,
604 "input_cost_per_token": "0.0000010000",
605 "output_cost_per_token": "0.0000050000",
606 "cache_read_cost_per_token": "0.0000001000",
607 "cache_write_cost_per_token": "0.0000012500",
608 "cache_write_1h_cost_per_token": "0.0000020000",
609 "long_context_threshold": None,
610 "long_context_input_multiplier": None,
611 "long_context_output_multiplier": None,
612 "data_region": DataRegion.us,
613 "effort": Effort.light,
614 "latency": Latency.fastest,
615 "knowledge_cutoff": date(2025, 2, 1),
616 "bedrock": {
617 "model_id": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
618 "data_region": DataRegion.eu,
619 "input_cost_per_token": "0.0000011000",
620 "output_cost_per_token": "0.0000055000",
621 "cache_read_cost_per_token": "0.0000001100",
622 "cache_write_cost_per_token": "0.0000013750",
623 "cache_write_1h_cost_per_token": "0.0000022000",
624 "native_structured_output": True,
625 "forced_tool_choice": True,
626 # Bedrock lists strict tools for it, but the structured probe
627 # has not measured it (no Anthropic access, 20 October 2026).
628 "strict_tools": False,
629 "context_window": None,
630 "max_output_tokens": None,
631 "source": _LONDON_PRICES
632 + " EU profile: the bare id is not on-demand on bedrock-runtime. Bedrock lists Haiku 4.5's end of life as no sooner than 16 October 2026.",
633 },
634 },
635 # Previous generation — kept for the same reason as the GPT-4o entries.
636 {
637 "id": "b0000000-0000-0000-0000-000000000003",
638 "provider_id": _ANTHROPIC,
639 "model_name": "claude-opus-4-6",
640 "display_name": "Claude Opus 4.6",
641 "description": "Previous-generation Opus. Superseded by Claude Opus 5.",
642 "is_chat": True,
643 "is_embedding": False,
644 "is_vision": True,
645 "is_default": False,
646 "is_recommended": False,
647 "context_window": 1_000_000,
648 "max_output_tokens": 128_000,
649 "input_cost_per_token": "0.0000050000",
650 "output_cost_per_token": "0.0000250000",
651 "cache_read_cost_per_token": "0.0000005000",
652 "cache_write_cost_per_token": "0.0000062500",
653 "cache_write_1h_cost_per_token": "0.0000100000",
654 "long_context_threshold": None,
655 "long_context_input_multiplier": None,
656 "long_context_output_multiplier": None,
657 "data_region": DataRegion.us,
658 "effort": Effort.deep,
659 "latency": Latency.moderate,
660 "knowledge_cutoff": date(2025, 5, 1),
661 "bedrock": {
662 "model_id": "anthropic.claude-opus-4-6-v1",
663 "data_region": DataRegion.uk,
664 "input_cost_per_token": "0.0000055000",
665 "output_cost_per_token": "0.0000275000",
666 "cache_read_cost_per_token": "0.0000005500",
667 "cache_write_cost_per_token": "0.0000068750",
668 "cache_write_1h_cost_per_token": "0.0000110000",
669 "native_structured_output": True,
670 "forced_tool_choice": True,
671 # Bedrock lists strict tools for it, but the structured probe
672 # has not measured it (no Anthropic access, 20 October 2026).
673 "strict_tools": False,
674 "context_window": None,
675 "max_output_tokens": None,
676 "source": _LONDON_PRICES + " In-region London.",
677 },
678 },
679 {
680 "id": "b0000000-0000-0000-0000-000000000004",
681 "provider_id": _ANTHROPIC,
682 "model_name": "claude-sonnet-4-6",
683 "display_name": "Claude Sonnet 4.6",
684 "description": "Previous-generation Sonnet. Superseded by Claude Sonnet 5.",
685 "is_chat": True,
686 "is_embedding": False,
687 "is_vision": True,
688 "is_default": False,
689 "is_recommended": False,
690 "context_window": 1_000_000,
691 "max_output_tokens": 128_000,
692 "input_cost_per_token": "0.0000030000",
693 "output_cost_per_token": "0.0000150000",
694 "cache_read_cost_per_token": "0.0000003000",
695 "cache_write_cost_per_token": "0.0000037500",
696 "cache_write_1h_cost_per_token": "0.0000060000",
697 "long_context_threshold": None,
698 "long_context_input_multiplier": None,
699 "long_context_output_multiplier": None,
700 "data_region": DataRegion.us,
701 "effort": Effort.balanced,
702 "latency": Latency.fast,
703 "knowledge_cutoff": date(2025, 8, 1),
704 "bedrock": {
705 "model_id": "anthropic.claude-sonnet-4-6",
706 "data_region": DataRegion.uk,
707 "input_cost_per_token": "0.0000033000",
708 "output_cost_per_token": "0.0000165000",
709 "cache_read_cost_per_token": "0.0000003300",
710 "cache_write_cost_per_token": "0.0000041250",
711 "cache_write_1h_cost_per_token": "0.0000066000",
712 "native_structured_output": True,
713 "forced_tool_choice": True,
714 # Bedrock lists strict tools for it, but the structured probe
715 # has not measured it (no Anthropic access, 20 October 2026).
716 "strict_tools": False,
717 "context_window": None,
718 "max_output_tokens": 64_000,
719 "source": _LONDON_PRICES
720 + " In-region London. Bedrock caps output at 64K (Anthropic's API: 128K).",
721 },
722 },
723 {
724 "id": "b0000000-0000-0000-0000-000000000018",
725 "provider_id": _ANTHROPIC,
726 "model_name": "claude-haiku-5-5",
727 "display_name": "Claude Haiku 5.5",
728 "description": "Anthropic's fastest, lowest-cost model.",
729 "is_chat": True,
730 "is_embedding": False,
731 "is_vision": True,
732 "is_default": False,
733 "is_recommended": False,
734 "context_window": 1_000_000,
735 "max_output_tokens": 128_000,
736 # Anthropic's list price — Bedrock's Global price equals it; the EU
737 # route below is 10% more.
738 "input_cost_per_token": "0.0000001000",
739 "output_cost_per_token": "0.0000005000",
740 "cache_read_cost_per_token": "0.0000000100",
741 "cache_write_cost_per_token": "0.0000001250",
742 "cache_write_1h_cost_per_token": "0.0000002000",
743 "long_context_threshold": 100_000,
744 "long_context_input_multiplier": "5.000",
745 "long_context_output_multiplier": "5.000",
746 "data_region": DataRegion.us,
747 "effort": Effort.light,
748 "latency": Latency.fastest,
749 # Anthropic's models overview (checked 2026-10-08): API id
750 # claude-haiku-5-5, reliable knowledge cutoff June 2026.
751 "knowledge_cutoff": date(2026, 6, 1),
752 "is_default_on_bedrock": True,
753 "bedrock": {
754 "model_id": "eu.anthropic.claude-haiku-5-5",
755 "data_region": DataRegion.eu,
756 "input_cost_per_token": "0.0000001100",
757 "output_cost_per_token": "0.0000005500",
758 "cache_read_cost_per_token": "0.0000000110",
759 "cache_write_cost_per_token": "0.0000001375",
760 "cache_write_1h_cost_per_token": "0.0000002200",
761 "native_structured_output": False,
762 "forced_tool_choice": False,
763 "strict_tools": False,
764 "context_window": None,
765 "max_output_tokens": None,
766 # Anthropic reprices a prompt over 100,000 tokens at five times
767 # the rates; whether Bedrock applies the same threshold is not
768 # stated. Kept, so the spending ceiling errs high.
769 "long_context_threshold": 100_000,
770 "long_context_input_multiplier": "5.000",
771 "long_context_output_multiplier": "5.000",
772 "source": _LONDON_PRICES
773 + " EU profile. Thinking is on by default and billed as output.",
774 },
775 },
776 # ── Open-weight models AWS runs in London ────────────────────────────────
777 # Served by Bedrock alone (no vendor API), billed by AWS rather than
778 # through AWS Marketplace, and available to any account without a use-case
779 # form, which is what makes them the stand-ins while an account lacks
780 # Anthropic access (BEDROCK_MODEL_ACCESS). In-region in London: no EU
781 # profile for them accepts calls from eu-west-2. Neither is on AWS's
782 # retention list. Researched 2026-10-08 (docs/system/deployment/bedrock-migration.md).
783 {
784 "id": "b0000000-0000-0000-0000-000000000019",
785 "provider_id": _OPENAI,
786 "model_name": "gpt-oss-120b",
787 "display_name": "gpt-oss-120b",
788 "description": (
789 "OpenAI's open-weight reasoning model, run by CHAIN-R in London. "
790 "Grades the platform benchmark when Claude is not available."
791 ),
792 "is_chat": True,
793 "is_embedding": False,
794 "is_vision": False,
795 "is_default": False,
796 "is_recommended": False,
797 "context_window": 128_000,
798 "max_output_tokens": 16_000,
799 # No vendor API serves it: the price is Bedrock's, in London.
800 "input_cost_per_token": "0.0000002300",
801 "output_cost_per_token": "0.0000009300",
802 "cache_read_cost_per_token": None,
803 "cache_write_cost_per_token": None,
804 "cache_write_1h_cost_per_token": None,
805 "long_context_threshold": None,
806 "long_context_input_multiplier": None,
807 "long_context_output_multiplier": None,
808 "data_region": DataRegion.uk,
809 "effort": Effort.light,
810 "latency": Latency.fast,
811 # OpenAI's model page (developers.openai.com), checked 2026-10-08.
812 "knowledge_cutoff": date(2024, 6, 1),
813 "direct": False,
814 "bedrock": {
815 "model_id": "openai.gpt-oss-120b-1:0",
816 "data_region": DataRegion.uk,
817 "input_cost_per_token": "0.0000002300",
818 "output_cost_per_token": "0.0000009300",
819 "cache_read_cost_per_token": None,
820 "cache_write_cost_per_token": None,
821 "cache_write_1h_cost_per_token": None,
822 "native_structured_output": True,
823 "forced_tool_choice": False,
824 "strict_tools": True,
825 "context_window": None,
826 "max_output_tokens": None,
827 "source": _LONDON_PRICES
828 + " In-region London. Streamed tool calls were reported garbled in"
829 " April 2026 (re:Post); the judge's calls are not streamed.",
830 },
831 },
832 {
833 "id": "b0000000-0000-0000-0000-000000000020",
834 "provider_id": _BEDROCK,
835 "model_name": "qwen.qwen3-235b-a22b-2507-v1:0",
836 "display_name": "Qwen3 235B",
837 "description": (
838 "Qwen's large open-weight model (2507 instruct), run by CHAIN-R in "
839 "London. The default while Claude is not available."
840 ),
841 "is_chat": True,
842 "is_embedding": False,
843 "is_vision": False,
844 "is_default": False,
845 "is_recommended": False,
846 "context_window": 256_000,
847 "max_output_tokens": 8_000,
848 "input_cost_per_token": "0.0000003400",
849 "output_cost_per_token": "0.0000013700",
850 "cache_read_cost_per_token": None,
851 "cache_write_cost_per_token": None,
852 "cache_write_1h_cost_per_token": None,
853 "long_context_threshold": None,
854 "long_context_input_multiplier": None,
855 "long_context_output_multiplier": None,
856 "data_region": DataRegion.uk,
857 "effort": Effort.light,
858 "latency": Latency.fast,
859 # Qwen publishes none (UNPUBLISHED_CUTOFFS).
860 "knowledge_cutoff": None,
861 "direct": False,
862 "is_fallback_default_on_bedrock": True,
863 "bedrock": {
864 "model_id": "qwen.qwen3-235b-a22b-2507-v1:0",
865 "data_region": DataRegion.uk,
866 "input_cost_per_token": "0.0000003400",
867 "output_cost_per_token": "0.0000013700",
868 "cache_read_cost_per_token": None,
869 "cache_write_cost_per_token": None,
870 "cache_write_1h_cost_per_token": None,
871 "native_structured_output": True,
872 "forced_tool_choice": False,
873 "strict_tools": True,
874 "context_window": None,
875 "max_output_tokens": None,
876 "source": _LONDON_PRICES
877 + " In-region London. Non-thinking. Streamed tool calls are not"
878 " documented: one ConverseStream call with tools confirms them.",
879 },
880 },
881 # ── The other makers AWS runs in London ──────────────────────────────────
882 # Each maker's strongest model AWS offers in-region in London, and a
883 # faster one where the maker has one worth choosing: DeepSeek, Moonshot,
884 # Mistral, Amazon and NVIDIA. Mistral Large 3 and Gemma 3 were withdrawn
885 # after the probe (WITHDRAWN_MODELS). Like the two above they are served by
886 # Bedrock alone, and none is on AWS's retention list (only OpenAI's
887 # non-open-weight models and Claude Fable are, checked 2026-10-30).
888 #
889 # Light, every one: the bands are cost-ordered across the catalogue, and
890 # the dearest of these (Nova Pro) is below the cheapest balanced model.
891 # Schemas are decoded natively where the card lists "Structured outputs"
892 # (not Nova), and tools held strict where the structured probe measured
893 # them (31 October 2026: DeepSeek, Kimi, Ministral, as gpt-oss and Qwen3
894 # on 20 October); no tool call is forced.
895 #
896 # Left out, and why (docs/system/deployment/bedrock-migration.md): Kimi
897 # K3 and Nova 2 Lite (Global or US routing only from London); every Meta
898 # model (Llama 3 has an 8K window and no tool calling, and no later Llama
899 # runs in London or the EU); Gemma 3 4B (no structured outputs); Gemma 4
900 # (not in London, no Converse API); Devstral 2 and the smaller Ministral
901 # 3 models (the user's choice, 30 October 2026); every xAI Grok model
902 # (Global routing only from London, 31 October 2026); Nemotron Nano 9B v2
903 # and 12B v2 VL (Legacy since 30 September 2026, closed to new customers).
904 #
905 # Each is unavailable until its maker is in BEDROCK_MODEL_ACCESS. Nova
906 # shares ``amazon`` with Titan embeddings.
907 {
908 "id": "b0000000-0000-0000-0000-000000000023",
909 "provider_id": _BEDROCK,
910 "model_name": "deepseek.v3.2",
911 "display_name": "DeepSeek V3.2",
912 "description": (
913 "DeepSeek's mixture-of-experts model for reasoning, coding and "
914 "instruction following, run by CHAIN-R in London."
915 ),
916 "is_chat": True,
917 "is_embedding": False,
918 "is_vision": False,
919 "is_default": False,
920 "is_recommended": False,
921 "context_window": 164_000,
922 "max_output_tokens": 8_000,
923 "input_cost_per_token": "0.0000009610",
924 "output_cost_per_token": "0.0000028675",
925 "cache_read_cost_per_token": None,
926 "cache_write_cost_per_token": None,
927 "cache_write_1h_cost_per_token": None,
928 "long_context_threshold": None,
929 "long_context_input_multiplier": None,
930 "long_context_output_multiplier": None,
931 "data_region": DataRegion.uk,
932 "effort": Effort.light,
933 "latency": Latency.fast,
934 # Bedrock's model card, checked 2026-10-30.
935 "knowledge_cutoff": date(2025, 3, 1),
936 "direct": False,
937 "bedrock": {
938 "model_id": "deepseek.v3.2",
939 "data_region": DataRegion.uk,
940 "input_cost_per_token": "0.0000009610",
941 "output_cost_per_token": "0.0000028675",
942 "cache_read_cost_per_token": None,
943 "cache_write_cost_per_token": None,
944 "cache_write_1h_cost_per_token": None,
945 "native_structured_output": True,
946 "forced_tool_choice": False,
947 "strict_tools": True,
948 "context_window": None,
949 "max_output_tokens": None,
950 "source": _LONDON_PRICES_OCT30
951 + " In-region London. End of life no sooner than 1 December 2026."
952 " Probed 31 October 2026: schemas and strict tool sets accepted,"
953 " no compile cost; writes its own tool-call marker into tool"
954 " turns, which the dsml reply format removes.",
955 },
956 },
957 {
958 "id": "b0000000-0000-0000-0000-000000000024",
959 "provider_id": _BEDROCK,
960 "model_name": "moonshotai.kimi-k2.5",
961 "display_name": "Kimi K2.5",
962 "description": (
963 "Moonshot AI's multimodal model for long tasks, coding and many "
964 "languages, run by CHAIN-R in London."
965 ),
966 "is_chat": True,
967 "is_embedding": False,
968 "is_vision": True,
969 "is_default": False,
970 "is_recommended": False,
971 "context_window": 256_000,
972 "max_output_tokens": 16_000,
973 "input_cost_per_token": "0.0000009300",
974 "output_cost_per_token": "0.0000046500",
975 "cache_read_cost_per_token": None,
976 "cache_write_cost_per_token": None,
977 "cache_write_1h_cost_per_token": None,
978 "long_context_threshold": None,
979 "long_context_input_multiplier": None,
980 "long_context_output_multiplier": None,
981 "data_region": DataRegion.uk,
982 "effort": Effort.light,
983 "latency": Latency.moderate,
984 # Moonshot publishes none (UNPUBLISHED_CUTOFFS).
985 "knowledge_cutoff": None,
986 "direct": False,
987 "bedrock": {
988 "model_id": "moonshotai.kimi-k2.5",
989 "data_region": DataRegion.uk,
990 "input_cost_per_token": "0.0000009300",
991 "output_cost_per_token": "0.0000046500",
992 "cache_read_cost_per_token": None,
993 "cache_write_cost_per_token": None,
994 "cache_write_1h_cost_per_token": None,
995 "native_structured_output": True,
996 "forced_tool_choice": False,
997 "strict_tools": True,
998 # Moonshot's card says it thinks by default, on Moonshot's own
999 # API. On Bedrock the reply probe (31 October 2026) saw no
1000 # reasoning at all, with or without reasoning_effort: tool calls
1001 # in 19-30 output tokens. So no reasons_before_answering.
1002 "context_window": None,
1003 "max_output_tokens": None,
1004 "source": _LONDON_PRICES_OCT30
1005 + " In-region London (Kimi K3 is Global or US only). End of life"
1006 " no sooner than 27 January 2027. Probed 31 October 2026: schemas"
1007 " and strict tool sets accepted, no compile cost; no reasoning"
1008 " returned; a reply schema with tools once ran to the probe's"
1009 " 1,024-token cap.",
1010 },
1011 },
1012 {
1013 "id": "b0000000-0000-0000-0000-000000000026",
1014 "provider_id": _BEDROCK,
1015 "model_name": "mistral.ministral-3-14b-instruct",
1016 "display_name": "Ministral 3 14B",
1017 "description": (
1018 "Mistral AI's fast small model with text and images, run by "
1019 "CHAIN-R in London."
1020 ),
1021 "is_chat": True,
1022 "is_embedding": False,
1023 "is_vision": True,
1024 "is_default": False,
1025 "is_recommended": False,
1026 "context_window": 128_000,
1027 "max_output_tokens": 8_000,
1028 "input_cost_per_token": "0.0000003100",
1029 "output_cost_per_token": "0.0000003100",
1030 "cache_read_cost_per_token": None,
1031 "cache_write_cost_per_token": None,
1032 "cache_write_1h_cost_per_token": None,
1033 "long_context_threshold": None,
1034 "long_context_input_multiplier": None,
1035 "long_context_output_multiplier": None,
1036 "data_region": DataRegion.uk,
1037 "effort": Effort.light,
1038 "latency": Latency.fastest,
1039 # Mistral publishes none (UNPUBLISHED_CUTOFFS).
1040 "knowledge_cutoff": None,
1041 "direct": False,
1042 "bedrock": {
1043 "model_id": "mistral.ministral-3-14b-instruct",
1044 "data_region": DataRegion.uk,
1045 "input_cost_per_token": "0.0000003100",
1046 "output_cost_per_token": "0.0000003100",
1047 "cache_read_cost_per_token": None,
1048 "cache_write_cost_per_token": None,
1049 "cache_write_1h_cost_per_token": None,
1050 "native_structured_output": True,
1051 "forced_tool_choice": False,
1052 "strict_tools": True,
1053 "context_window": None,
1054 "max_output_tokens": None,
1055 "source": _LONDON_PRICES_OCT30
1056 + " In-region London. End of life no sooner than 2 December 2026."
1057 " Probed 31 October 2026: schemas and strict tool sets accepted,"
1058 " no compile cost.",
1059 },
1060 },
1061 {
1062 "id": "b0000000-0000-0000-0000-000000000029",
1063 "provider_id": _BEDROCK,
1064 "model_name": "amazon.nova-pro-v1:0",
1065 "display_name": "Nova Pro",
1066 "description": (
1067 "Amazon's most capable Nova model for text, images and documents, "
1068 "run by CHAIN-R in London."
1069 ),
1070 "is_chat": True,
1071 "is_embedding": False,
1072 "is_vision": True,
1073 "is_default": False,
1074 "is_recommended": False,
1075 "context_window": 300_000,
1076 "max_output_tokens": 10_000,
1077 "input_cost_per_token": "0.0000011300",
1078 "output_cost_per_token": "0.0000045200",
1079 "cache_read_cost_per_token": None,
1080 "cache_write_cost_per_token": None,
1081 "cache_write_1h_cost_per_token": None,
1082 "long_context_threshold": None,
1083 "long_context_input_multiplier": None,
1084 "long_context_output_multiplier": None,
1085 "data_region": DataRegion.uk,
1086 "effort": Effort.light,
1087 "latency": Latency.fast,
1088 # Amazon publishes none (UNPUBLISHED_CUTOFFS).
1089 "knowledge_cutoff": None,
1090 "direct": False,
1091 "bedrock": {
1092 "model_id": "amazon.nova-pro-v1:0",
1093 "data_region": DataRegion.uk,
1094 "input_cost_per_token": "0.0000011300",
1095 "output_cost_per_token": "0.0000045200",
1096 "cache_read_cost_per_token": None,
1097 "cache_write_cost_per_token": None,
1098 "cache_write_1h_cost_per_token": None,
1099 # Nova decodes no schema natively: structured steps call a tool.
1100 # The probe (31 October 2026) found it refuses a reply schema and
1101 # strict tools, and takes a plain forced tool call.
1102 "native_structured_output": False,
1103 "forced_tool_choice": False,
1104 "strict_tools": False,
1105 "context_window": None,
1106 "max_output_tokens": None,
1107 "source": _LONDON_PRICES_OCT30
1108 + " In-region London (its EU profile takes no calls from London)."
1109 " Writes <thinking> into tool turns, which inline_tags removes.",
1110 },
1111 },
1112 {
1113 "id": "b0000000-0000-0000-0000-000000000030",
1114 "provider_id": _BEDROCK,
1115 "model_name": "amazon.nova-lite-v1:0",
1116 "display_name": "Nova Lite",
1117 "description": (
1118 "Amazon's low-cost Nova model for text, images and documents, run "
1119 "by CHAIN-R in London."
1120 ),
1121 "is_chat": True,
1122 "is_embedding": False,
1123 "is_vision": True,
1124 "is_default": False,
1125 "is_recommended": False,
1126 "context_window": 300_000,
1127 "max_output_tokens": 10_000,
1128 "input_cost_per_token": "0.0000000840",
1129 "output_cost_per_token": "0.0000003360",
1130 "cache_read_cost_per_token": None,
1131 "cache_write_cost_per_token": None,
1132 "cache_write_1h_cost_per_token": None,
1133 "long_context_threshold": None,
1134 "long_context_input_multiplier": None,
1135 "long_context_output_multiplier": None,
1136 "data_region": DataRegion.uk,
1137 "effort": Effort.light,
1138 "latency": Latency.fastest,
1139 # Amazon publishes none (UNPUBLISHED_CUTOFFS).
1140 "knowledge_cutoff": None,
1141 "direct": False,
1142 "bedrock": {
1143 "model_id": "amazon.nova-lite-v1:0",
1144 "data_region": DataRegion.uk,
1145 "input_cost_per_token": "0.0000000840",
1146 "output_cost_per_token": "0.0000003360",
1147 "cache_read_cost_per_token": None,
1148 "cache_write_cost_per_token": None,
1149 "cache_write_1h_cost_per_token": None,
1150 "native_structured_output": False,
1151 "forced_tool_choice": False,
1152 "strict_tools": False,
1153 "context_window": None,
1154 "max_output_tokens": None,
1155 "source": _LONDON_PRICES_OCT30
1156 + " In-region London (Nova 2 Lite is Global only from London).",
1157 },
1158 },
1159 {
1160 "id": "b0000000-0000-0000-0000-000000000031",
1161 "provider_id": _BEDROCK,
1162 "model_name": "amazon.nova-micro-v1:0",
1163 "display_name": "Nova Micro",
1164 "description": (
1165 "Amazon's fastest, lowest-cost Nova model, for text only, run by "
1166 "CHAIN-R in London."
1167 ),
1168 "is_chat": True,
1169 "is_embedding": False,
1170 "is_vision": False,
1171 "is_default": False,
1172 "is_recommended": False,
1173 "context_window": 128_000,
1174 "max_output_tokens": 10_000,
1175 "input_cost_per_token": "0.0000000490",
1176 "output_cost_per_token": "0.0000001960",
1177 "cache_read_cost_per_token": None,
1178 "cache_write_cost_per_token": None,
1179 "cache_write_1h_cost_per_token": None,
1180 "long_context_threshold": None,
1181 "long_context_input_multiplier": None,
1182 "long_context_output_multiplier": None,
1183 "data_region": DataRegion.uk,
1184 "effort": Effort.light,
1185 "latency": Latency.fastest,
1186 # Amazon publishes none (UNPUBLISHED_CUTOFFS).
1187 "knowledge_cutoff": None,
1188 "direct": False,
1189 "bedrock": {
1190 "model_id": "amazon.nova-micro-v1:0",
1191 "data_region": DataRegion.uk,
1192 "input_cost_per_token": "0.0000000490",
1193 "output_cost_per_token": "0.0000001960",
1194 "cache_read_cost_per_token": None,
1195 "cache_write_cost_per_token": None,
1196 "cache_write_1h_cost_per_token": None,
1197 "native_structured_output": False,
1198 "forced_tool_choice": False,
1199 "strict_tools": False,
1200 "context_window": None,
1201 "max_output_tokens": None,
1202 "source": _LONDON_PRICES_OCT30 + " In-region London.",
1203 },
1204 },
1205 {
1206 "id": "b0000000-0000-0000-0000-000000000032",
1207 "provider_id": _BEDROCK,
1208 "model_name": "nvidia.nemotron-super-3-120b",
1209 "display_name": "Nemotron 3 Super 120B",
1210 "description": (
1211 "NVIDIA's largest Nemotron 3 open model, for reasoning, coding and "
1212 "long tasks, run by CHAIN-R in London."
1213 ),
1214 "is_chat": True,
1215 "is_embedding": False,
1216 "is_vision": False,
1217 "is_default": False,
1218 "is_recommended": False,
1219 "context_window": 256_000,
1220 "max_output_tokens": 32_000,
1221 "input_cost_per_token": "0.0000002300",
1222 "output_cost_per_token": "0.0000010100",
1223 "cache_read_cost_per_token": None,
1224 "cache_write_cost_per_token": None,
1225 "cache_write_1h_cost_per_token": None,
1226 "long_context_threshold": None,
1227 "long_context_input_multiplier": None,
1228 "long_context_output_multiplier": None,
1229 "data_region": DataRegion.uk,
1230 "effort": Effort.light,
1231 "latency": Latency.fast,
1232 # NVIDIA's model card (Hugging Face): pretraining data to June 2025,
1233 # checked 2026-10-31.
1234 "knowledge_cutoff": date(2025, 6, 1),
1235 "direct": False,
1236 "bedrock": {
1237 "model_id": "nvidia.nemotron-super-3-120b",
1238 "data_region": DataRegion.uk,
1239 "input_cost_per_token": "0.0000002300",
1240 "output_cost_per_token": "0.0000010100",
1241 "cache_read_cost_per_token": None,
1242 "cache_write_cost_per_token": None,
1243 "cache_write_1h_cost_per_token": None,
1244 "native_structured_output": True,
1245 "forced_tool_choice": False,
1246 "strict_tools": False,
1247 "context_window": None,
1248 "max_output_tokens": None,
1249 "source": _NVIDIA_PRICES
1250 + " In-region London (Bedrock's NVIDIA page says a 1M window; the"
1251 " card and AWS's launch post say 256K, used here). End of life no"
1252 " sooner than 11 March 2027. NVIDIA serves it reasoning by default;"
1253 " how Bedrock returns that waits for the reply probe.",
1254 },
1255 },
1256 {
1257 "id": "b0000000-0000-0000-0000-000000000033",
1258 "provider_id": _BEDROCK,
1259 "model_name": "nvidia.nemotron-nano-3-30b",
1260 "display_name": "Nemotron Nano 3 30B",
1261 "description": (
1262 "NVIDIA's fast, low-cost Nemotron 3 open model, run by CHAIN-R in London."
1263 ),
1264 "is_chat": True,
1265 "is_embedding": False,
1266 "is_vision": False,
1267 "is_default": False,
1268 "is_recommended": False,
1269 "context_window": 256_000,
1270 "max_output_tokens": 8_000,
1271 "input_cost_per_token": "0.0000000900",
1272 "output_cost_per_token": "0.0000003700",
1273 "cache_read_cost_per_token": None,
1274 "cache_write_cost_per_token": None,
1275 "cache_write_1h_cost_per_token": None,
1276 "long_context_threshold": None,
1277 "long_context_input_multiplier": None,
1278 "long_context_output_multiplier": None,
1279 "data_region": DataRegion.uk,
1280 "effort": Effort.light,
1281 "latency": Latency.fastest,
1282 # NVIDIA's model card (Hugging Face): pretraining data to 25 June
1283 # 2025, checked 2026-10-31.
1284 "knowledge_cutoff": date(2025, 6, 1),
1285 "direct": False,
1286 "bedrock": {
1287 "model_id": "nvidia.nemotron-nano-3-30b",
1288 "data_region": DataRegion.uk,
1289 "input_cost_per_token": "0.0000000900",
1290 "output_cost_per_token": "0.0000003700",
1291 "cache_read_cost_per_token": None,
1292 "cache_write_cost_per_token": None,
1293 "cache_write_1h_cost_per_token": None,
1294 "native_structured_output": True,
1295 "forced_tool_choice": False,
1296 "strict_tools": False,
1297 "context_window": None,
1298 "max_output_tokens": None,
1299 "source": _NVIDIA_PRICES
1300 + " In-region London. End of life no sooner than 15 December 2026."
1301 " NVIDIA serves it reasoning by default; how Bedrock returns that"
1302 " waits for the reply probe.",
1303 },
1304 },
1305 # ── Embedding models ─────────────────────────────────────────────────────
1306 # One per inference backend (app.services.embeddings): knowledge is
1307 # indexed and searched with the deployment's, so knowledge text goes only
1308 # where its prompts already go. Seeded so each call is priced on the
1309 # catalogue's card and, on Bedrock, allowed by the invoke role. Neither
1310 # answers a prompt: they have no output price, effort or latency band,
1311 # and no picker offers them.
1312 {
1313 "id": "b0000000-0000-0000-0000-000000000021",
1314 "provider_id": _OPENAI,
1315 "model_name": "text-embedding-3-small",
1316 "display_name": "Text Embedding 3 Small",
1317 "description": (
1318 "OpenAI's small text embedding model. Indexes and searches "
1319 "knowledge on a deployment that calls the vendors' own APIs."
1320 ),
1321 "is_chat": False,
1322 "is_embedding": True,
1323 "is_vision": False,
1324 "is_default": False,
1325 "is_recommended": False,
1326 "context_window": 8_191,
1327 "max_output_tokens": None,
1328 # OpenAI's pricing page, checked 2026-10-09.
1329 "input_cost_per_token": "0.0000000200",
1330 "output_cost_per_token": "0.0000000000",
1331 "cache_read_cost_per_token": None,
1332 "cache_write_cost_per_token": None,
1333 "cache_write_1h_cost_per_token": None,
1334 "long_context_threshold": None,
1335 "long_context_input_multiplier": None,
1336 "long_context_output_multiplier": None,
1337 "data_region": DataRegion.us,
1338 "effort": None,
1339 "latency": None,
1340 "knowledge_cutoff": None,
1341 },
1342 {
1343 "id": "b0000000-0000-0000-0000-000000000022",
1344 "provider_id": _BEDROCK,
1345 "model_name": "amazon.titan-embed-text-v2:0",
1346 "display_name": "Titan Text Embeddings V2",
1347 "description": (
1348 "Amazon's text embedding model, run by CHAIN-R in London. "
1349 "Indexes and searches knowledge."
1350 ),
1351 "is_chat": False,
1352 "is_embedding": True,
1353 "is_vision": False,
1354 "is_default": False,
1355 "is_recommended": False,
1356 "context_window": 8_192,
1357 "max_output_tokens": None,
1358 "input_cost_per_token": "0.0000001000",
1359 "output_cost_per_token": "0.0000000000",
1360 "cache_read_cost_per_token": None,
1361 "cache_write_cost_per_token": None,
1362 "cache_write_1h_cost_per_token": None,
1363 "long_context_threshold": None,
1364 "long_context_input_multiplier": None,
1365 "long_context_output_multiplier": None,
1366 "data_region": DataRegion.uk,
1367 "effort": None,
1368 "latency": None,
1369 "knowledge_cutoff": None,
1370 "direct": False,
1371 "bedrock": {
1372 "model_id": "amazon.titan-embed-text-v2:0",
1373 "data_region": DataRegion.uk,
1374 "input_cost_per_token": "0.0000001000",
1375 "output_cost_per_token": "0.0000000000",
1376 "cache_read_cost_per_token": None,
1377 "cache_write_cost_per_token": None,
1378 "cache_write_1h_cost_per_token": None,
1379 "native_structured_output": False,
1380 "context_window": None,
1381 "max_output_tokens": None,
1382 # The on-demand rate; batch jobs are half, and unused.
1383 "source": (
1384 "AWS Price List API eu-west-2 (published 2026-10-06, "
1385 "EUW2-TitanEmbeddingV2-Text-input-tokens), checked "
1386 "2026-10-09, and the Bedrock pricing page for Europe "
1387 "(London) the same day: $0.10 per 1M input tokens. "
1388 "In-region only: Titan has no EU or Global profile."
1389 ),
1390 },
1391 },
1392]
1394#: Built-in models taken out of the catalogue, and why. Their rows are
1395#: archived on every start (seeder ``_archive_withdrawn``), never deleted:
1396#: archived, nothing can run them, and every catalogue read leaves them out,
1397#: while anything that names one keeps its link. A row left behind would
1398#: otherwise stay resolvable: a model registered under ``bedrock`` needs only
1399#: its maker's access. An id here is never reused.
1400WITHDRAWN_MODELS: dict[str, str] = {
1401 "b0000000-0000-0000-0000-000000000025": (
1402 "Mistral Large 3: Bedrock refused every call from London with a "
1403 "ValidationException (structured probe, 31 October 2026), though its "
1404 "card lists London; the region table does not."
1405 ),
1406 "b0000000-0000-0000-0000-000000000027": (
1407 "Gemma 3 27B: never called a tool through Converse, not even when "
1408 "forced (structured probe, 31 October 2026); its card lists tool "
1409 "calling only on the other endpoint."
1410 ),
1411 "b0000000-0000-0000-0000-000000000028": (
1412 "Gemma 3 12B: never called a tool through Converse, not even when "
1413 "forced (structured probe, 31 October 2026)."
1414 ),
1415}
1417#: Built-in models whose maker publishes no knowledge cutoff, and why. Their
1418#: rows say none rather than carry a guessed date.
1419UNPUBLISHED_CUTOFFS: dict[str, str] = {
1420 "qwen.qwen3-235b-a22b-2507-v1:0": (
1421 "Neither Qwen's model card nor Bedrock's states one (checked 2026-10-08)."
1422 ),
1423 "moonshotai.kimi-k2.5": (
1424 "Neither Moonshot's model card nor Bedrock's states one (checked 2026-10-30)."
1425 ),
1426 "mistral.ministral-3-14b-instruct": (
1427 "Neither Mistral's models page nor Bedrock's card states one (checked "
1428 "2026-10-30)."
1429 ),
1430 "amazon.nova-pro-v1:0": (
1431 "Neither the Nova user guide nor Bedrock's card states one (checked "
1432 "2026-10-30)."
1433 ),
1434 "amazon.nova-lite-v1:0": (
1435 "Neither the Nova user guide nor Bedrock's card states one (checked "
1436 "2026-10-30)."
1437 ),
1438 "amazon.nova-micro-v1:0": (
1439 "Neither the Nova user guide nor Bedrock's card states one (checked "
1440 "2026-10-30)."
1441 ),
1442}
1444BUILTIN_MODELS: BuiltinRegistry[ModelSeed] = BuiltinRegistry(
1445 _BUILTIN_MODELS, key=lambda m: m["id"]
1446)