Skip to content

fix(hosted_vllm,azure): leave the caller's messages untouched when building the chat request on lts/1.108.x (#51841) - #53972

Merged
mateo-berri merged 3 commits into
BerriAI:lts/1.108.xfrom
izzybn:litellm_backport_51841_lts_1_108_x
Nov 24, 2026
Merged

mateo-berri merged 3 commits into
BerriAI:lts/1.108.xfrom
izzybn:litellm_backport_51841_lts_1_108_x

Conversation

@izzybn

@izzybn izzybn commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

This brings #51841 to lts/1.108.x. hosted vLLM and Azure chat calls now build their own copies instead of editing the caller's messages, so a fallback or an app that reuses its history sends what the caller wrote, and each provider still gets the same request. On this line the video fallbacks #51841 fixed on main already work, and the visible fix is that a repeated Azure image request now hits the response cache

Details

TLDR

Problem this solves:

  • Azure rewrote the caller's image_url, file, and function_call parts
  • So a repeated Azure image request missed the response cache every time
  • hosted vLLM rewrote the caller's video file part and assistant turns

How it solves it:

Main commit LTS commit
db6d0d8 57e664d
fb548ad b42f9ae
f4cfe99 2442f28

The first pick is clean. The test picks add the imports the line's test files lack and drop import asyncio once the async test is gone

User Flow

Before: a developer who asks an Azure model about the same image twice pays for every call, even with the proxy's response cache on

  1. The proxy admin turns on cache: true with a local cache for the Azure model azure-image
  2. The developer sends POST https://litellm-domain/v1/chat/completions with a text part and an image_url given as a plain data URL string
  3. They send the same request two more times
  4. Each answer has a new id and its own x-litellm-response-cost, so Azure ran and billed all three

After: the repeats come back from the cache

  1. The proxy admin turns on cache: true with a local cache for the Azure model azure-image
  2. The developer sends POST https://litellm-domain/v1/chat/completions with a text part and an image_url given as a plain data URL string
  3. They send the same request two more times
  4. The second and third answers carry the first answer's id and an x-litellm-cache-key header, in about 10 ms

Relevant issues

LTS twin of #51841

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

Before is the line tip and merge base 703ff66da9, and After is the branch tip 2442f28a95. The line moved on to a90ec12cb4 after these runs, but its new commits touch other functions and merge cleanly

Case Before After
Azure image sent 3 times, cache on 3 Azure calls 1 Azure call, 2 cache hits
Azure down, null function_call.arguments, to gpt-4.1-mini 200 500, OpenAI's 400 inside
Video with format, Azure down to Gemini real clip real clip
Video by URL, vLLM to Gemini real clip real clip
Video as base64, vLLM to Gemini real clip real clip
Real vLLM, tool calls 200 200

The video rows already pass on this line through other line commits, so here they only check that nothing broke. Both new regression tests fail at 703ff66da9 and pass at 2442f28a95, 1865 tests in the touched suites pass, and make check passes

Setup (both legs)

Configs, start command, bodies, media server, and runners

Env vars are GEMINI_API_KEY, AZURE_AI_API_BASE, AZURE_AI_API_KEY, OPENAI_API_KEY, and LITELLM_MASTER_KEY. Each leg starts a proxy from its own tree with cd <tree> && PYTHONPATH=<tree> .venv/bin/litellm --config <config> --port <port> --num_workers 2. The cache leg uses --num_workers 1, since each worker keeps its own local cache

config_cache.yaml

model_list:
  - model_name: azure-image
    litellm_params:
      model: azure/gpt-4.1-2025-04-14
      api_base: os.environ/AZURE_AI_API_BASE
      api_key: os.environ/AZURE_AI_API_KEY
      api_version: "2025-04-01-preview"

litellm_settings:
  cache: true
  cache_params:
    type: local

config_azure.yaml. Azure points at a closed port, so every Azure call falls back

