Skip to content

feat(vertex_ai): add Meta Muse models on Vertex AI on lts/1.108.x - #53388

Merged
mateo-berri merged 65 commits into
BerriAI:lts/1.108.xfrom
zoveki:litellm_backport_50768_lts_1_108_x
Nov 25, 2026
Merged

mateo-berri merged 65 commits into
BerriAI:lts/1.108.xfrom
zoveki:litellm_backport_50768_lts_1_108_x

Conversation

@zoveki

@zoveki zoveki commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Add native Responses support for Meta Muse models on the 1.108 LTS line. This is the LTS twin of #50768, which merges first

Details

TLDR

Problem this solves:

  • Vertex Muse models lack catalog entries and native Responses routing on lts/1.108.x

How it solves it:

Backport checklist

Main to LTS commit map and line adaptations
Main commit LTS commit
f75a95b 2775fbe
dc392de 5e44cfe
9c86a2e 82bd092
96d1202 c290cb1
8adf612 82ba833, efad10a (line adaptation)
031badf 4c32c37
5ceac07 3df3700
6cb9596 83a8b5c
bd406c1 911cd3b
d945bbd ecd99cb
c780230 7936bb1
2b9a595 715d55f
931f52d 640f046 (adapted)
bede83a f1e9a15 (test conflict resolved)
6a89615 6bba3ea
e049c9f 9671040
1cc6faa 8c39fec (conflict resolved, the line has no scan-only tool path)
6a9bc26 203e150 (import conflict resolved)
6fa69f9 694d602 (conflict resolved)
d55647f 99e778f (conflict resolved, the line has no replay_tool_search)
d141c0e be9d6ec
1aefb27 e861e59 (tests only, as #50768's merge kept the earlier tool merge)
2d59f57 0f1e87a (the line's prompt caching check has no Responses path)
06d041a 53bb9e3
8571a9f 1e75a2e (tests only, as #50768's merge kept the earlier tool merge)
6474300 044ce7d (conflicts resolved, adds request_tools)
b0fb928 0fef6a7 (the line's prompt caching check has no Responses path)
7e46e6e 688c6aa
156965d a26c33f (conflicts resolved)
33488a3 b971b8c (conflicts resolved, stream wrapper response_cost port)
bf8f490 none, main only (the line has no client tool search or compaction replay)
a190d35 dc5f857 (adapted, cold storage rename only)
bdfb7a0 7dda5de (adapted, cold storage check only)
cd3be2d 11a6680 (conflicts resolved, keeps the line's completion_args)
cce8839 7877b27 (conflicts resolved, takes only the per-chunk rename)
df50a2e 20c8fef (conflict resolved, the line's map has no deferred top-level entries)
e3d6e52 cb22f5b
ce315d9 282bbbd (tests only, main-only tests left out)
53d8567 a4a8a1a (tests only)
fa20c18 f93e951 (tests only)
e04e89c d1404a3 (#48119, conflicts resolved in imports and test file context)
d05035c 3ffd90d (#54240, written on the line first)
a9cfa7b 17c03e2 (#54240, written on the line first)
298e7f1 2cc3ebc (#54240, tool merge and tests only)
d83c813 e83afb8 (#54240)
8dbceb3 614a6a6 (#54240, clean)
f8a5767 91579a6 (#54240, clean)
1706add 56593c6 (#54240, clean)
a7b15b5 21c3e3c (#54240, clean)
dd13130 5ec8d22 (#54240, clean)

User Flow

Before, a developer who adds a Vertex-hosted Muse model to the proxy gets an HTTP 500 instead of an answer

  1. They add vertex_ai/meta/muse-ember-1.0 to the proxy config as muse-ember-1.0 with vertex_location: global and Google service account credentials
  2. They send POST http://<proxy>/v1/chat/completions with {"model":"muse-ember-1.0","messages":[{"role":"user","content":"hi"}],"max_tokens":16}
  3. They get HTTP 500 Unknown partner model: meta/muse-ember-1.0. POST /v1/responses and POST /v1/messages fail too, and so do Wonder 1.0 and Spark 1.3

After, the same developer gets normal answers from all three Muse models on chat completions, responses and messages, with the cost tracked

  1. They send the same chat completions request with the same config
  2. They get HTTP 200 with a chat completion, token usage, and an x-litellm-response-cost header
  3. They send POST http://<proxy>/v1/responses with {"model":"muse-ember-1.0","input":"hi"}, streamed and not, and get HTTP 200 with a resp_... response or a response.completed event
  4. They send POST http://<proxy>/v1/messages with an Anthropic-shaped body and get HTTP 200 with a message response
  5. They call GET http://<proxy>/spend/logs?request_id=<id> and see each request under the configured model with its cost

Relevant issues

Partially addresses #51074, for the Meta publisher only

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

Vertex AI with #50768's setup, two 2-worker proxies per leg sharing Postgres and Redis

Last updated: 5ec8d22. H12 to H14 ran before at 91579a6 and after at 5ec8d22 (bound.md). C80 and H9 ran before at e83afb8 and after at 91579a6 (lts_r4.md), H6 to H8 before at 23af0e8 and after at e83afb8 (lts_r2.md), and the rest after at 742940a (lts52.md, lts51.md). Later picks touch only tool names, guardrail edits and per-call prices, so those results stay valid

Earlier commits

C75 and C76 failed at 82ae95f and passed at 20c8fef (lts_picks.md). The cold storage smoke, C73 and C74 failed before their picks and passed after (lts_cold.md, c73.md, c74.md). Runs at earlier heads are in lts43.md, lts_before.md, lts_after.md and lts_tip.md

Case Before After
C1 chat 500 200, cost header
C2 chat stream 500 200, usage chunk
C3 responses 500 200, cost header
C4 responses stream 500 all events
C5 messages 500 200
C6, C7 reasoning 400 200
C8 store=true 500, 500 400, then 200
C9 unlisted model 500 Vertex 404
C48 Codex TUI over /v1 error answers
C49 tool policy, long name 400 400
C51 Codex /v1 MCP tool error answers
C52 tool policy, colliding names gpt 200, Muse 500 200 for both, Muse calls no tool in C52b
C53 guardrail drops or edits right tool, Muse 500 right tool, both
C79, C80 stored long call name replay 400 on the OpenAI-compatible route 200, N-41
H4 guardrail edits one of two docs MCP servers 200, approval request 200, approval request
H5 custom guardrail blocks a replayed 68-character name 400 400
H6 to H8 guardrail drops one tool and edits another edit sent first edit keeps its slot
C80 prompts not stored, OpenAI-compatible and Bedrock 400 at turn 2 200, N-41
H9 guardrail drops one of three search functions request order returned order
H12 guardrail drops half of 400 search functions 200, health check under 0.1 s 200, health check under 0.1 s
H13, H14 guardrail drops a__b's c, named like a's b__c 200, sends a 200, sends a
Per-call prices on native Responses ignored at 7ab941f billed
C11 to C76 results

The line has no /backend-api/codex, so C46 does not apply

Case Before After
C11, C12 messages text, chat tool 500 200
C13 tool_choice required 500, 500 400, then 200
C14 tool_choice none 500 200
C15, C16 tool and messages streams no events all events, with usage
C17 messages tool 500 200
C18 background, drop_params 500 200
C19 deployment credentials 500 x3 200 x3
C20 us-central1 500, 500 400, 400
C21 previous_response_id 500, 500 400, then 200
C30 chat PDF 500 200
C31 token counting 404 x2 400 x2
C32 no meta/ prefix 500 500
C33 custom api_base 500 200
C35, C36 gateway api_base 500 200
C38 messages PDF 500 200
C39 to C41 effort, drop_params 500 200
C42 effort none 400 400, names it
C43 Ember effort max 400 200
C44, C45 publisher api_base 500 200
C47 SDK forced namespace tool call call
C50 shared shortened name 200 400
C53f, C55, C56 gpt 200, Muse 500 200 for both
C54 tools not a list 400 400
C57 to C59 shared full name 500 right member, both
C60, C62, C73, C74 long name in registry, logs full name full name
C61, C65, C68 Muse tools Vertex refuses 500 400, 200 with drop_params
C63, C64 client name map or 5 real name, charged real name, charged
C66 client name map, failed call declared name declared name
C67 replay after a long name 200 200
C69 Muse file_search, streamed chat 500 200, streamed
C70 replay, tools in additional_tools 200, 16 of 16 200, 16 of 16
C71 streamed file search spend 500 both calls billed
C75 project and location api_base 500 200
C76 sent name equals another bare name wrong tool right tool
C79 and C80 stored call replay
  1. Send turn 1 to proxy-1 on /v1/responses with the OpenAI SDK. Its input holds an earlier call to the 67-character joined name mcp__codex_apps__codex_document_control___get_document_tool_schemas, and the namespace's tools go once in tools and once in an additional_tools item. C80 also sends a note of about 4,800 characters, so the turn's spend row is cut short and the replay has to read the turn back from cold storage
  2. Wait until /spend/logs shows turn 1. For C80, also wait until it shows truncated with a cold storage key and the S3 bucket holds that object
  3. Send turn 2 to proxy-2 with previous_response_id

Each leg runs two 2-worker proxies sharing Postgres, Redis and an S3 cold store, with store_prompts_in_spend_logs: true and cold_storage_custom_logger: s3_v2, on custom_openai/gpt-5.4-mini against OpenAI and on Vertex AI gemini-3.8-flash. At the merge base 7ab941f, the OpenAI-compatible route answers HTTP 400 string too long. Expected a string with maximum length 64, but got a string with length 67 at turn 1 in both cases and both placements, since the line sends the joined name as is. At 3ffd90d, all eight turn 2 calls answer 200 with N-41. Vertex AI accepts the long name, so Gemini passes on both legs. C80 also ran at 742940a, the commit before 3ffd90d, where turn 1 answers 200 and turn 2 answers 400 for the 67-character name on the OpenAI-compatible route, and at 17c03e2, where all eight turn 2 calls answer 200 (lts_tip95.md)

The commands and output are in lts80.md in this gist

/live-pr-risk at 742940a, 3ffd90d, 95e495b and 8e2ba39

Base f5f4134 and head 742940a, each two 2-worker proxies sharing Postgres and Redis, with a forwarding recorder in front of api.openai.com and api.anthropic.com. Turn 1 goes to proxy 1 and later turns alternate proxies through previous_response_id

Cell Base Head
R1 Claude, long name, 3 turns, tools re-sent 200 200
R2 OpenAI-compatible, short name, 3 turns 200 200
R3 OpenAI-compatible, long name, 3 turns 400 at turn 2 200
R4 OpenAI-compatible, long name, turn 2 omits tools 400 at turn 2 200
R5 Claude, long name, turn 2 omits tools 200 200

Leaving out ids, message text and the model's thinking signatures, every recorded provider request is the same on both sides except the replayed history call's name, which head sends as the shortened name the tools declare. R2's short name is sent the same way on both sides. At 3ffd90d the cold storage replay ran live as C80 with a recorder in front of api.openai.com. The merge base declares and calls the 67-character name and gets 400, and head declares and calls the 64-character name and gets 200. The new rename has one caller, the replay, and does nothing unless the turn came from cold storage

For 17c03e2, the merge base 7ab941f, 3ffd90d and the tip 95e495b ran the same guardrail cells on /v1/responses with two MCP servers sharing a label, an MCP server beside a function, and two code_interpreter tools, each with a recorder in front of api.openai.com. Only R6, which is H4, differs. 3ffd90d answers 500 and sends nothing, while the merge base and the tip answer 200 and send the DeepWiki server alone at require_approval: always. The messages view change reaches only the Bedrock and semantic guard guardrails, which read message text and no tool names (risk53.md)

The guardrail cells, H4 and H5 match c9a0e74 at 8e2ba39 (lts_tip8e.md)

The commands and output for 742940a and 3ffd90d are in risk50.md in this gist

Before (7ab941f)

C1 the reporter's chat request

  1. Send it to proxy A
$ curl -sS -D /tmp/tmp.ZjdZ8AAijg -w '\nHTTP %{http_code}\n' http://127.0.0.1:26405/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d '{"model":"muse-ember-1.0","messages":[{"role":"user","content":"hi"}],"max_tokens":16}'; hdr
{"error":{"message":"litellm.InternalServerError: Vertex_aiException InternalServerError - Unknown partner model: meta/muse-ember-1.0\n\nLiteLLM: model group 'muse-ember-1.0' failed with the error above. No fallback was attempted.","type":"internal_server_error","param":null,"code":"500"}}
HTTP 500
x-litellm-call-id: 087750ef-c921-403d-8b10-6e424311e6b9
x-litellm-response-cost: 0

After (742940a)

C1 the reporter's chat request

  1. Send it to proxy A
$ curl -sS -D /tmp/tmp.qHmGYpLH4M -w '\nHTTP %{http_code}\n' http://127.0.0.1:31933/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d '{"model":"muse-ember-1.0","messages":[{"role":"user","content":"hi"}],"max_tokens":16}'; hdr
{"id":"resp_cfbbbcb206abb0db","created":1795303601,"model":"muse-ember-1.0","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"","role":"assistant","reasoning_items":[{"type":"reasoning","id":"rs_cfbbbcb206abb0db:rs_0","encrypted_content":"AAl7InYiOiIzIn0AjAokAGoEUL2KHwzJuGQWNwZEt8spBAC6fu-5zaQT3JXlzvKlNQEqEmQqYgoUCgz0C66vLLqf3eEofHsQnsrikAISMAooiYwhyCXyPGyLOuZqcVkeWjFH7mtUgz5Eab0-G8aNz_pU2--9SXnxTRDd2ZrCBxoYChB9fC-ovEa4ebXVxZLqM4nuEJDElOYM6Lyy78-8hsSgZ6cOCQvUPLzjUDBRLb4zc6guWoU3E-jPwWV5B9h2bVgD1ht_T5rp_uYpTw0VQjPCh7HQyZwvf7qmh7P93Co_hKlNbcd4wx1S_8GpkiRYYUNrRJXjIDslSZ9LvmyFXS6Lc6vCDe2jn1jVb669uMvDWKsG-N5nGHnirt1yLmz3-vO8MIzm__P7jnVureHcA__vVwCPzS8dvQQjqgxlJBzyOgL1W980TzVL2T1OVFjWLjYsLCDFdRrwl6_btTkzkv0GgyktYrdkPN9HLM84hSSfsEKz_G1oI3qQEkmh8X3eAXSZaZX8dmjSd11tjnEDHnE2NAw68TmfvCht9f8QrZqcSIUYbd4Oq_9Cidh9qJZSE9ZtcHw","summary":[]}]}}],"usage":{"completion_tokens":16,"prompt_tokens":9,"total_tokens":25,"completion_tokens_details":{"reasoning_tokens":11},"prompt_tokens_details":{"cached_tokens":0},"extra_properties":{"google":{"traffic_type":"ON_DEMAND"}}}}
HTTP 200
x-litellm-call-id: 46c28ed1-972b-40f3-bbee-98f78082ed4e
x-litellm-response-cost: 8.9e-06
C48 and C51 Codex TUI, before and after

C48 Codex TUI over /v1, drop_params

  1. Start Codex 0.169.0 in tmux with codex_tui_v1.sh pointing its litellm model provider at the leg's proxy /v1 with an API key, and the model muse-ember-1.0-dropparams, a deployment with drop_params: true
  2. Type Run the shell command: echo QA_TOOL_OK. Then reply with its output only. and press Enter
  3. Approve the command with y when Codex asks

Before, at 7ab941f, Codex shows We're currently experiencing high demand, which is how Codex 0.169.0 shows an HTTP 500 (codex-rs/codex-api/src/api_bridge.rs in openai/codex), and never runs the command

Codex over /v1 shows an error at the merge base

After, at 742940a, Codex runs the command and answers QA_TOOL_OK

Codex over /v1 runs echo and answers QA_TOOL_OK at the PR head

C51 Codex TUI over /v1 calls an MCP tool on muse-spark-1.3

  1. Start Codex 0.169.0 in tmux with codex_mcp.sh pointing its litellm model provider at the leg's proxy /v1 with an API key, the model muse-spark-1.3, and weather_server.py as the weather MCP server, whose get_weather tool returns a code word
  2. Type Use the weather MCP tool to get the weather in Paris, then tell me the code word it returns. and press Enter
  3. Allow the weather tool call when Codex asks

Before, at 7ab941f, Codex shows the same HTTP 500 message and never calls the tool

Codex over /v1 with the weather MCP server shows an error at the merge base

After, at 742940a, Codex calls weather.get_weather and answers with the code word PELICAN

Codex calls weather.get_weather and answers PELICAN at the PR head

Each lts51 leg ran two 2-worker proxies at its stated sha, as the boot lines in lts_tip95.md show. C51a to C51d send Codex's namespace shape with curl. Their commands and output, and every other case's on both legs, are in lts51.md in this gist

Rig notes
  • Responses streams on the line already end with data: [DONE]
  • A new tool policy applies about 75 s later, on both legs

Type

🆕 New Feature

Caveats (if any)

Low

Decisions

The same decisions as #50768 and #54240

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]
High Risk
Touches core routing (completion/responses bridge), cost calculation, streaming, guardrail request rewrites, and proxy spend/tool indexing; mistakes could misroute Muse calls, misbill streams, or break multi-turn tool sessions.

Overview
Adds native Responses API routing for Vertex AI Meta Muse models (muse-wonder, muse-ember, muse-spark) via VertexAIMuseResponsesAPIConfig, catalog entries, and serves_only_responses so chat/messages bridge to Muse without recursive round-trips. Muse calls validate or drop unsupported params (stateless store, global location, tool types) and forward Vertex credentials through the completion→responses bridge.

Namespace and long tool names are centralized in tool_fields (64-char truncation, qualified_member_name). The Responses↔chat bridge logs shortened→full name mappings, rewrites tool calls in success logs, spend/tool registry, and session replay (including cold-storage previous_response_id), and maps forced tool_choice to chat names.

Streaming and billing: when the bridge gets a completed non-stream result but the client asked for stream, it wraps via _completed_response_as_stream and preserves precomputed response_cost in CustomStreamWrapper. Native Responses honors per-call custom_cost_per_token / custom_cost_per_second when not router-routed.

Guardrails: richer merge_guardrailed_tools (returns None on unappliable rewrites), Responses input uses full member names, and logging-only input failures suppress UnappliableRequestRewrite.

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

emerzon and others added 30 commits November 14, 2026 00:01
(cherry picked from commit 224640c7cfbeddc3e7786ef10c1abb37ab73bd64)
(cherry picked from commit a2130c94e22d03778dacca26070082d6e806af09)
(cherry picked from commit f034a90b4eb3faa58c4e58b59c9d94e108f76ac7)
…arams for store

Chat completions and /v1/messages now reach the Muse Responses endpoint for any vertex_ai/meta/muse-* model, including ones the cost map does not list yet. store=True now becomes store=False under drop_params instead of raising.

(cherry picked from commit edcc38c63b86963edb2cf4a82c9d4cc20c42c4b4)
…calls

The chat-to-Responses bridge now forwards the deployment's vertex_project,
vertex_location and vertex_credentials, so chat and messages calls stop
falling back to the host's own Google identity.

Muse also answers 400 for a configured non-global vertex_location unless
drop_params is set, and drops background and previous_response_id under
drop_params instead of sending them to Vertex

(cherry picked from commit d2f4449a514fdb9f99a87476ca565b441c599d03)
Expose drops_params under the name the picked Muse adapter imports, drop the per-call custom price assertion that depends on BerriAI#48119 (not on this line), and sort the bridge_check re-export imports that already failed ruff on the line
…cannot take

(cherry picked from commit b8a367d8063154b323beee3a5d9205ee51632b71)
(cherry picked from commit 1d823b335a47e1c96b9a755ae0e717a5b909d56d)
Route only vertex_ai/meta/muse-* names to the Muse adapter, so a bare muse- name keeps its old path instead of being served with no price

Serve Responses WebSocket mode through the managed HTTP bridge, since Vertex has no wss endpoint for Muse and the native path skipped every Muse check

Keep /v1 in the URL when a custom api_base has no version path, the way the Vertex batches handler does

Answer 400 on token counting for Muse, the convention for Vertex partner models that have no count route, instead of a Vertex 404

Let Ember take PDFs, which Google's model card and a direct Vertex call allow, and fall back to vertex_ai_project when vertex_project is blank

(cherry picked from commit 9d44f0c9fbb93fffa9a8de5c39985e10a04d6003)
…ber PDF input

A Muse api_base with a path prefix ending in /v1, or with a query string, lost
the prefix or the query on the way to the meta responses path. Graft the
default Vertex path under a /v1 or /v1beta1 base, and append it to any other
base path while keeping the query

muse-ember-1.0 was the only Muse row without supports_pdf_input, so
/model/info showed null for it while the bridge already forwarded PDF parts

The WebSocket test now streams a turn through the managed bridge instead of
reading a flag, and _first_set is renamed to _first_non_empty

(cherry picked from commit b433bcb702d3e65f9af51d3a3b9a1923d1ef99f6)
…gh the Codex chat bridge, accept the publisher api_base

Muse rows now mark the reasoning efforts Vertex refuses, so they answer 400 or drop under drop_params. A Muse request that asks for the chat completions bridge still reaches its Responses endpoint, and an api_base that already names the Meta publisher path keeps working

(cherry picked from commit 910b4aad6106f21680e4cf8f712a0d9c13ff9f5b)
The Responses-to-chat bridge joins a namespace and its member as {namespace}__{member}. Codex with a ChatGPT login sends MCP namespaces whose joined names run past the 64-character limit that chat providers enforce, so Vertex Muse refused the request. The bridge now shortens those names with the existing truncate_tool_name convention and maps them back to the original namespace and member in the response

(cherry picked from commit 6da3fb527dbce4d2fe46f7bbf979d30a01bc9481)
…o its chat name

(cherry picked from commit 186aec657052035035feaa0ad9f4839843853246)
…tool names working

Vertex Muse takes only function and namespace tools and answers 400 for web_search, local_shell, mcp and custom tools. Codex over /v1 sends web_search by default, so every Codex turn failed even with drop_params. Under drop_params those tools are now removed, and tools is dropped when none are left

Shortening bridged {namespace}__{member} names over 64 characters hid the full name from the tool policy guardrail, so a policy on it stopped matching, and from Headroom, which lost the retrieve hold-back for Responses input. Both now see the full qualified name, and Headroom pairs Responses function_call items by call_id

The same change let a top-level function named like a long namespace member through the collision check, so a forced tool_choice on it called the member instead. It also left a replayed function_call that carries the full name and no namespace pointing at a tool the model was never given. The collision check now compares both names, and replayed full names map to the shortened chat name

Adapted for lts/1.108.x: the tool policy guardrail reads full names through namespace_member_qualified_names, and the request tools for replayed names are validated with the existing TypeAdapters, since this line has no request_tools helper

(cherry picked from commit 7515af106353fc4a2195b71608b234b9bf074f8c)
…name

A namespace member named after another member's shortened {namespace}__{member} name got the same chat name, so the bridge kept only one of them and a call meant for one tool went to the other. The collision check now also rejects two namespace members that map to the same chat name

(cherry picked from commit 74a863ebbe33886a98953d90bc2a1732c85603b0)
Muse answers a call to a namespace member as one function_call named {namespace}.{member} with no namespace field, in the JSON response and in the stream. Codex over /v1 then rejects the call as unsupported. The Muse adapter now splits that name back into its namespace and member name, but only when the request declared that namespace with that member, since Muse also accepts dotted names for top-level functions and returns them unchanged

(cherry picked from commit 463766a9fc24771d630568524461d11c58de568f)
…the bridge sends them

The guardrail scan flattens namespace tools to show them to the guardrail, but the provider still receives the namespaces as declared, so a collision between shortened chat names there is not an error. Only the Responses-to-chat bridge sends the shortened names, so the collision checks now run in that transform.

(cherry picked from commit 0410bff0f965ad4ad5f418122ff5e7dbb9fb308f)
…mespace members on lts/1.108.x

640f046 validated the request's tools with a strict list adapter, so a
request whose tools field was not a list answered 500 before any guardrail
ran. Non-list tools now name no namespace members, as on main.
…t name

A guardrail that drops one of two tools whose shortened chat names match
now keeps the survivor it returned, matched by content. A rewrite that
cannot be matched that way is rejected instead of sent unrewritten.

(cherry picked from commit 5236af50f4879f7bc72df509d6a40367fce35e2d)
…ique content

The guardrail scan sees full namespace member names again, as on the merge base, so shortened names no longer collide in the guardrail's view. When a guardrail drops one of several tools that share a chat name, the kept ones are matched by content only when exactly one alignment fits, first exactly and then ignoring descriptions and default fields, and otherwise the rewrite is rejected. Groups the guardrail did not shrink keep positional matching, and the merge computes each key once

(cherry picked from commit e93ebdff8706f18fa3c9123e2ab74c1a301bfe6b)
…es in the guardrail view

When a guardrail drops one of several same-named top-level function tools and edits another, every match sends the guardrail's own tool, so the kept one is taken in order instead of rejecting the rewrite. Namespace members still need exactly one match, since a wrong match would send a tool the guardrail dropped. Replayed function calls in the messages a guardrail sees now use the full namespace member name, the same name it sees the tool by

(cherry picked from commit 3cb291597b20e196292d7da6defc016b9732b7f1)
…ly response scan

When a guardrail shrinks a group of same-named tools, each kept tool is now matched to its original by content in any order, so a reorder no longer answers 500. When one kept tool matches several top-level twins that differ only in fields the guardrail cannot see, the guardrail's own tool is sent instead of guessing one twin. A replayed namespace member call is compared under its full name, so a message rewrite resends it as it came. In logging_only mode a request rewrite the endpoint cannot apply no longer drops the response scan

(cherry picked from commit d55647f)
The merge rescanned and revalidated both tool lists once per distinct tool name on every guarded Responses request, which made unchanged tool sets quadratic. It now groups positions by name in one pass, and a guardrail that drops and reorders same-name tools still maps each surviving tool to its own original.

(cherry picked from commit 1aefb27)
A client-caused flattened name collision raised a bare ValueError and surfaced as a 500. It now raises BadRequestError, and the prompt caching deployment check runs the same validation again before building chat forms for its prefix key.

(cherry picked from commit 2d59f57)
Builtin tool types such as web_search, mcp, custom and local_shell were forwarded to Vertex when drop_params was off and failed there with a provider error. They now fail fast with UnsupportedParamsError before any request is sent, matching store, truncation, tool_choice and reasoning effort handling.

(cherry picked from commit 06d041a)
When two tools share one chat form and a guardrail drops one copy, the returned form cannot say which original survived, so the merge could keep the rejected member. The rewrite is now reported unappliable instead of guessing.

(cherry picked from commit 8571a9f)
mateo-berri and others added 3 commits November 21, 2026 17:52
…nd show guardrails full tool names

A guardrail that edited one of two MCP servers sharing a server_label and dropped the other made the request fail, because the merge could not tell which server the edit came from. An MCP server's chat form is the server itself, so the edit is sent as returned.

The guardrail messages view for /v1/responses now names namespaced calls by their full name, not the 64-character provider name, so request guardrails see the same names the tool policy checks.

Same change as a9cfa7b on the main branch litellm_responses_cold_replay_call_names.
… API path (BerriAI#48119)

* fix(responses): honor per-call custom pricing on the native Responses API path

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(responses): narrow the custom pricing regression test to the type gates

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(main): expose register_custom_pricing_for_request for the responses path

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(responses): mark custom pricing test locals Final

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): price per-call custom rates request-locally instead of registering them globally

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): bind per-call rates on the request logging object instead of inferring them in Logging

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): keep Router deployments on the cost-map pricing path

Router inherits cache rates onto the deployment's cost-map entry, so a routed
Responses call binds no request-local price and keeps billing cached tokens at
the inherited rate. Moves the deployment-id lookup to router_utils so the
Responses and completion paths share it.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): gate request-local pricing on the typed deployment model_info

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit e04e89c)
…#48119 is on the line

efad10a dropped this assertion because the line lacked BerriAI#48119. With that fix picked, a per-call input_cost_per_token and output_cost_per_token price the Muse call again.
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@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.

Stale Bugbot comment from a previous run.

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@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.

Stale Bugbot comment from a previous run.

…backport_50768_lts_1_108_x

# Conflicts:
#	litellm/responses/bridge_check.py
The line already replays a call to a namespace member named like its namespace under the name its tools declared, so only that regression test comes over for it

(cherry picked from commit 298e7f1)
…me back in

When a guardrail edits one of two same-named tools and drops the other, and the edit is as close to both as either is to the other, it now takes the slot that keeps its order around the uniquely named tools the guardrail returned, instead of always the first slot

(cherry picked from commit d83c813)
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

…nnot stall the event loop

(cherry picked from commit 1706add)
…n a large group passes the budget

(cherry picked from commit a7b15b5)
…st the scoring budget

A same-named group too large for nearest-match scoring now pairs kept tools with originals in order within each content match, as main does, instead of falling back to position across namespaces

(cherry picked from commit dd13130)
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@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 5ec8d22. 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 e6f6f73 into BerriAI:lts/1.108.x Nov 25, 2026
61 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.

4 participants