Skip to content

feat(catalog): source tiers, context and API-only models from the official pricing page - #351

Merged
BrainerVirus merged 2 commits into
mainfrom
feat/official-pricing-sync
Dec 4, 2026
Merged

BrainerVirus merged 2 commits into
mainfrom
feat/official-pricing-sync

Conversation

@BrainerVirus

Copy link
Copy Markdown
Owner

What

Catalog sync now reads the model rows embedded in the official pricing page (https://commandcode.ai/docs/resources/pricing-limits). Before, it read only the HTML table and then took long-context tiers from models.dev.

  • Parser (src/costs-docs.ts): decodes the Next.js self.__next_f.push flight chunks and parses the rows array (id, name, category, contextWindow, caps, deal, tiers/contextTiers).
  • Join: rows are matched to live /models items by exact ID, then by vendor-less ID ignoring case and punctuation, then by display name. A key shared by two rows never matches. The page has 115 rows and they join all 111 live IDs. Availability still uses exact-ID matching.
  • Costs: uses the billed rates (deal prices), never listRates, and includes cacheWrite. The first band is the base cost. Each later band becomes a context tier above the previous band's upper bound. A band billed like the previous one adds no tier.
  • Context: the official contextWindow sets the catalog context. The live context_length is a cross-check: a mismatch writes a warning to the log and the step summary.
  • models.dev tiers apply only to models with no official row. Models without official rows keep the existing cost waterfall.
  • API-only synthesis: a live ID with no CLI candidate gets a catalog entry if it has an official row. The entry is built from the live item, the official row and models.dev metadata, and the ID goes in manifest.review.apiOnly. No hardcoded IDs or rows.
  • Fail soft: if the page can't be fetched or parsed, the sync writes nothing, exits 0 and appends a warning to $GITHUB_STEP_SUMMARY.
  • Spec: docs/specs/2026-09-20-catalog-freshness.md now allows official-source API-only synthesis and documents the rules above.

Result (bun run sync -- --remote, command-code 1.94.0)

  • 111 models; the IDs are exactly the live /models set. review.apiOnly lists minimax/minimax-m4, recursive/flint-v1.1:free, reflection/beam-contributor:free, subquadratic/subq-savant-1.4 and thinkingmachines/inkling-2-small.
  • Spot checks: claude-sonnet-4-6 is flat 3/15 at 1M (200K tier removed). gpt-5.5 is flat 5/30 at 400K (272K tier removed). MiniMax M3 is 0.3/1.2. Qwen3.7-Max has no 32K/128K tiers. subq has a 4,194,304-token context. flint-v1.1:free and beam-contributor:free cost $0. flint-v1.0 is absent.
  • Tiers changed on 26 models in total, including opus-4-7/4-8, gpt-5.4, fugu-ultra, muse-ember and grok-4.5 (tiers removed), plus cache-write added to the official GPT-6 tiers.
  • Every catalog context matches the live context_length, so no cross-check warning was raised.

Checks

bun run check passes (335 tests).

…icial pricing page

Workit-Session: ses_dbdda4daaffexKPxS5Z9LKhpI2:ses_dbd93db0effeEfWTGgb4u7WLz9
Workit-Session: ses_dbdda4daaffexKPxS5Z9LKhpI2:ses_dbd93db0effeEfWTGgb4u7WLz9
@BrainerVirus
BrainerVirus merged commit 643e5a0 into main Dec 4, 2026
5 checks passed
@BrainerVirus
BrainerVirus deleted the feat/official-pricing-sync branch December 4, 2026 19:08
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant