From a6098741d0979748aa6e9a45c2e40332b71d5b58 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 26 Oct 2026 21:29:59 +0000 Subject: [PATCH] gateway: declare a zero character price for voxtral-tts so speech can bill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- config.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.yaml b/config.yaml index e735155..b400c43 100644 --- a/config.yaml +++ b/config.yaml @@ -179,6 +179,15 @@ model_list: model_info: mode: audio_speech # 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 # --- Embedding model (Tinfoil, in-TEE) ---