Skip to content

feat: add Claude Opus 5, Opus 5.5, Fable 5.1, Mythos 5.1 to models.json - #131

Merged
aadhar-EAI merged 9 commits into
EfficientAI-tech:mainfrom
kush10000:feat/update-anthropic-models
Oct 9, 2026
Merged

aadhar-EAI merged 9 commits into
EfficientAI-tech:mainfrom
kush10000:feat/update-anthropic-models

Conversation

@kush10000

@kush10000 kush10000 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Changed?

Added 4 missing Anthropic models to app/config/models.json: claude-opus-5, claude-opus-5-5, claude-fable-5-1, and claude-mythos-5-1.

Also updated the descriptions of claude-opus-4-8, claude-fable-5, and claude-mythos-5 to point to their successors. Their old "most capable" wording stopped being accurate once the newer models were added to the same file. Pricing for existing entries is unchanged.

Added test_models_json_anthropic_2026_09_rates, which pins the new rates and the predecessors' cache-read prices.

No migration is needed: existing installs pick up the new rates through main's post-migrate sync (maybe_sync_pricing_catalog_after_migrate). An earlier version of this PR shipped its own startup sync; it was removed in favour of main's to avoid two mechanisms.

Operator note: usage of these models recorded before this deploy was priced at $0. Run eai usage recompute --config config.yml --sync after deploying to backfill it.

Why?

Anthropic released Claude Opus 5.5 on Sept 22, 2026, and Fable 5.1 / Mythos 5.1 on Sept 1, 2026. None of these were in the pricing config. Fable 5.1 also cut its cache-read price from $1.00/M to $0.25/M, so cost calculations for anyone testing against the new model would have been wrong.

I kept the older claude-fable-5 / claude-mythos-5 entries instead of removing them, because existing evaluator_results may reference those model IDs. The file already keeps historical entries the same way (e.g. gpt-3.5-turbo, older o1 variants).

How to Test?

  1. python -m json.tool app/config/models.json to confirm the JSON is valid (731 → 735 entries)
  2. pytest tests/test_services/test_usage/test_pricing.py: passes, including the new rate test
  3. Upgrade path on Postgres: with the 4 new rows removed from model_pricing_rates, start the app. The post-migrate sync logs Synced pricing catalog from models.json, and the 4 models resolve to their rates from DB rows (e.g. Opus 5.5 input $4/M, Fable 5.1 cache read $0.25/M)
  4. eai usage diff-rates --config config.yml: models.json priced: 735 | database rows: 735 | in_sync: True

Release Label

Select one semantic version bump intent for this PR:

  • major - breaking change, next release bumps major version
  • minor - backward-compatible feature, next release bumps minor version
  • fix - backward-compatible bug fix, next release bumps patch version
  • No label (defaults to patch release)

Intended release label: minor

Checklist

  • I have read the CONTRIBUTING.md guide.
  • My code follows the project's style guidelines.
  • I have added tests that prove my fix is effective or my feature works.
  • I have updated documentation where needed. (N/A: no docs reference these model IDs)

Also update stale descriptions for claude-opus-4-8, claude-fable-5 and
claude-mythos-5 to point to their successors. Old entries are kept for
historical cost lookups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical impact] The PR appears safe to merge based on the reviewed changes.

Summary

The PR adds four Anthropic models and pricing regression coverage. Since the previous review, it repairs a concatenated JSON catalog and removes a redundant startup-sync path while retaining post-migration pricing synchronization.

  • The repaired catalog retains the new model IDs and rates.
  • No new actionable issue was identified.

Reviews (8) · Last reviewed commit: "fix: reconcile with main's pricing sync ..." · Reviewed by Greptile

