Skip to content

fix(bridges): backport #49960 audio output refusal to lts/1.108.x - #53745

Merged
mateo-berri merged 2 commits into
BerriAI:lts/1.108.xfrom
zoveki:litellm_backport_49960_lts_1_108_x
Nov 23, 2026
Merged

mateo-berri merged 2 commits into
BerriAI:lts/1.108.xfrom
zoveki:litellm_backport_49960_lts_1_108_x

Conversation

@zoveki

@zoveki zoveki commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Backport of #49960 to the 1.108 LTS line. Gemini TTS models on /v1/responses, /v1/messages and /v1/completions gave back an empty 200 and still billed the audio, and now those endpoints answer 400 pointing to /v1/chat/completions before anything is sent to Gemini. A text model asked for audio there gets a 400 too, unless drop_params is on

Details

TLDR

Problem this solves:

  • Gemini TTS on the three bridged endpoints returns an empty 200
  • The audio tokens are still billed and logged as a success
  • gpt-audio requests asking for audio there do the same

How it solves it:

  • The three endpoints check for audio output before calling the provider
  • Gemini TTS on Gemini or Vertex AI gets a 400
  • An audio request gets a 400, or loses its audio under drop_params

Intentional product change: a text model asked for audio on these endpoints now answers 400 unless drop_params is on

User Flow

Before: a developer who calls a Gemini TTS model through /v1/responses gets an empty answer and still pays for it

  1. They send POST https://litellm-domain/v1/responses with "model": "gemini-tts" and "audio": {"voice": "Kore", "format": "pcm16"}, or the same through /v1/messages or /v1/completions
  2. They get 200 with "output": [] ("content": [] on /v1/messages, "text": null on /v1/completions)
  3. GET https://litellm-domain/spend/logs/v2 shows the audio tokens billed as a success

After: the same request is refused before it reaches Gemini, so nothing is billed

  1. They send the same POST https://litellm-domain/v1/responses
  2. They get 400 gemini/gemini-3.8-flash-tts returns audio, which /v1/responses cannot carry. Call /v1/chat/completions to get the audio.
  3. GET https://litellm-domain/spend/logs/v2 shows the call as a failure with 0 spend

Relevant issues

Backport of #49960. Its commits are folded into one commit on this line, since the PR's own merge of main replaced ec882be with c37c252

Main commit LTS commit
ec882be 448eef5
c37c252 448eef5
9b6b65e 448eef5
16255e8 448eef5
675bf5d 448eef5
3d505a2 448eef5
22777c8 448eef5
3c5ed0a 448eef5
a345bc4 448eef5

The is_gemini_tts_model helper comes from #31915 (045fb7b), only that one function, since the line has no copy of it

Merging lts/1.108.x at f69cbe5 into the branch (f851cb5) conflicted only on the imports at the top of litellm/responses/main.py. Both import blocks are kept

How the pick differs from main

The /v1/messages check goes in litellm/llms/anthropic/pass_through/messages/handler.py, because this line has no messages/native/handler.py. text_completion keeps the line's **optional_params next to the new kwargs. The unit test fixture calls register_model without add_to_provider_model_sets=False, which this line's register_model does not take. Everything else, including bridged_audio_output.py, matches main

Gauntlet-mini: SURVIVED, 5/5 lenses, 0 confirmed (all fixed), run 5e7ab38fe5e1, reviewed fb62f6b21c. 448eef5 has the same tree and only rewords its commit message

Gauntlet-mini findings, all rejected
  • Strongest dissent. An OpenAI-compatible upstream that ignored modalities used to answer 200 and now gets a 400. Rejected, since it is fix(bridges): refuse audio output on Responses, Messages and Completions before the provider call #49960's Medium caveat below and drop_params brings back the 200
  • OpenAI audio models answer 400 on /v1/completions but drop the audio on /v1/messages and /v1/responses. Rejected, since those two go to OpenAI's own Responses API before the check, the same as on main
  • extra_body audio and a modalities list with a null entry skip the check. Rejected, the first is fix(bridges): refuse audio output on Responses, Messages and Completions before the provider call #49960's Low caveat and the second is malformed input, same as main
  • With mock_response, /v1/completions refuses while the other two return the mock. Rejected, it only affects mock-based tests
  • The unit tests would still pass if the "tts" part of the Gemini name check were dropped, since the test singer model's name has no "gemini" in it. Not a behavior break, and the same file is on main, so a follow-up tightens the tests there first

