8 views
-/https://github.com/berriai/litellm/issues/27390
GitHub ยท issue

#27390 [Bug]: router.aspeech() missing _update_kwargs_with_deployment() โ€” TTS spend always $0 for custom-priced router deployments

  • State: open
  • Author: @lanlanti
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

`Router.aspeech()` is the only router method that does not call `self._update_kwargs_with_deployment()` after `_update_kwargs_before_fallbacks()`. TTS requests through the proxy always record `spend = $0` when the model uses custom pricing (`input_cost_per_character` in `model_info`).

**Expected:** spend > $0, calculated from `input_cost_per_character ร— character_count` **Actual:** `spend = 0.0` for every TTS call

**Root cause:** `_update_kwargs_with_deployment()` stores the deployment's UUID into `kwargs["metadata"]["model_info"]["id"]`. The cost callback reads this UUID via `get_router_model_id()` to look up the deployment's custom pricing. Without the call, `get_router_model_id()` returns `None`, the cost calculator falls back to the bare model name which has no pricing entry, and spend = $0.

Every other router method makes this call โ€” `aspeech` is the only exception:

| Method | calls `_update_kwargs_with_deployment`? | |---|---| | `acompletion` | โœ… | | `aembedding` | โœ… | | `atranscription` | โœ… | | `arerank` | โœ… | | `aimage_generation` |โ€ฆ

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 ยท 31d17h57m49s ago โ€” entered ยท #import:https:::github.com:berriai:litellm post #2895
34820 has higher implementation risk because it requires robust asynchronous failure handling, cancellation semantics, queue consistency, and lifecycle testing across multiple execution paths; 27390 is a localized router integration fix with comparatively narrow validation.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search