model_list:
  - model_name: azure-down-video
    litellm_params:
      model: azure/gpt-4.1-2025-04-14
      api_base: http://127.0.0.1:9
      api_key: unused
      api_version: "2025-04-01-preview"
  - model_name: gemini-video
    litellm_params:
      model: gemini/gemini-flash-latest
      api_key: os.environ/GEMINI_API_KEY
  - model_name: azure-down-legacy
    litellm_params:
      model: azure/gpt-4.1-2025-04-14
      api_base: http://127.0.0.1:9
      api_key: unused
      api_version: "2025-04-01-preview"
  - model_name: openai-legacy
    litellm_params:
      model: openai/gpt-4.1-mini
      api_key: os.environ/OPENAI_API_KEY

router_settings:
  num_retries: 0
  fallbacks:
    - azure-down-video: ["gemini-video"]
    - azure-down-legacy: ["openai-legacy"]

litellm_settings:
  user_url_allowed_hosts: ["127.0.0.1:27739"]

config.yaml. vLLM points at a closed port, so every vLLM call falls back

model_list:
- model_name: vllm-video
  litellm_params:
    model: hosted_vllm/Qwen/Qwen2.5-VL-7B-Instruct
    api_base: http://127.0.0.1:20989/v1
- model_name: gemini-video
  litellm_params:
    model: gemini/gemini-flash-latest
    api_key: os.environ/GEMINI_API_KEY
router_settings:
  num_retries: 0
  fallbacks:
  - vllm-video:
    - gemini-video

body_cache_azure-image.json, a 32x32 red PNG

{"model":"azure-image","max_tokens":20,"messages":[{"role":"user","content":[{"type":"text","text":"What color is this image? Answer in one word."},{"type":"image_url","image_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR4nO3NsQ0AAAzCMP5/un0CNkuZ41wybXsHAAAAAAAAAAAAxR4yw/wuPL6QkAAAAABJRU5ErkJggg=="}]}]}

body_az_azure-down-legacy.json (the control body_az_openai-legacy.json swaps in "model":"openai-legacy")

{"model":"azure-down-legacy","max_tokens":300,"functions":[{"name":"get_current_city","parameters":{"type":"object","properties":{}}}],"messages":[{"role":"user","content":"What city am I in?"},{"role":"assistant","content":null,"function_call":{"name":"get_current_city","arguments":null}},{"role":"function","name":"get_current_city","content":"Copenhagen"}]}

body_az_azure-down-video.json (the control swaps in "model":"gemini-video"). The media server answers the 1 MB Big Buck Bunny clip as application/octet-stream at an extensionless URL, so only format says it is a video

{"model":"azure-down-video","max_tokens":300,"messages":[{"role":"user","content":[{"type":"text","text":"Describe the attached video in one sentence. If no video is attached, reply exactly: NO VIDEO ATTACHED"},{"type":"file","file":{"file_id":"http://127.0.0.1:27739/clip","format":"video/mp4"}}]}]}

body_url_vllm-video.json (the control swaps in "model":"gemini-video"). The base64 bodies send the same clip as "file_data": "data:video/mp4;base64,..." with the same format

{"model":"vllm-video","max_tokens":300,"messages":[{"role":"user","content":[{"type":"text","text":"Describe the attached video in one sentence. If no video is attached, reply exactly: NO VIDEO ATTACHED"},{"type":"file","file":{"file_id":"https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4","format":"video/mp4"}}]}]}

media_server.py, run as python media_server.py 27739 clip.mp4

import http.server
import sys
from pathlib import Path

CLIP = Path(sys.argv[2]).read_bytes()


class Handler(http.server.BaseHTTPRequestHandler):
    def do_GET(self) -> None:
        self.send_response(200)
        self.send_header("Content-Type", "application/octet-stream")
        self.send_header("Content-Length", str(len(CLIP)))
        self.end_headers()
        self.wfile.write(CLIP)