Dependencies: no bumps. Every package grype flags on this line's lock is either still on the same version on main or has no fixed release

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Per-fix smoke on the 1.108 line, since #49960 carries the full QA. Each leg ran a 2-worker proxy on its own commit with the config below, and every call hit Gemini. Before ran at f69cbe5, the line commit this branch merged in, and After ran at this PR's tip f851cb5. The picked unit tests pass on the line at that tip (49 passed), and so does tests/integration/providers (27 passed)

Case Before (f69cbe5) After (f851cb5)
Gemini TTS, chat completions 200, audio 200, audio
Gemini TTS, three bridges 200 empty, billed 400 before the call
Gemini Flash asking for audio, three bridges 200, text 400 before the call
Gemini Flash + drop_params, all four 200, text 200, text
Template modalities, /v1/responses 200, text 400 before the call
Template + drop_params, /v1/responses 200, text 200, text
How to run it

Run from the checked-out commit's root with GEMINI_API_KEY and LITELLM_MASTER_KEY set

python litellm/proxy/proxy_cli.py --config config.yaml --port $PORT --num_workers 2 --detailed_debug
model_list:
  - model_name: gemini-flash
    litellm_params:
      model: gemini/gemini-3.8-flash
      api_key: os.environ/GEMINI_API_KEY
  - model_name: gemini-tts
    litellm_params:
      model: gemini/gemini-3.8-flash-tts
      api_key: os.environ/GEMINI_API_KEY
prompts:
  - prompt_id: spoken-answer
    litellm_params:
      prompt_id: spoken-answer
      prompt_integration: dotprompt
      dotprompt_content: |
        ---
        modalities: ["text", "audio"]
        ---
        Answer in one cheerful sentence.
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY

With PROXY and LITELLM_MASTER_KEY exported, run python clients.py gemini-tts, python clients.py gemini-flash and python clients.py gemini-flash drop. It sends one prompt to all four endpoints through the official SDKs. gemini-tts sends audio, gemini-flash sends modalities, and drop adds drop_params: true

Then python template_client.py and python template_client.py drop call /v1/responses with the spoken-answer prompt, whose template asks for modalities: ["text", "audio"]

clients.py
import json
import os
import sys

import anthropic
import openai

BASE = os.environ["PROXY"]
KEY = os.environ["LITELLM_MASTER_KEY"]
MODEL = sys.argv[1]
DROP = {"drop_params": True} if sys.argv[2:] == ["drop"] else {}
EXTRA = {
    **({"audio": {"voice": "Kore", "format": "pcm16"}} if MODEL == "gemini-tts" else {"modalities": ["text", "audio"]}),
    **DROP,
}
PROMPT = "Say cheerfully: have a wonderful day"

oai = openai.OpenAI(base_url=f"{BASE}/v1", api_key=KEY, max_retries=0)
ant = anthropic.Anthropic(base_url=BASE, api_key=KEY, max_retries=0)


def show(label, raw, body):
    print(f"=== {label}")
    print(f"HTTP {raw.status_code} x-litellm-response-cost={raw.headers.get('x-litellm-response-cost')}")
    print(body)


def run(label, fn):
    try:
        fn()
    except (openai.APIStatusError, anthropic.APIStatusError) as e:
        print(f"=== {label}")
        print(f"HTTP {e.status_code}")
        print(e.response.text[:400])


def chat():
    raw = oai.chat.completions.with_raw_response.create(
        model=MODEL, messages=[{"role": "user", "content": PROMPT}], extra_body=EXTRA
    )
    msg = raw.parse().choices[0].message
    show("/v1/chat/completions (control)", raw, f"content={msg.content!r} audio_b64_len={len(msg.audio.data) if msg.audio else None}")


def responses():
    raw = oai.responses.with_raw_response.create(model=MODEL, input=PROMPT, extra_body=EXTRA)
    parsed = raw.parse()
    show("/v1/responses", raw, f"status={parsed.status} output={json.dumps([o.model_dump() for o in parsed.output])[:200]} usage={parsed.usage}")


