feat(cost-map): add Cloudflare Workers AI whisper transcription models - #38384
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryAdds Cloudflare Workers AI Whisper model metadata to the root and bundled cost maps.
Confidence Score: 5/5The metadata-only change appears safe to merge, with the currently unsupported Cloudflare transcription execution path explicitly documented as follow-up work. The new entries conform to the cost-map schema, resolve through existing model-key normalization, and use per-second fields consistently with the audio cost calculator; no unacknowledged blocking or non-blocking defect remains.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds valid Cloudflare Whisper transcription metadata and correctly converted per-second prices to the primary cost map. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary cost-map entries exactly for packaged local-cost-map use. |
| tests/test_litellm/test_cloudflare_workers_ai_model_metadata.py | Verifies model mode, endpoint metadata, pricing conversion, the intentional zero-price beta entry, and root/backup synchronization. |
Reviews (1): Last reviewed commit: "feat(cost-map): add Cloudflare Workers A..." | Re-trigger Greptile
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit de33cff. Configure here.
|
Closing as superseded by the rolling registry PR #39170, which carries both priced Whisper models and drops whisper-tiny-en since Cloudflare publishes no price. Thank you |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: an admin who adds Cloudflare's whisper models to their config sees no pricing or task type for them, so they cannot tell what a transcription will cost
cloudflare/@cf/openai/whisper,cloudflare/@cf/openai/whisper-large-v3-turboandcloudflare/@cf/openai/whisper-tiny-ento their proxy config and restart"mode": null,"input_cost_per_second": nulland"output_cost_per_second": null, the same shape an unknown model would returnAfter: the same three models come back with their task type and Cloudflare's published rates
"mode": "audio_transcription", andinput_cost_per_secondof7.5e-06for whisper and8.5e-06for whisper-large-v3-turbo, matching Cloudflare's $0.00045 and $0.00051 per audio minute0.0, since Cloudflare publishes no rate for it while it is in betaRelevant issues
Linear ticket
Pre-Submission checklist
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Shared setup, used for both runs:
Both runs start the proxy the same way, from the checkout under test:
Before (7bc8099)
After (de33cff)
Type
🆕 New Feature
Caveats (if any)
Medium
/v1/audio/transcriptionsreturns "Unmapped provider passed in"Final Attestation
Note
Low Risk
Metadata-only cost-map and test changes; no runtime routing or billing logic is modified in this PR.
Overview
Adds three Cloudflare Workers AI Whisper models to the model cost map (
model_prices_and_context_window.jsonand its backup) so/model/infoand spend tracking can treat them asaudio_transcriptioninstead of unknown models.cloudflare/@cf/openai/whisperandwhisper-large-v3-turbogetinput_cost_per_secondderived from Cloudflare’s published per-audio-minute rates (7.5e-06and8.5e-06), zero output cost, andsupported_endpoints["/v1/audio/transcriptions"].whisper-tiny-enis registered the same way but priced at $0 with metadata noting missing public pricing while in beta.New tests in
test_cloudflare_workers_ai_model_metadata.pyassert per-second conversion, endpoint/mode metadata, and that root and backup Cloudflare entries stay aligned.Reviewed by Cursor Bugbot for commit de33cff. Bugbot is set up for automated code reviews on this repo. Configure here.