http.server.ThreadingHTTPServer(("127.0.0.1", int(sys.argv[1])), Handler).serve_forever()

run_cases_cache.sh

#!/bin/zsh
cd ${0:a:h}
K=$LITELLM_MASTER_KEY
typeset -A port=(before 32078 after 20859)
for leg in before after; do
  P=$port[$leg]
  for n in 1 2 3; do
    out=${leg}_cache_call$n
    code=$(curl -s -m 120 -D $out.hdr -o $out.json -w '%{http_code} %{time_total}s' -H "Authorization: Bearer $K" -H 'Content-Type: application/json' http://127.0.0.1:$P/v1/chat/completions -d @body_cache_azure-image.json)
    print -r -- "== $leg call $n $code"
    grep -i '^\(x-litellm-cache-key\|x-litellm-response-cost\)' $out.hdr | tr -d '\r'
    jq -c 'if .error then {error: (.error.message | .[0:300])} else {id, content: .choices[0].message.content} end' $out.json
    sleep 2
  done
done

The cache key header value is shown as <present> below

run_cases_azure.sh

#!/bin/zsh
cd ${0:a:h}
K=$LITELLM_MASTER_KEY
typeset -A port=(before 27872 after 21361)
for leg in before after; do
  P=$port[$leg]
  for c in azure-down-video gemini-video azure-down-legacy openai-legacy; do
    out=${leg}_az_$c
    code=$(curl -s -m 240 -D $out.hdr -o $out.json -w '%{http_code}' -H "Authorization: Bearer $K" -H 'Content-Type: application/json' http://127.0.0.1:$P/v1/chat/completions -d @body_az_$c.json)
    print -r -- "== $leg $c $code"
    grep -i '^\(x-litellm-model-group\|x-litellm-attempted-fallbacks\)' $out.hdr | tr -d '\r'
    jq -c 'if .error then {error: (.error.message | .[0:300])} else {model, content: .choices[0].message.content, prompt_tokens: .usage.prompt_tokens} end' $out.json
  done
done

run_cases.sh

#!/bin/zsh
cd ${0:a:h}
K=$LITELLM_MASTER_KEY
typeset -A port=(before 23940 after 25967)
for leg in before after; do
  P=$port[$leg]
  for c in url data; do
    for m in vllm-video gemini-video; do
      out=${leg}_${c}_${m}
      code=$(curl -s -m 240 -D $out.hdr -o $out.json -w '%{http_code}' -H "Authorization: Bearer $K" -H 'Content-Type: application/json' http://127.0.0.1:$P/v1/chat/completions -d @body_${c}_${m}.json)
      print -r -- "== $leg $c $m $code"
      grep -i '^\(x-litellm-model-group\|x-litellm-attempted-fallbacks\)' $out.hdr | tr -d '\r'
      jq -c '{model, content: .choices[0].message.content, prompt_tokens_details: (.usage.prompt_tokens_details | {text_tokens, video_tokens})}' $out.json
    done
  done
done

config_vllm.yaml. vLLM is a real vLLM 0.29.0 server on CPU serving Qwen3.5-2B, started with docker run -d -p 127.0.0.1:21871:8000 public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:v0.29.0 Qwen/Qwen3.5-2B --max-model-len 16384 --limit-mm-per-prompt '{"image":0,"video":0}' --reasoning-parser qwen3 --enable-auto-tool-choice --tool-call-parser qwen3_coder. Both legs use --num_workers 1 and the master key sk-local-vllm-qa

model_list:
  - model_name: vllm-chat
    litellm_params:
      model: hosted_vllm/Qwen/Qwen3.5-2B
      api_base: http://127.0.0.1:21871/v1

router_settings:
  num_retries: 0

body_tool_call.json

{"model":"vllm-chat","max_tokens":300,"chat_template_kwargs":{"enable_thinking":false},"messages":[{"role":"user","content":"What is the weather in Paris right now? Use the get_weather tool."}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get the current weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}

body_tool_use_history.json

{"model":"vllm-chat","max_tokens":300,"chat_template_kwargs":{"enable_thinking":false},"messages":[{"role":"user","content":"What is the weather in Paris right now? Use the get_weather tool."},{"role":"assistant","thinking_blocks":[{"type":"thinking","thinking":"I should call get_weather for Paris.","signature":"sig-1"}],"content":[{"type":"text","text":"Let me check the weather in Paris."},{"type":"tool_use","id":"call_paris_1","name":"get_weather","input":{"city":"Paris"}}]},{"role":"tool","tool_call_id":"call_paris_1","content":"{\"city\":\"Paris\",\"temp_c\":14,\"sky\":\"light rain\"}"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get the current weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}

body_tool_calls_history.json

{"model":"vllm-chat","max_tokens":300,"chat_template_kwargs":{"enable_thinking":false},"messages":[{"role":"user","content":"What is the weather in Paris right now? Use the get_weather tool."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_paris_2","type":"function","function":{"name":"get_weather","arguments":"{\"city\":\"Paris\"}"}}]},{"role":"tool","tool_call_id":"call_paris_2","content":"{\"city\":\"Paris\",\"temp_c\":14,\"sky\":\"light rain\"}"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get the current weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}

run_cases_vllm.sh

#!/bin/zsh
cd ${0:a:h}
K=$LITELLM_MASTER_KEY
typeset -A port=(before $1 after $2)
for leg in before after; do
  P=$port[$leg]
  for c in tool_call tool_use_history tool_calls_history; do
    out=${leg}_$c
    code=$(curl -s -m 600 -o $out.json -w '%{http_code}' -H "Authorization: Bearer $K" -H 'Content-Type: application/json' http://127.0.0.1:$P/v1/chat/completions -d @body_$c.json)
    print -r -- "== $leg $c $code"
    jq -c 'if .error then {error: (.error.message | .[0:300])} else {model, content: .choices[0].message.content, tool_calls: [.choices[0].message.tool_calls[]? | .function]} end' $out.json
  done
done

Before (703ff66da9)

Azure image sent 3 times, cache on

  1. zsh run_cases_cache.sh, before half. Three different ids, each billed
== before call 1 200 2.233166s
x-litellm-response-cost: 0.0005539999999999999
{"id":"chatcmpl-EnY5LnxQCgfi5EIBE2WWkXwMlYl0q","content":"Red"}
== before call 2 200 1.143596s
x-litellm-response-cost: 0.0005619999999999999
{"id":"chatcmpl-EnY5OnLByv8QzpG4P6MXH6cW7qRXI","content":"Red."}
== before call 3 200 2.217213s
x-litellm-response-cost: 0.0005539999999999999
{"id":"chatcmpl-EnY5SLMonksryGFpgibgChqu6a2R7","content":"Red"}

Azure down, null function_call.arguments, to gpt-4.1-mini

  1. zsh run_cases_azure.sh, before half. The fallback answers because Azure's rewrite of the caller's message leaked into it, while a direct call gets OpenAI's 400
Fallback 200, direct call 400
== before azure-down-legacy 200
x-litellm-model-group: openai-legacy
x-litellm-attempted-fallbacks: 1
{"model":"gpt-4.1-mini-2025-04-14","content":"You are in Copenhagen.","prompt_tokens":59}
== before openai-legacy 400
{"error":"litellm.BadRequestError: OpenAIException - Invalid type for 'messages[1].function_call.arguments': expected a string, but got null instead.\n\nLiteLLM: model group 'openai-legacy' failed with the error above and no fallback model group was found for it, so the request was not retried on another model."}

Video fallbacks

Azure down to Gemini, then vLLM to Gemini by URL and base64, each with its direct control
== before azure-down-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 1
{"model":"gemini-3.8-flash","content":"In an animated forest clearing bathed in sunlight, gentle breezes rustle the leaves of a large tree rooted above a burrow in a grassy knoll.","prompt_tokens":684}
== before gemini-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 0
{"model":"gemini-video","content":"An animated 3D scene depicts a tree atop a grassy knoll with a burrow entrance as leaves rustle and the grassy meadow gently sways in the sunlight.","prompt_tokens":684}
== before url vllm-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 1
{"model":"gemini-3.8-flash","content":"An animated forest clearing features a sunlit grassy mound with a burrow beneath a leafy tree as a gentle breeze rustles the foliage.","prompt_tokens_details":{"text_tokens":29,"video_tokens":660}}
== before url gemini-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 0
{"model":"gemini-video","content":"In this animated scene, sunlight filters through the trees to illuminate a grassy mound with a burrow beneath a leafy tree in a peaceful forest clearing.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}
== before data vllm-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 1
{"model":"gemini-3.8-flash","content":"A vibrant, animated forest glade features sunlight filtering onto a grassy hill with a burrow nestled beneath a leafy tree.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}
== before data gemini-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 0
{"model":"gemini-video","content":"A gentle breeze rustles the sunlit grass and leaves around a burrow beneath a large tree in an animated forest.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}

Real vLLM, tool calls

  1. zsh run_cases_vllm.sh 20336 23457, before half. All three answer 200
A tool call, then history with a `tool_use` content turn carrying `thinking_blocks`, then history with a `tool_calls` turn
== before tool_call 200
{"model":"vllm-chat","content":null,"tool_calls":[{"arguments":"{\"city\": \"Paris\"}","name":"get_weather"}]}
== before tool_use_history 200
{"model":"vllm-chat","content":"The weather in Paris right now is light rain with a temperature of 14°C.","tool_calls":[]}
== before tool_calls_history 200
{"model":"vllm-chat","content":"The weather in Paris right now is 14°C (57°F) with light rain.","tool_calls":[]}

After (2442f28a95)

Azure image sent 3 times, cache on

  1. zsh run_cases_cache.sh, after half. Calls 2 and 3 return call 1's id from the cache
== after call 1 200 2.348460s
x-litellm-response-cost: 0.0005539999999999999
{"id":"chatcmpl-EnY5WNfual1yoexywGeyaGrUHSdXu","content":"Red"}
== after call 2 200 0.015274s
x-litellm-cache-key: <present>
{"id":"chatcmpl-EnY5WNfual1yoexywGeyaGrUHSdXu","content":"Red"}
== after call 3 200 0.009505s
x-litellm-cache-key: <present>
{"id":"chatcmpl-EnY5WNfual1yoexywGeyaGrUHSdXu","content":"Red"}

Azure down, null function_call.arguments, to gpt-4.1-mini

  1. zsh run_cases_azure.sh, after half. The fallback now gets the caller's null and answers like the direct call, see Caveats
Fallback 500 with OpenAI's 400 inside, direct call 400
== after azure-down-legacy 500
{"error":"litellm.APIConnectionError: AzureException APIConnectionError - Connection error.\n\nLiteLLM: model group 'azure-down-legacy' failed with the error above. Fallback to openai-legacy also failed: litellm.BadRequestError: OpenAIException - Invalid type for 'messages[1].function_call.arguments': expected "}
== after openai-legacy 400
{"error":"litellm.BadRequestError: OpenAIException - Invalid type for 'messages[1].function_call.arguments': expected a string, but got null instead.\n\nLiteLLM: model group 'openai-legacy' failed with the error above and no fallback model group was found for it, so the request was not retried on another model."}

Video fallbacks

Azure down to Gemini, then vLLM to Gemini by URL and base64, each with its direct control
== after azure-down-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 1
{"model":"gemini-3.8-flash","content":"In an animated forest clearing, gentle sunlight and a soft breeze filter through the trees onto a grassy mound with a burrow beneath a tree's roots.","prompt_tokens":684}
== after gemini-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 0
{"model":"gemini-video","content":"An animated, sunlit forest clearing features a large tree atop a grassy knoll with a burrow entrance tucked beneath its exposed roots as the grass and leaves gently sway in the breeze.","prompt_tokens":684}
== after url vllm-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 1
{"model":"gemini-3.8-flash","content":"An animated scene shows a sunlit forest clearing with a burrow tucked under the roots of a leafy tree on a grassy hill.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}
== after url gemini-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 0
{"model":"gemini-video","content":"In an animated sunlit forest clearing, a gentle breeze rustles the grass and leaves around a tree with a burrow nestled beneath its roots.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}
== after data vllm-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 1
{"model":"gemini-3.8-flash","content":"A lush, sunlit grassy clearing features an animated tree atop a grassy burrow in a peaceful forest setting.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}
== after data gemini-video 200
x-litellm-model-group: gemini-video
x-litellm-attempted-fallbacks: 0
{"model":"gemini-video","content":"An animated, sunlit forest clearing features a large tree atop a grassy mound with a burrow nestled beneath its roots.","prompt_tokens_details":{"text_tokens":24,"video_tokens":660}}

Real vLLM, tool calls

  1. zsh run_cases_vllm.sh 20336 23457, after half. All three answer 200
A tool call, then history with a `tool_use` content turn carrying `thinking_blocks`, then history with a `tool_calls` turn
== after tool_call 200
{"model":"vllm-chat","content":null,"tool_calls":[{"arguments":"{\"city\": \"Paris\"}","name":"get_weather"}]}
== after tool_use_history 200
{"model":"vllm-chat","content":"The weather in Paris right now is **light rain** with a temperature of **14°C**.","tool_calls":[]}
== after tool_calls_history 200
{"model":"vllm-chat","content":"The weather in Paris right now is **14°C** with **light rain**.","tool_calls":[]}

Type

🐛 Bug Fix

Caveats (if any)

Medium

Low

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
Message translation is on the hot path for fallbacks and response caching; fallbacks that previously depended on in-place rewrites now see the caller's original shapes (e.g. null function_call.arguments).

Overview
Azure and hosted vLLM chat transforms no longer modify the caller's messages in place. Each path now builds new message objects (via helpers like _azure_message / _vllm_assistant_message) while applying the same Azure/vLLM shaping—function_call.arguments, image_url/file parts, video file→video_url, assistant tool_use→tool_calls, and stripping thinking_blocks/reasoning_content.

Regression tests assert the transformed request matches expectations and that a deep-copied snapshot of the original list is unchanged after transform_request.

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

…ilding the chat request

hosted_vllm and Azure rewrote the caller's nested message objects while building the request, so a Router fallback reused the rewritten parts. A video file part reached a Gemini fallback as video_url, which Gemini drops. Both now build new message dicts and content parts and send the same request body as before

(cherry picked from commit db6d0d8)
@izzybn
izzybn requested a review from a team November 24, 2026 00:07
@veria-ai

veria-ai Bot commented Nov 24, 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 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous live-provider proof requirement addressed

Summary

Azure and hosted vLLM now build their provider-specific message changes without applying those changes to the caller's history. New tests check both the outgoing request and the original messages

The added live vLLM runs address the previous proof requirement. No new actionable issue was found

izzybn documents that fallbacks and callbacks now see the original messages rather than provider-specific edits. The description also notes that unrelated mutations in the existing OpenAI transform remain unchanged

  • Azure chat requests leave the caller's messages untouched.
  • Hosted vLLM requests leave the caller's messages untouched.

Reviews (2) · Last reviewed commit: "test(hosted_vllm): drop the async varian..." · Reviewed by Greptile

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.82353% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/llms/hosted_vllm/chat/transformation.py 98.11% 1 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 2442f28. Configure here.

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@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 8425d92 into BerriAI:lts/1.108.x Nov 24, 2026
63 of 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