Skip to content

fix(llm): price Claude Opus 4.5+, Haiku 4.5 and Gemini 2.5 Flash at list price - #664

Open
Mattbusel wants to merge 1 commit into
spacedriveapp:mainfrom
Mattbusel:fix/list-prices
Open

Mattbusel wants to merge 1 commit into
spacedriveapp:mainfrom
Mattbusel:fix/list-prices

Conversation

@Mattbusel

Copy link
Copy Markdown

lookup_pricing matches every claude-opus-4* id to $15/$75 per 1M tokens, which is the Opus 4 / 4.1 price, so Opus 4.5, 4.6 and 4.7 calls are recorded at 3x their cost (Anthropic lists $5/$25); claude-haiku-4* is $0.80/$4 (list $1/$5) and gemini-2.5-flash shares Gemini 2.0 Flash's $0.075/$0.30 (list $0.30/$2.50). This PR prices Anthropic, OpenAI and Google ids from the llm-prices crate first (rows read from each provider's pricing page and dated, no dependencies) and keeps the prefix table for DeepSeek, older ids and the conservative fallback; the Haiku 4 arm is split from Haiku 3.5 so the table is right too. The new test_list_prices covers Opus 4.6/4.7, Haiku 4.5, Gemini 2.5 Flash, gpt-5.4, and that Opus 4.1 keeps $15/$75. I could not build the whole crate here (lance-encoding needs protoc), so I ran src/llm/pricing.rs and its tests (4 passed) against llm-prices 1.4 in a standalone crate, with rustfmt and clippy clean; the Cargo.lock change is only the new package. I maintain llm-prices (MIT).

…ist price

lookup_pricing matched every claude-opus-4* id to $15/$75 per 1M tokens, the Opus 4/4.1 price, so Opus 4.5, 4.6 and 4.7 calls were recorded at 3x their cost; claude-haiku-4* was $0.80/$4 (list $1/$5) and gemini-2.5-flash $0.075/$0.30 (list $0.30/$2.50). Anthropic, OpenAI and Google ids are now priced from llm-prices first (rows read from each provider's pricing page, dated, no dependencies), and the prefix table stays for DeepSeek, older ids and the fallback; the Haiku 4 arm is split from Haiku 3.5. The new test_list_prices covers Opus 4.6/4.7, Haiku 4.5, Gemini 2.5 Flash, gpt-5.4 and that Opus 4.1 keeps its price. I ran the pricing module's tests against llm-prices 1.4 in a standalone crate, since the full build needs protoc for lance-encoding; rustfmt and clippy are clean on it.

This branch has not been deployed

No deployments
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