Repository navigation
fix(chat): reserve $0 for the hidden NVIDIA ids the account sheet bills at $0 - #181
Merged
Merged
Conversation
…bills at $0 blockrun.ai/api/pricing prices these at $0 (billingMode "free") and both wallet gateways answer them unpaid, redirected onto $0 models (probed 2026-10-20). An explicit call reserved the $5/$30 default, so an exhausted budget refused a free call. Added to FREE_CHAT_MODELS only; the free routing order is unchanged. nvidia/deepseek-v4-pro shares its bare name with the paid deepseek/deepseek-v4-pro, so BARE_TO_PREFIXED now lets paid ids own a bare spelling (free ids go in first), and FREE_SHADOWED_BY_PAID names the exception the uniqueness test tolerates.
The gateways are retiring both (blockrun#848 removed -flash, live; -pro removal approved 2026-10-20); afterwards they answer an unknown-model 400, so a $0 reserve would only mask that. The paid-wins-bare-spelling rule stays: bare deepseek-v4-pro still reserves deepseek/deepseek-v4-pro's rate. FREE_SHADOWED_BY_PAID is now empty; tests updated.
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.
What changes
This adds 17 ids to
FREE_CHAT_MODELSinsrc/utils/constants.ts. Each is hidden from GET /v1/models, but the account price sheet (blockrun.ai/api/pricing) prices it at $0 /billingMode:"free". Until now an explicit call to any of them reserved the $5/$30 default, so an exhausted budget refused a free call.verify:priceshad flagged each one.The ids:
nvidia/nemotron-3-super-120b-a12b-free,qwen3.5-397b-a17b,nemotron-ultra-253b,nemotron-super-49b,deepseek-v3.2,deepseek-v4-pro,deepseek-v4-flash,nemotron-3-nano-omni-nim,mistral-large-3-675b,qwen3-coder-480b,devstral-2-123b,glm-4.7,llama-4-maverick,qwen3-next-80b-a3b-instruct,qwen3.5-122b-a10b,seed-oss-36b,mistral-small-4-119b.MODEL_TIERS.free(the routing order) is unchanged.Bare-name safety
nvidia/deepseek-v4-prohas the same bare name as the paiddeepseek/deepseek-v4-pro($1.32/$3.96). Under the old map order the free id would have taken over baredeepseek-v4-pro, which means a $0 reserve for a paid call. To prevent that:BARE_TO_PREFIXEDnow adds free ids first, so a paid id with the same bare name always owns that spelling.FREE_SHADOWED_BY_PAIDnames the exception, which is currently onlynvidia/deepseek-v4-pro.deepseek-v4-proto the paid rate.Sources
inputPrice/outputPrice0,billingMode:"free".src/lib/models.ts:billingMode:"free", $0/$0 for 16 of the 17.deepseek-v4-flashis covered by the account sheet and by theMODEL_REDIRECTSentry in the chat route.Checks
npm run typecheck: cleannpm test: 1423/1423 passnpm run build: oknpm run verify:prices: exit 0, 0 under-reserving. The catalogue sweep finds 0 gaps on Base, Solana and the account sheet. The 17 "billed $0 but FREE_CHAT_MODELS does not list it" notes are gone.package.jsonis untouched.Update: two DeepSeek mirrors dropped (2026-10-20)
nvidia/deepseek-v4-proandnvidia/deepseek-v4-flashare removed from the free set. The gateway removed -flash in blockrun#848 (already live) and is removing -pro now. Once removed, both return an unknown-model 400, so the set now holds 15 account-sheet ids instead of 17.The "paid wins bare spelling" rule stays: bare
deepseek-v4-prostill reserves the paiddeepseek/deepseek-v4-prorate.FREE_SHADOWED_BY_PAIDis now empty, and the tests pin that.Expected verify:prices note: until the gateway change ships, the account sheet still lists
nvidia/deepseek-v4-proat $0. verify:prices therefore reports it as "billed $0 but FREE_CHAT_MODELS does not list it". That is an over-reserve note, not a failure. verify:prices still exits 0 with 0 under-reserving, and tests are 1423/1423.