def messages():
    raw = ant.messages.with_raw_response.create(
        model=MODEL, max_tokens=256, messages=[{"role": "user", "content": PROMPT}], extra_body=EXTRA
    )
    parsed = raw.parse()
    show("/v1/messages", raw, f"content={json.dumps([c.model_dump() for c in parsed.content])[:200]} usage={parsed.usage}")


def completions():
    raw = oai.completions.with_raw_response.create(model=MODEL, prompt=PROMPT, max_tokens=256, extra_body=EXTRA)
    parsed = raw.parse()
    show("/v1/completions", raw, f"text={parsed.choices[0].text!r} usage={parsed.usage}")


for label, fn in (("/v1/chat/completions (control)", chat), ("/v1/responses", responses), ("/v1/messages", messages), ("/v1/completions", completions)):
    run(label, fn)
template_client.py
import os
import sys

import openai

DROP = {"drop_params": True} if sys.argv[1:] == ["drop"] else {}
oai = openai.OpenAI(base_url=f"{os.environ['PROXY']}/v1", api_key=os.environ["LITELLM_MASTER_KEY"], max_retries=0)
print(f"=== /v1/responses, prompt_id=spoken-answer {DROP}")
try:
    raw = oai.responses.with_raw_response.create(
        model="gemini-flash", input="Say: have a wonderful day", extra_body={"prompt_id": "spoken-answer", **DROP}
    )
    parsed = raw.parse()
    print(f"HTTP {raw.status_code} x-litellm-response-cost={raw.headers.get('x-litellm-response-cost')}")
    print(f"status={parsed.status} output_text={parsed.output_text[:120]!r} usage_out={parsed.usage.output_tokens}")
except openai.APIStatusError as e:
    print(f"HTTP {e.status_code}")
    print(e.response.text[:400])
