improvement: show cached input prices#771
Open
JannikSt wants to merge 1 commit into
Open
Conversation
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.
Surface the prefix-cache discount rate in the CLI now that RFT pricing carries it.
prime train modelsgains aCachedcolumn betweenInputandOutputprime train runpreview andprime train usagerender an "Inference (cached input)" line/row when the model advertises a cached rate or the run consumed cached tokensNote
Low Risk
Display and optional schema fields only; no billing logic changes, with tests for legacy backends and cost fallback behavior.
Overview
Adds optional API fields and CLI display for prefix-cache (cached) inference input pricing and usage, aligned with RFT backends that bill cached input tokens at a discounted rate.
Models & API:
RunUsageBreakdown/RunPricinggaincached_input_tokensandinference_cached_input_per_mtok.RLModelgainscached_input_*,list_cached_*, andeffective_cached_*fields;resolve_pricessupports a virtualinference_cached_inputcategory with the same list/effective semantics as other price types.CLI:
prime train modelsadds a Cached column; run confirmation Pricing shows Inference Cached Input when a rate exists;prime train usagesplits inference input into non-cached vs Inference (cached input) rows (tokens and derived costs sum correctly, with fallback to the full input rate when cached tokens exist but no cached rate is sent). JSON help strings and--output jsoninclude the new fields.Tests: Coverage for models table/JSON cached pricing and usage row visibility, absence on old backends, and rate fallback.
Backward compatible: missing fields keep prior layouts and parsing behavior.
Reviewed by Cursor Bugbot for commit 0280ab7. Bugbot is set up for automated code reviews on this repo. Configure here.