Skip to content

feat(elevenlabs): add scribe_v2 to model cost map - #33524

Closed
devin-ai-integration[bot] wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_add_elevenlabs_scribe_v2
Closed

devin-ai-integration[bot] wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_add_elevenlabs_scribe_v2

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Relevant issues

Fixes #33519

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

Ran a live proxy at commit fb70d7f7eb9f7971fc157ef6597a4c18f4603a5b with a single deployment elevenlabs/scribe_v2 and confirmed the pricing metadata now resolves out of the box via /model/info

$ curl -s http://localhost:4000/model/info -H "Authorization: Bearer sk-1234" | jq '.data[] | select(.model_name=="scribe-v2")'
{
  "model_name": "scribe-v2",
  "litellm_model": "elevenlabs/scribe_v2",
  "litellm_provider": "elevenlabs",
  "mode": "audio_transcription",
  "input_cost_per_second": 6.11e-05,
  "output_cost_per_second": 0.0
}

Before this change the same lookup returned no pricing for elevenlabs/scribe_v2 and cost tracking silently fell back to 0

Type

🆕 New Feature

Changes

Adds elevenlabs/scribe_v2 to model_prices_and_context_window.json (and the bundled backup map) so cost tracking works without a manual model_info override. 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 existing elevenlabs/scribe_v1 shape (mode: audio_transcription, input_cost_per_second, output_cost_per_second: 0.0, /v1/audio/transcriptions endpoint)

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_second in litellm/llms/openai/cost_calculation.py checks output_cost_per_second first and returns early when it is present, even when it is 0.0. Because every ElevenLabs scribe entry sets output_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-up

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/25ea210ae6ce450f9756079defe8b55d

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds elevenlabs/scribe_v2 to the model cost map (model_prices_and_context_window.json and its backup) so that /model/info returns pricing metadata for the model, and adds a test verifying the new entry's fields.

  • New pricing entry: elevenlabs/scribe_v2 is added with mode: audio_transcription, input_cost_per_second: 6.11e-05 ($0.22/hour), and output_cost_per_second: 0.0, mirroring the existing scribe_v1 shape.
  • Test coverage: TestElevenLabsScribeV2Pricing.test_scribe_v2_model_info checks provider, mode, and pricing fields via litellm.get_model_info with no network calls.
  • Known limitation carried forward: Including \"output_cost_per_second\": 0.0 means cost_per_second() in cost_calculation.py short-circuits into the output branch (since 0.0 is not None) and never reads input_cost_per_second, so runtime spend tracking still computes to $0 — the same silent-zero outcome noted in the PR description for scribe_v1.

Confidence Score: 3/5

The 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.

Important Files Changed

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_add_elevenlabs_scribe_v2 (fb70d7f) with litellm_internal_staging (2f03789)

Open in CodSpeed

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

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.

[Feature]: Add elevenlabs/scribe_v2 to model_prices_and_context_window.json

1 participant