Before (f69cbe5), lines cut at 240 characters
--- clients.py gemini-tts
=== /v1/chat/completions (control)
HTTP 200 x-litellm-response-cost=0.000742
content=None audio_b64_len=220200
=== /v1/responses
HTTP 200 x-litellm-response-cost=0.000652
status=completed output=[] usage=ResponseUsage(input_tokens=8, input_tokens_details=InputTokensDetails(cached_tokens=0, audio_tokens=None, cached_tokens_details=None, image_tokens=None, text_tokens=8, video_tokens=None), output_tokens=72, o
=== /v1/messages
HTTP 200 x-litellm-response-cost=0.000733
content=[] usage=Usage(cache_creation=None, cache_creation_input_tokens=None, cache_read_input_tokens=None, inference_geo=None, input_tokens=8, output_tokens=81, server_tool_use=None, service_tier=None)
=== /v1/completions
HTTP 200 x-litellm-response-cost=0.000715
text=None usage=CompletionUsage(completion_tokens=79, prompt_tokens=8, total_tokens=87, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=79, reasoning_tokens=None, rejected_prediction_tokens=No
--- clients.py gemini-flash
=== /v1/chat/completions (control)
HTTP 200 x-litellm-response-cost=0.0005160000000000001
content='Have a wonderful day! 😊✨' audio_b64_len=None
=== /v1/responses
HTTP 200 x-litellm-response-cost=0.0007035
status=completed output=[{"id": "msg_f00b5cdf-9c74-4de0-b715-6a20d9837970", "content": [{"annotations": [], "text": "Have a wonderful day! \u2600\ufe0f\ud83d\ude0a", "type": "output_text", "logprobs": null}], "role": "assist usage=ResponseU
=== /v1/messages
HTTP 200 x-litellm-response-cost=0.00089475
content=[{"citations": null, "text": "Have a wonderful day! \u2600\ufe0f\u2728 Wishing you lots of smiles and good vibes today! \ud83d\ude0a\ud83c\udf89", "type": "text"}] usage=Usage(cache_creation=None, cache_creation_input_tokens=None, c
=== /v1/completions
HTTP 200 x-litellm-response-cost=0.00064725
text='Have a wonderful day! 😊✨☀️' usage=CompletionUsage(completion_tokens=171, prompt_tokens=8, total_tokens=179, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=163, re
--- clients.py gemini-flash drop
=== /v1/chat/completions (control)
HTTP 200 x-litellm-response-cost=0.0009922499999999999
content='Have a wonderful day! ☀️✨ Wishing you lots of joy, smiles, and great moments today! 😄🎉' audio_b64_len=None
=== /v1/responses
HTTP 200 x-litellm-response-cost=0.0008872500000000001
status=completed output=[{"id": "msg_be27c8d3-77fa-44dc-a20e-1519a2562fb3", "content": [{"annotations": [], "text": "Have a *wonderful* day! \u2600\ufe0f\u2728\ud83d\ude0a", "type": "output_text", "logprobs": null}], "role": usage=ResponseU
=== /v1/messages
HTTP 200 x-litellm-response-cost=0.000711
content=[{"citations": null, "text": "Have a truly wonderful and fantastic day! \u2600\ufe0f\u2728\ud83d\ude0a", "type": "text"}] usage=Usage(cache_creation=None, cache_creation_input_tokens=None, cache_read_input_tokens=None, inference_geo
=== /v1/completions
HTTP 200 x-litellm-response-cost=0.00070725
text='Have a wonderful day! ☀️✨ Wishing you lots of smiles and joy today! 😊' usage=CompletionUsage(completion_tokens=187, prompt_tokens=8, total_tokens=195, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, 
--- template_client.py
=== /v1/responses, prompt_id=spoken-answer {}
HTTP 200 x-litellm-response-cost=0.00126975
status=completed output_text='Have a wonderful day filled with bright smiles, warm sunshine, and endless joy!' usage_out=336
--- template_client.py drop
=== /v1/responses, prompt_id=spoken-answer {'drop_params': True}
HTTP 200 x-litellm-response-cost=0.0011647500000000002
status=completed output_text='Have a wonderful day filled with joy, sunshine, and lots of smiles!' usage_out=308
After (f851cb5), lines cut at 240 characters
--- clients.py gemini-tts
=== /v1/chat/completions (control)
HTTP 200 x-litellm-response-cost=0.000778
content=None audio_b64_len=230440
=== /v1/responses
HTTP 400
{"error":{"message":"litellm.UnsupportedParamsError: gemini/gemini-3.8-flash-tts returns audio, which /v1/responses cannot carry. Call /v1/chat/completions to get the audio.\n\nLiteLLM: model group 'gemini-tts' failed with the error above. 
=== /v1/messages
HTTP 400
{"type":"error","error":{"type":"invalid_request_error","message":"litellm.UnsupportedParamsError: gemini/gemini-3.8-flash-tts returns audio, which /v1/messages cannot carry. Call /v1/chat/completions to get the audio.\n\nLiteLLM: model gro
=== /v1/completions
HTTP 400
{"error":{"message":"litellm.UnsupportedParamsError: gemini/gemini-3.8-flash-tts returns audio, which /v1/completions cannot carry. Call /v1/chat/completions to get the audio.\n\nLiteLLM: model group 'gemini-tts' failed with the error above
--- clients.py gemini-flash
=== /v1/chat/completions (control)
HTTP 200 x-litellm-response-cost=0.0009285000000000001
content='Have a wonderful day! 😄✨☀️' audio_b64_len=None
=== /v1/responses
HTTP 400
{"error":{"message":"litellm.UnsupportedParamsError: The request asks gemini/gemini-3.8-flash for audio through modalities, which /v1/responses cannot carry. Leave out modalities, or set drop_params: true to send the request without it. If 
=== /v1/messages
HTTP 400
{"type":"error","error":{"type":"invalid_request_error","message":"litellm.UnsupportedParamsError: The request asks gemini/gemini-3.8-flash for audio through modalities, which /v1/messages cannot carry. Leave out modalities, or set drop_par
=== /v1/completions
HTTP 400
{"error":{"message":"litellm.UnsupportedParamsError: The request asks gemini/gemini-3.8-flash for audio through modalities, which /v1/completions cannot carry. Leave out modalities, or set drop_params: true to send the request without it. I
--- clients.py gemini-flash drop
=== /v1/chat/completions (control)
HTTP 200 x-litellm-response-cost=0.0007785
content='Have a wonderful day! 😊☀️✨' audio_b64_len=None
=== /v1/responses
HTTP 200 x-litellm-response-cost=0.000756
status=completed output=[{"id": "msg_7536291d-e48b-4f8d-bbe0-80cb2930fcd4", "content": [{"annotations": [], "text": "Have a wonderful day! \ud83d\ude0a\u2728", "type": "output_text", "logprobs": null}], "role": "assistant",  usage=ResponseU
=== /v1/messages
HTTP 200 x-litellm-response-cost=0.0007972500000000001
content=[{"citations": null, "text": "Have a wonderful day! \u2600\ufe0f\u2728\ud83d\ude0a", "type": "text"}] usage=Usage(cache_creation=None, cache_creation_input_tokens=None, cache_read_input_tokens=None, inference_geo=None, input_tokens=
=== /v1/completions
HTTP 200 x-litellm-response-cost=0.00075975
text='Have a wonderful day! 😊✨ Hope it’s filled with lots of smiles and great moments!' usage=CompletionUsage(completion_tokens=201, prompt_tokens=8, total_tokens=209, completion_tokens_details=CompletionTokensDetails(accepted_prediction_to
--- template_client.py
=== /v1/responses, prompt_id=spoken-answer {}
HTTP 400
{"error":{"message":"litellm.UnsupportedParamsError: The request asks gemini/gemini-3.8-flash for audio through modalities, which /v1/responses cannot carry. Leave out modalities, or set drop_params: true to send the request without it. If 
--- template_client.py drop
=== /v1/responses, prompt_id=spoken-answer {'drop_params': True}
HTTP 200 x-litellm-response-cost=0.00099225
status=completed output_text='Have a wonderful day filled with lots of smiles, sunshine, and happiness!' usage_out=262

Type

🐛 Bug Fix

Caveats (if any)

Copied from #49960

Medium

  • Text models asked for audio now get 400 on these endpoints
    • Gemini Flash sent modalities with "audio" answered 200 with text before. It answers 400 now
    • This is on purpose and follows the drop_params convention. drop_params: true brings back the old answer
  • Lyria's music clip is still dropped without notice on these endpoints
    • They answer 200 with only the lyrics. A follow-up ticket tracks it

Low

  • A prompt template's audio or modalities skips the check on /v1/messages
    • The template is applied after the check, so Gemini still gets them, as before this PR. A follow-up ticket tracks it
    • A template that switches a /v1/completions call to a Gemini TTS model skips the check too, the same as on main
  • With router fallbacks set, a refused call goes to the fallback model
    • fallback_on_unsupported_params defaults to true, so "nothing is billed" holds only when no fallback is configured
  • The refusal message can name the wrong endpoint or the wrong params
    • /v1/interactions callers on bridged providers read "/v1/responses cannot carry"
    • When audio or modalities comes from a deployment's litellm_params, the caller is told to leave out params they never sent
  • SDK extra_body audio on litellm.responses() skips the check
    • The upstream still receives modalities: ["text", "audio"] and audio

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
Bugbot summary

[!NOTE]
Medium Risk
Intentionally changes API behavior (200 → 400) on three public endpoints and affects billing/spend logging when audio is requested; mitigated by drop_params and unchanged /v1/chat/completions audio support.

Overview
Adds bridged_audio_output_request so /v1/responses, /v1/messages, and /v1/completions reject or sanitize audio before any upstream call when they bridge to chat/completions. Gemini/Vertex TTS models get 400 with guidance to use /v1/chat/completions; requests that ask for audio via audio or modalities get the same unless drop_params (or related drop settings) strip those fields first.

The check is wired into the Responses chat bridge, Anthropic messages bridge, and text completion path, plus a small is_gemini_tts_model helper. Integration tests now expect refusal instead of empty success, and new unit tests cover refuse vs drop vs pass-through behavior.

Reviewed by Cursor Bugbot for commit f851cb5. Bugbot is set up for automated code reviews on this repo. Configure here.

…ons before the provider call

Backport of BerriAI#49960 to lts/1.108.x, folding its commits into one adapted commit

The /v1/messages check goes in litellm/llms/anthropic/pass_through/messages/handler.py, where this line keeps the chat bridge. The line has no litellm.utils.is_gemini_tts_model, so this adds the same name check main got in BerriAI#31915. text_completion keeps the line's **optional_params spread

The test fixture drops register_model's add_to_provider_model_sets flag, which this line does not have

Cherry-picked from ec882be, c37c252, 9b6b65e, 16255e8, 675bf5d, 3d505a2, 22777c8, 3c5ed0a, a345bc4 (litellm_fix_gemini_audio_bridges)
…rt_49960_lts_1_108_x

# Conflicts:
#	litellm/responses/main.py
@zoveki
zoveki requested a review from a team November 23, 2026 07:02
@veria-ai

veria-ai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects audio requests across three public API bridges.

Fix the template-selected TTS bypass before merging

Findings

  1. P1 Templates bypass the audio refusal ▶
  2. P2 Tests leave shared model entries ▶

Summary

Adds a shared audio check to the chat-completions bridges behind /v1/responses, /v1/messages, and /v1/completions. Gemini TTS is refused, while explicit audio requests are refused or stripped when drop_params is enabled

The /v1/completions check misses models selected later by a prompt template. The new unit fixture also leaves synthetic model entries in the shared catalog

Acknowledgments by zoveki were excluded from findings. These cover intentional text-model refusals, upstreams that ignore modalities, native OpenAI route differences, Lyria audio loss, Messages template parameters, router fallback billing, misleading endpoint or parameter names, SDK extra_body bypasses, malformed modalities, mock-response differences, and the singer-model test gap. Reasons supplied were intentional behavior, existing native routing, malformed or test-only inputs, or deferred follow-up work

  • The three chat-bridged endpoints stop requests for audio they cannot return.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Bridged request] --> B[Shared audio check]
    B --> C{Audio output?}
    C -->|Gemini TTS| D[Return 400]
    C -->|Explicit audio| E{drop_params enabled?}
    E -->|No| D
    E -->|Yes| F[Remove audio request]
    C -->|No| G[Call completion]
    F --> G
    G --> H[Apply prompt template]
    H --> I[Call final model]
    I --> J[Convert reply to caller format]
Loading

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/lts..." · Reviewed by Greptile

Comment thread litellm/main.py
Comment on lines +8024 to +8026
completion_kwargs: Final = bridged_audio_output_request(kwargs, _model, custom_llm_provider)
if isinstance(completion_kwargs, AudioOnlyModel | AudioRequested):
raise_audio_output_refusal(completion_kwargs, "/v1/completions")

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 Templates bypass the audio refusal

text_completion checks the requested model before completion applies prompt templates. A template can then replace a text model with a Gemini TTS model without another check. The provider call still runs, and the caller gets empty text with billed usage. Check the final model after the template is applied

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.

Same order as main, where #49960 merged. A template picking a TTS model behaves as before this PR. A follow-up ticket tracks it

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.

Got it — that makes sense. Since this is a backport and matches main's behavior exactly, keeping the same template ordering is correct. The Low caveat documents it, and the follow-up ticket will address it properly.

Comment on lines +98 to +108
litellm.register_model(
{
SINGER_MODEL: {"litellm_provider": "gemini", "mode": "chat", "supported_output_modalities": ["audio"]},
VOICE_MODEL: {
"litellm_provider": "custom_openai",
"mode": "chat",
"supported_output_modalities": ["text", "audio"],
},
},
persist_across_reloads=False,
)

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.

P2 Tests leave shared model entries

The autouse fixture adds two models to litellm.model_cost but never removes them. persist_across_reloads=False only disables replay after a reload. Shared cleanup restores the same dictionary, so later tests still see these entries and can depend on test order. Restore the entries during teardown

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.

This fixture matches main's, which merged with #49960. The cleanup goes to main first and then this line, and a follow-up ticket tracks it

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.

Got it — matching main's fixture behavior makes sense for a backport. The cleanup can go through both branches together via the follow-up.

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.53086% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/litellm_core_utils/bridged_audio_output.py 96.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

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.

✅ 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 f851cb5. Configure here.

@mateo-berri mateo-berri left a comment

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.

LGTM

@mateo-berri
mateo-berri merged commit 127bd31 into BerriAI:lts/1.108.x Nov 23, 2026
64 checks passed
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.

2 participants