fix(cost): bill the fast service tier at the priority rate - #35320
Merged
mateo-berri merged 1 commit intoJul 31, 2026
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Greptile SummaryThis PR updates service-tier cost resolution so Fast mode uses existing Priority pricing.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| litellm/litellm_core_utils/llm_cost_calc/utils.py | Adds an immutable service-tier suffix mapping and resolves Fast mode to existing Priority cost keys. |
| litellm/types/utils.py | Extends the service-tier enum with the new Fast value. |
| tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py | Adds focused regression tests confirming Fast and Priority pricing match across relevant calculation paths. |
Reviews (2): Last reviewed commit: "fix(cost): bill the fast service tier at..." | Re-trigger Greptile
Closed
5 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
litellm_gpt56_fast_service_tier
branch
from
July 31, 2026 04:49
7b10784 to
18b9e90
Compare
Contributor
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.
TLDR
Problem this solves:
service_tier: "fast"is billed at standard ratesHow it solves it:
fastto theServiceTierenum_prioritycost keysRelevant issues
Linear ticket
Resolves LIT-5011
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Real
gpt-5.6-solcalls against a local proxy hitting the OpenAI API. Config used:Steps, run once on the base commit and once on this branch:
LITELLM_LOCAL_MODEL_COST_MAP=True uv run --no-sync python litellm/proxy/proxy_cli.py --config proof_config.yamlEvery run below is 13 prompt / 4 completion tokens
Before, at
bf1a8fe403(base):The Fast mode request costs OpenAI's priority rate but is billed identically to the untiered one
After, at
18b9e90d12(this branch):Fast now matches Priority at 2x, and untiered requests are untouched. Worth noting that OpenAI reports
service_tier: "priority"on the Fast mode response, which is the same aliasing this PR applies on the cost sideType
🐛 Bug Fix
Changes
The GPT-5.6 announcement replaced Priority Processing with Fast mode, which is a new
service_tiervalue that bills at twice the standard rate.service_tieris already an allowed param on the OpenAI and Responses paths and is forwarded as an opaque string, so requests work today; only the cost side is wrong._get_service_tier_cost_keyrecognized justflexandpriorityand returned the base key for anything else, so a Fast mode request resolvedinput_cost_per_tokeninstead ofinput_cost_per_token_priorityand landed in SpendLogs at half its real cost, silentlyThe tier-to-suffix decision moves out of the
ifchain and into a lookup, which is where the aliasing belongs:Fast and Priority share one set of
*_prioritycost keys rather than getting a duplicated*_fastset across every model. OpenAI keptservice_tier: "priority"working as an alias for Fast mode and prices them the same, so duplicating the keys would mean two numbers to keep in sync per model per tier with no way for them to legitimately differUnknown tiers still fall back to standard pricing, and
autois still normalized away upstream in_normalize_service_tier, so nothing else changes. The above-threshold branch resolves its cost keys through the same helper, so it picks up Fast mode too; a test covers that path separately since it is easy to regress independentlyThe price cuts themselves landed separately in #35270
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/bdd531a0c9ce49679c29fa6a3d40fb27