Comment thread app/config/models.json Outdated
Comment thread app/config/models.json Outdated
@TEJASNARAYANS TEJASNARAYANS self-assigned this Sep 25, 2026
@TEJASNARAYANS TEJASNARAYANS added the fix Fix version release label Sep 25, 2026
Runtime pricing reads model_pricing_rates, not models.json, so existing
databases never picked up the new entries. Add migration 092 that
re-seeds rates from models.json (same approach as 071), and a test that
pins the micro-USD values for the new models and their predecessors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread app/migrations/092_seed_anthropic_2026_09_pricing.py Outdated
seed_pricing_rates clears the cache before the migration commits, so a
worker lookup in between can leave a stale null entry for up to 300s.
Clear again once the new rows are visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kush10000

Copy link
Copy Markdown
Contributor Author

The test-sharding failure is unrelated to this PR: CI now installs SQLAlchemy 2.1, which defaults postgresql:// to psycopg v3 (not installed). Fixed separately in #133 . Once that merges, I'll update this branch from main to get CI green.

@TEJASNARAYANS

TEJASNARAYANS commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

@kush10000 Can you add a migrations script/ app startup seeding script which is going to update all the newer models & updates the pricing of existing models if we have changed them. I dont want to create a explicit migration script every time we add a new model

@kush10000

Copy link
Copy Markdown
Contributor Author

sure @TEJASNARAYANS I will do it

…ions

On API startup, upsert model_pricing_rates rows that are missing from or
differ from models.json, then invalidate the pricing cache after commit.
Adding or repricing a model now only needs a models.json edit. Rows that
exist only in the database are kept for usage history. Sync failures log
a warning and do not block startup; USAGE_PRICING_SYNC_ON_STARTUP=false
disables it.

Replaces migration 092, which re-seeded rates for one batch of models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread app/services/usage/pricing_ops.py Outdated
Comment thread app/services/usage/pricing_ops.py Outdated
kush10000 and others added 2 commits September 30, 2026 07:02
Read USAGE_PRICING_SYNC_ON_STARTUP from Settings instead of os.environ:
voice_bundle.py runs load_dotenv(override=True) during app import, so a
.env value could re-enable a sync the operator disabled in the process
environment.

Skip (and log) models that have a rate dated after the default
effective_from. Runtime lookups prefer the later row, so updating only
the default row reported success while usage kept the old price.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve app/config.py conflict: main converted the file from CRLF to LF
(plus Call Traces settings), which conflicted as a whole-file change. Took
main's version and re-applied USAGE_PRICING_SYNC_ON_STARTUP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread app/services/usage/pricing_ops.py Outdated
Comment thread app/services/usage/pricing_ops.py Outdated
kush10000 and others added 2 commits October 1, 2026 12:56
…usage kind

Skipping models with a later-dated rate left usage dated before that rate
unpriced when the baseline row was missing, and matched by model name, so
a later rate for one usage kind blocked syncing another.

Baseline rows now always follow models.json (they only price usage before
any later-dated row). Keys whose baseline is overridden by a later-dated
row for the same (model, usage_kind) are reported as shadowed, with the
date they take over, instead of being skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread app/app_factory.py Outdated
The merge of main left app/config/models.json as two concatenated JSON
documents (invalid JSON) and dropped the startup-sync helpers that
app_factory still imported, so the API could not start.

main now syncs models.json into model_pricing_rates after migrations
(maybe_sync_pricing_catalog_after_migrate) and falls back to models.json
at runtime, so drop this PR's separate startup sync. Rebuild models.json
from main and re-apply only this PR's changes: Claude Opus 5, Opus 5.5,
Fable 5.1 and Mythos 5.1, plus the three predecessor description fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aadhar-EAI

Copy link
Copy Markdown
Collaborator

@greptile give a confidence score in this

@greptile-apps

greptile-apps Bot commented Oct 9, 2026

Copy link
Copy Markdown

Confidence score: 5/5.

The changes are internally consistent: the four model entries have matching pricing assertions, predecessor cache-read rates are preserved, and the migration/upgrade path is covered by the stated tests. I see no blocking correctness issues in the reviewed changes.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@aadhar-EAI
aadhar-EAI merged commit d135896 into EfficientAI-tech:main Oct 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix version release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants