mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: generate the known-models catalog and aigateway prices (#27146)
- Regenerates `prices.json` from models.dev. The seeder only upserts, so existing deployments keep delisted models. - Generate the frontend known-models catalog instead of hand-writing it. `make gen/aibridge-prices` fetches models.dev once - Moved patches to model definitions to separate `overrides.jq` which handles both `claude-sonnet-4-5` 200k context and 'aliasing' Fable 5 as Mythos 5. - Editorial choices of selection, order, aliases, and reasoning defaults live in `curation.json`. - Adds golden join tests with one error case per validation, a no-network drift test comparing curation to the checked-in artifact, and pinned invariants for the Anthropic thinking-mode split (the wrong side returns HTTP 400) and the sonnet-4-5 context pin. Adding a model is now one `curation.json` entry plus `make gen/aibridge-prices`, assuming it is present on models.dev. > This PR was authored by Coder Agents on Cian's behalf. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
4d884c30e7
commit
8eaf4f507b
@@ -3,3 +3,11 @@
|
||||
`prices.json` in this directory is generated by `make gen/aibridge-prices` and
|
||||
embedded into the Coder binary at build time. Do not edit it manually; the
|
||||
next regeneration will overwrite any changes.
|
||||
|
||||
The Make target fetches models.dev once into `_gen/models-dev.json`, applying
|
||||
the upstream corrections in `scripts/aibridgepricesgen/overrides.jq`. Both
|
||||
`prices.json` and the frontend known-models catalog at
|
||||
`site/src/pages/AgentsPage/components/ChatModelAdminPanel/knownModels/knownModelsGenerated.json`
|
||||
are generated from that single patched snapshot; the catalog is additionally
|
||||
joined with the editorial curation in
|
||||
`scripts/aibridgepricesgen/curation.json`.
|
||||
|
||||
@@ -1,67 +1,11 @@
|
||||
[
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-5-haiku-20241022",
|
||||
"input_price": 800000,
|
||||
"output_price": 4000000,
|
||||
"cache_read_price": 80000,
|
||||
"cache_write_price": 1000000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-5-haiku-latest",
|
||||
"input_price": 800000,
|
||||
"output_price": 4000000,
|
||||
"cache_read_price": 80000,
|
||||
"cache_write_price": 1000000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-5-sonnet-20240620",
|
||||
"input_price": 3000000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 3750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-5-sonnet-20241022",
|
||||
"input_price": 3000000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 3750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-7-sonnet-20250219",
|
||||
"input_price": 3000000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 3750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"input_price": 250000,
|
||||
"output_price": 1250000,
|
||||
"cache_read_price": 30000,
|
||||
"cache_write_price": 300000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-opus-20240229",
|
||||
"input_price": 15000000,
|
||||
"output_price": 75000000,
|
||||
"cache_read_price": 1500000,
|
||||
"cache_write_price": 18750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-3-sonnet-20240229",
|
||||
"input_price": 3000000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 300000
|
||||
"model": "claude-fable-5",
|
||||
"input_price": 10000000,
|
||||
"output_price": 50000000,
|
||||
"cache_read_price": 1000000,
|
||||
"cache_write_price": 12500000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
@@ -81,11 +25,11 @@
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-opus-4-0",
|
||||
"input_price": 15000000,
|
||||
"output_price": 75000000,
|
||||
"cache_read_price": 1500000,
|
||||
"cache_write_price": 18750000
|
||||
"model": "claude-mythos-5",
|
||||
"input_price": 10000000,
|
||||
"output_price": 50000000,
|
||||
"cache_read_price": 1000000,
|
||||
"cache_write_price": 12500000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
@@ -103,14 +47,6 @@
|
||||
"cache_read_price": 1500000,
|
||||
"cache_write_price": 18750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-opus-4-20250514",
|
||||
"input_price": 15000000,
|
||||
"output_price": 75000000,
|
||||
"cache_read_price": 1500000,
|
||||
"cache_write_price": 18750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-opus-4-5",
|
||||
@@ -145,19 +81,11 @@
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-sonnet-4-0",
|
||||
"input_price": 3000000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 3750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-sonnet-4-20250514",
|
||||
"input_price": 3000000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 3750000
|
||||
"model": "claude-opus-4-8",
|
||||
"input_price": 5000000,
|
||||
"output_price": 25000000,
|
||||
"cache_read_price": 500000,
|
||||
"cache_write_price": 6250000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
@@ -183,12 +111,20 @@
|
||||
"cache_read_price": 300000,
|
||||
"cache_write_price": 3750000
|
||||
},
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-sonnet-5",
|
||||
"input_price": 2000000,
|
||||
"output_price": 10000000,
|
||||
"cache_read_price": 200000,
|
||||
"cache_write_price": 2500000
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "gpt-3.5-turbo",
|
||||
"input_price": 500000,
|
||||
"output_price": 1500000,
|
||||
"cache_read_price": 1250000,
|
||||
"cache_read_price": 0,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
@@ -228,7 +164,7 @@
|
||||
"model": "gpt-4.1-nano",
|
||||
"input_price": 100000,
|
||||
"output_price": 400000,
|
||||
"cache_read_price": 30000,
|
||||
"cache_read_price": 25000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
@@ -268,7 +204,7 @@
|
||||
"model": "gpt-4o-mini",
|
||||
"input_price": 150000,
|
||||
"output_price": 600000,
|
||||
"cache_read_price": 80000,
|
||||
"cache_read_price": 75000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
@@ -284,7 +220,7 @@
|
||||
"model": "gpt-5-chat-latest",
|
||||
"input_price": 1250000,
|
||||
"output_price": 10000000,
|
||||
"cache_read_price": null,
|
||||
"cache_read_price": 125000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
@@ -324,7 +260,7 @@
|
||||
"model": "gpt-5.1",
|
||||
"input_price": 1250000,
|
||||
"output_price": 10000000,
|
||||
"cache_read_price": 130000,
|
||||
"cache_read_price": 125000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
@@ -463,6 +399,46 @@
|
||||
"cache_read_price": null,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "gpt-5.6",
|
||||
"input_price": 5000000,
|
||||
"output_price": 30000000,
|
||||
"cache_read_price": 500000,
|
||||
"cache_write_price": 6250000
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "gpt-5.6-luna",
|
||||
"input_price": 1000000,
|
||||
"output_price": 6000000,
|
||||
"cache_read_price": 100000,
|
||||
"cache_write_price": 1250000
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "gpt-5.6-sol",
|
||||
"input_price": 5000000,
|
||||
"output_price": 30000000,
|
||||
"cache_read_price": 500000,
|
||||
"cache_write_price": 6250000
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "gpt-5.6-terra",
|
||||
"input_price": 2500000,
|
||||
"output_price": 15000000,
|
||||
"cache_read_price": 250000,
|
||||
"cache_write_price": 3125000
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "gpt-image-2",
|
||||
"input_price": 5000000,
|
||||
"output_price": 30000000,
|
||||
"cache_read_price": 1250000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "o1",
|
||||
@@ -471,22 +447,6 @@
|
||||
"cache_read_price": 7500000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "o1-mini",
|
||||
"input_price": 1100000,
|
||||
"output_price": 4400000,
|
||||
"cache_read_price": 550000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "o1-preview",
|
||||
"input_price": 15000000,
|
||||
"output_price": 60000000,
|
||||
"cache_read_price": 7500000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"model": "o1-pro",
|
||||
@@ -532,7 +492,7 @@
|
||||
"model": "o4-mini",
|
||||
"input_price": 1100000,
|
||||
"output_price": 4400000,
|
||||
"cache_read_price": 280000,
|
||||
"cache_read_price": 275000,
|
||||
"cache_write_price": null
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user