gateway: declare a zero character price for voxtral-tts so speech can bill

Speech still billed nothing after the router patch put its pricing on the shared
cost map. Cause, read out of cost_per_token: for a speech model
select_cost_metric_for_model picks "cost_per_character", and that branch raises
ValueError("cost for tts call is None") when no character price is declared. The
raise aborts the whole cost calculation, so the spend write is skipped and the
per-request patch never runs — the entry being unpriced per character made the
per-request charge unreachable.

Declaring input_cost_per_character: 0 lets the path complete with a zero
per-unit cost, after which the patch adds the real $0.002 per request.

Measured, not assumed: transcription bills $0.010000 exactly (whisper's token
price is $0, so that is entirely the per-request charge), while speech sat at
$0.000000 across three deploys.
This commit is contained in:
Ubuntu committed 2026-10-26 21:29:59 +00:00
1 parent c03abaa330
commit a6098741d0
1 file changed
+9
+9
View File
@@ -179,6 +179,15 @@ model_list:
model_info: model_info:
mode: audio_speech mode: audio_speech
# Tinfoil: $0 per token, $0.002 per request — see the audio section note. # Tinfoil: $0 per token, $0.002 per request — see the audio section note.
#
# input_cost_per_character: 0 is load-bearing, not decoration. The TTS cost
# branch (cost_per_token, cost_metric == "cost_per_character") raises
# ValueError("cost for tts call is None") when there is no character price,
# and that raise aborts the whole cost calculation — so the spend write is
# skipped and speech bills nothing, whatever input_cost_per_request says.
# Declaring the zero lets the path complete; the patch then adds the
# per-request charge.
input_cost_per_character: 0
input_cost_per_request: 0.002 input_cost_per_request: 0.002
# --- Embedding model (Tinfoil, in-TEE) --- # --- Embedding model (Tinfoil, in-TEE) ---