Skip to content

fix(models): correct four catalogue prices and add grok-4.7 / qwen3.8-flash - #413

Merged
argszero merged 1 commit into
mainfrom
fix/models-catalogue-official-prices
Oct 16, 2026
Merged

argszero merged 1 commit into
mainfrom
fix/models-catalogue-official-prices

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Brings four entries of the model catalogue in line with each vendor's own pricing page (checked 2026-10-16) and adds the two current-generation rows the catalogue was missing. The config is the single source of truth for the catalogue (config/config.example.toml, seeded into the models table on start), so the same numbers are mirrored in the UI fallback table (ui/js/data.js).

Work order: rant 2026-10-16T14:08:13.993557 — 【定价】4 条模型价格与官网不符(含一处缓存命中价被写成 0 的持续少收). Translated from the Chinese original: four catalogue prices do not match the vendors' official pages, one of them a cached-hit price written as 0 that undercharges continuously.

What changed

provider model before after
openai gpt-5.6-sol 5.0 / 0.5 / 30.0 USD 4.0 / 0.4 / 20.0 USD
xai grok-4.6 cache hit 0.0 USD cache hit 0.5 USD
xai grok-4.7 — (absent) new row: 2.0 / 0.5 / 6.0 USD, 500k context
aliyun-bailian qwen3.8-flash — (absent) new row: 0.8 / 2.7 CNY, 1M context
  1. gpt-5.6-sol — the three recorded numbers were all above the official short-context price (input 25% high, output 50% high), so points were overcharged. The official price is a promotion valid at least until 2026-11-21; the row's comment records that date and the long-context tier (8.0 / 0.8 / 30.0), because this repository has one price field per model and cannot express the tiers.

  2. grok-4.6 cache hit — written as 0.0, i.e. cached input was billed as free: the higher the cache-hit rate, the more was undercharged. It was the only entry of the thirteen whose cached-hit price was 0, so this reads as a missed field rather than a deliberate giveaway. Corrected to the official 0.5 USD.

  3. grok-4.7 — the vendor's current flagship (same 2.0 / 0.5 / 6.0 USD, 500k context; ≥200k context is 4.0 / 1.0 / 12.0). Added beside grok-4.6 rather than replacing it: seed_models deletes rows the config no longer lists, and a listed key whose (provider, model) has no price is rejected at the router with 503.

  4. qwen3.8-flash — Bailian's current light tier (0<Token≤1M: 0.8 CNY in / 2.7 CNY out). qwen3.7-flash stays for the same reason as above. Its cached-hit price is not published: the price table for that model only says the context cache is discounted, and the cache-billing page states that the qwen3.8 family does not follow the usual percentage and points at the Bailian console. Following the work order's instruction not to guess, the field is recorded as 0.0 — an explicit undercharge — with a "pending" note in the row's comment stating exactly why and where the number has to come from.

Carriers kept in step

  • config/config.example.toml — the tracked source of truth (the two new rows plus the corrected values).
  • ui/js/data.js — MODELS is a deliberate mirror of the config (bidirectional set equality asserted by src/catalog_gate.rs), and the guest-market row for gpt-5.6-sol carried the same wrong price, so it is corrected too.
  • src/catalog_gate.rs — MODEL_COUNT 13 → 15. That constant is the positive control whose own comment asks for it to be updated deliberately whenever the catalogue changes.
  • ui/README.md — one line that restated the two fallback tables' row counts no longer does; it points at MODEL_COUNT / MARKET_COUNT instead, so it cannot go stale again.

Note for deployment

An instance's live config/config.toml is not part of the repository, and seed_models synchronises the models table from it on start: the new rows and prices reach a running instance only when that file is updated as well. Keys already listed keep working either way.

Tests

  • cargo test — 564 passed / 0 failed
  • cargo fmt --check and cargo clippy --all-targets — clean
  • A/B on the gate's teeth: reverting MODEL_COUNT to 13 fails extractors_are_alive; perturbing the new grok-4.7 price in ui/js/data.js fails shared_model_fields_match_the_config — the added rows are genuinely compared, not merely present

…-flash

Verified against each vendor's own pricing page (2026-10-16):
- openai/gpt-5.6-sol: 5.0/0.5/30.0 -> 4.0/0.4/20.0 USD/M tokens (short-context promo
  price, valid at least until 2026-11-21; long context is 8.0/0.8/30.0)
- xai/grok-4.6: cache_hit_input_per_m 0.0 -> 0.5. The cached-hit price was written as 0,
  so every cache hit was billed as free (a persistent undercharge)
- xai/grok-4.7 (new row): 2.0/0.5/6.0 USD, 500k context -- xAI's current flagship.
  grok-4.6 stays: seed_models deletes rows absent from the config, and a listed key whose
  (provider, model) has no price is rejected at the router with 503
- aliyun-bailian/qwen3.8-flash (new row): 0.8/2.7 CNY, 1M context -- Bailian's current
  light tier. Its cached-hit price is NOT published: the price table only says the
  context cache is discounted, and the cache-billing page states the qwen3.8 family does
  not follow the usual percentage and points to the console. Recorded as 0 (free hits,
  i.e. an undercharge) with a "pending" note in the config, per the request not to guess

The same numbers are mirrored in ui/js/data.js (MODELS plus the guest-market row for
gpt-5.6-sol), and catalog_gate's MODEL_COUNT positive control moves 13 -> 15.

cargo test 564/0, fmt and clippy clean. A/B: reverting MODEL_COUNT to 13 fails
extractors_are_alive, and perturbing the new grok-4.7 row fails
shared_model_fields_match_the_config.
@argszero
argszero merged commit eadfb9f into main Oct 16, 2026
2 checks passed
@argszero
argszero deleted the fix/models-catalogue-official-prices branch October 16, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant