Repository navigation
Conversation
The prefix table ended its OpenAI rows at gpt-5, so every gpt-5.x point release was billed at gpt-5's rate (gpt-5.5 at a quarter of its input price), and Gemini had no rows. builtin_price now reads llm-prices first and keeps Clew's table as the fallback.
Owner
|
Thanks for the PR and for the clear disclosure about maintaining llm-prices. We've decided not to add it as a dependency, so I'm closing this. The gpt-5.x and Gemini pricing gap you pointed out is noted. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The usage ledger undercounts the newest OpenAI models and leaves Gemini unpriced. A prefix table that ends at
gpt-5is the wrong shape for a model line that ships a new point release every few months: every one of them silently inherits the oldest price.The bug.
builtin_priceinsrc/app/usage.rsmatchesPRICESby model-id start, and the OpenAI rows stop atgpt-5-nano,gpt-5-miniandgpt-5($1.25 in / $10 out). So:There are no Gemini rows at all, so
gemini-2.5-pro,gemini-2.5-flashand the 3.x models show as unpriced.The fix.
builtin_pricenow asksllm-pricesfirst (llm_prices::lookup), which resolves dated snapshots,models/andopenai/style prefixes, and keeps separate rows for each point release, each with its source URL and the date it was checked. A row without an input and output rate is skipped, and a missing cache rate falls back to the input rate, as Clew's own form already does. Clew's existing table stays as the fallback, so every id it priced before still resolves (includinganthropic/claude-3.5-haiku:beta), the reader's[prices]overrides still win viaprice_of, and the 1.25x cache-write multiplier is unchanged.llm-priceshas no dependencies of its own (its optional features are off), so this adds one small crate to the build.Tests.
a_model_is_priced_by_its_familykeeps every existing assertion and adds gpt-5.5 (5 / 0.5 / 30),openai/gpt-5.4, gpt-5.2, a check that plaingpt-5is still $1.25, and Gemini 2.5 Pro and Flash.cargo test --bin clew usage::passes andcargo fmt --checkis clean.Disclosure: I'm Matthew Busel and I maintain llm-prices. Happy to drop the dependency and just extend the table instead if you would rather own the rows; the point is that gpt-5.x and Gemini are currently mispriced.