Repository navigation
feat(elevenlabs): add scribe_v2 to model cost map - #33524
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 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:
|
|
|
Greptile SummaryThis PR adds
Confidence Score: 3/5The metadata addition is correct and the test passes, but actual transcription spend will still be computed as $0 for scribe_v2 because of how the cost calculator handles the included output_cost_per_second: 0.0 field. The new entry makes /model/info return correct pricing metadata, but the cost calculator in cost_calculation.py short-circuits on output_cost_per_second being present-and-not-None (even when it is 0.0), so input_cost_per_second is never used and every transcription call is billed at $0. Both JSON pricing files need output_cost_per_second: 0.0 removed from the new elevenlabs/scribe_v2 entry.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds elevenlabs/scribe_v2 entry with correct pricing fields and metadata, but includes output_cost_per_second: 0.0 which causes the cost calculator to short-circuit and return $0 for actual transcription spend |
| litellm/model_prices_and_context_window_backup.json | Mirror of the main pricing file change; same output_cost_per_second: 0.0 issue applies |
| tests/llm_translation/test_elevenlabs.py | Adds TestElevenLabsScribeV2Pricing verifying model-info fields; no network calls, correct use of pytest.approx. Does not test end-to-end cost calculation (would catch the zero-cost bug), but model-info assertions are accurate |
Reviews (1): Last reviewed commit: "feat(elevenlabs): add scribe_v2 to model..." | Re-trigger Greptile
| "original_pricing_per_hour": 0.22 | ||
| }, | ||
| "mode": "audio_transcription", | ||
| "output_cost_per_second": 0.0, |
There was a problem hiding this comment.
output_cost_per_second: 0.0 silences the input cost at runtime
In litellm/llms/openai/cost_calculation.py, cost_per_second() checks output_cost_per_second first (line 111): if the key is present and not None, it sets completion_cost = output_cost_per_second * duration (= 0) and never falls through to the elif that reads input_cost_per_second. Because 0.0 is not None evaluates to True, including "output_cost_per_second": 0.0 here causes actual transcription spend for scribe_v2 to always be computed as $0 — the same silent-zero behaviour the PR description says existed before this change. Omitting the output_cost_per_second key entirely (since there genuinely is no output cost) would let the elif branch use the correct input_cost_per_second: 6.11e-05 rate. The same issue exists on the scribe_v1 and scribe_v1_experimental entries, but those are pre-existing; adding a new entry that replicates the defect is the concrete regression introduced here.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
Relevant issues
Fixes #33519
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Ran a live proxy at commit
fb70d7f7eb9f7971fc157ef6597a4c18f4603a5bwith a single deploymentelevenlabs/scribe_v2and confirmed the pricing metadata now resolves out of the box via/model/infoBefore this change the same lookup returned no pricing for
elevenlabs/scribe_v2and cost tracking silently fell back to 0Type
🆕 New Feature
Changes
Adds
elevenlabs/scribe_v2tomodel_prices_and_context_window.json(and the bundled backup map) so cost tracking works without a manualmodel_infooverride. Scribe v2 is ElevenLabs' current batch speech-to-text model (released January 2026); ElevenLabs prices it at $0.22 per hour of audio, the same batch rate as scribe_v1, which is $0.22 / 3600 = 6.11e-05 per second. The entry mirrors the existingelevenlabs/scribe_v1shape (mode: audio_transcription,input_cost_per_second,output_cost_per_second: 0.0,/v1/audio/transcriptionsendpoint)Source for the rate is the ElevenLabs API pricing page, which lists "Speech to Text $0.22 per hour (Scribe)"
One thing worth flagging separately:
cost_per_secondinlitellm/llms/openai/cost_calculation.pychecksoutput_cost_per_secondfirst and returns early when it is present, even when it is0.0. Because every ElevenLabs scribe entry setsoutput_cost_per_second: 0.0, the per-second input rate is currently shadowed and transcription spend computes to 0 for scribe_v1 too. That is a pre-existing issue affecting all these models, so I left it out of this PR to keep the scope to the requested cost-map addition; happy to open a follow-upFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/25ea210ae6ce450f9756079defe8b55d