Skip to content

refactor(types): replace Any with proven types in 7 files - #43704

Merged
mateo-berri merged 5 commits into
mainfrom
litellm_any_sweep_20260929
Sep 29, 2026
Merged

mateo-berri merged 5 commits into
mainfrom
litellm_any_sweep_20260929

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Any silently disables type checking wherever it lands
  • 8,678 Any errors across the backend tree
  • Reviewers cannot tell which payloads are actually untyped

How it solves it:

  • Replaces Any with proven types in 7 files
  • Removes 39 Any errors, 19 basedpyright errors total
  • Behavior is unchanged: types, protocols and generics, plus three equivalent local rewrites listed under Caveats

User Flow

This change is types only, so a developer calling the proxy sees the same flow before and after, step for step, with the same status codes and the same response shapes

Before

A developer calling a proxy with Gemini, OpenAI and Fireworks deployments behind it gets every call answered as expected, except the Fireworks call, which the upstream account refuses

  1. POST http://127.0.0.1:$PORT/v1/chat/completions with model qa-gemini and "Reply with exactly: PONG" returns HTTP 200 with content PONG, finish_reason stop and non-zero prompt and completion token counts
  2. The same route with model qa-openai, stream: true and stream_options.include_usage returns HTTP 200 and SSE chunks that assemble into the model's reply, with a final usage chunk
  3. POST /v1/embeddings with model qa-embed returns HTTP 200 with one 3072-dimension vector and 5 prompt tokens
  4. POST /key/generate with models: ["qa-gemini"] and a 1.0 budget returns a new sk- virtual key
  5. POST /v1/chat/completions with that key and model qa-gemini returns HTTP 200 with content OK
  6. The same key asking for model qa-openai is refused with HTTP 403
  7. GET /key/info?key=<the key> shows spend above zero for the call in step 5
  8. POST /key/delete for that key returns HTTP 200
  9. Reusing the deleted key on POST /v1/chat/completions is refused with HTTP 401
  10. GET /guardrails/list returns HTTP 200 with an empty guardrails list
  11. GET /v1/models returns HTTP 200 listing qa-embed, qa-fireworks, qa-gemini and qa-openai
  12. POST /v1/responses with model qa-gemini returns HTTP 200, status completed and text PONG
  13. The same route with stream: true returns HTTP 200 and 9 events from response.created to response.completed that assemble to PONG
  14. POST /v1/chat/completions with model qa-fireworks returns HTTP 412, the upstream provider refusing the account
  15. POST /v1/responses with model qa-openai returns HTTP 200, status completed and text PONG
  16. POST /v1/chat/completions with model qa-gemini and a get_weather tool returns HTTP 200 with one get_weather tool call carrying {"city": "Paris"} and finish_reason tool_calls

After

The same developer gets exactly the same answers, including the same upstream refusal on the Fireworks call

  1. POST http://127.0.0.1:$PORT/v1/chat/completions with model qa-gemini and "Reply with exactly: PONG" returns HTTP 200 with content PONG, finish_reason stop and non-zero prompt and completion token counts
  2. The same route with model qa-openai, stream: true and stream_options.include_usage returns HTTP 200 and SSE chunks that assemble into the model's reply, with a final usage chunk
  3. POST /v1/embeddings with model qa-embed returns HTTP 200 with one 3072-dimension vector and 5 prompt tokens
  4. POST /key/generate with models: ["qa-gemini"] and a 1.0 budget returns a new sk- virtual key
  5. POST /v1/chat/completions with that key and model qa-gemini returns HTTP 200 with content OK
  6. The same key asking for model qa-openai is refused with HTTP 403
  7. GET /key/info?key=<the key> shows spend above zero for the call in step 5
  8. POST /key/delete for that key returns HTTP 200
  9. Reusing the deleted key on POST /v1/chat/completions is refused with HTTP 401
  10. GET /guardrails/list returns HTTP 200 with an empty guardrails list
  11. GET /v1/models returns HTTP 200 listing qa-embed, qa-fireworks, qa-gemini and qa-openai
  12. POST /v1/responses with model qa-gemini returns HTTP 200, status completed and text PONG
  13. The same route with stream: true returns HTTP 200 and 9 events from response.created to response.completed that assemble to PONG
  14. POST /v1/chat/completions with model qa-fireworks returns HTTP 412, the upstream provider refusing the account
  15. POST /v1/responses with model qa-openai returns HTTP 200, status completed and text PONG
  16. POST /v1/chat/completions with model qa-gemini and a get_weather tool returns HTTP 200 with one get_weather tool call carrying {"city": "Paris"} and finish_reason tool_calls

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
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

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

Shared setup for both runs. Same config, same payloads, same live providers, same Postgres; only the checked-out commit differs

model_list:
  - model_name: qa-gemini
    litellm_params:
      model: gemini/gemini-2.5-flash-lite
      api_key: os.environ/GEMINI_API_KEY
  - model_name: qa-openai
    litellm_params:
      model: openai/gpt-4o-mini
      api_key: os.environ/OPENAI_API_KEY
  - model_name: qa-fireworks
    litellm_params:
      model: fireworks_ai/accounts/fireworks/models/gpt-oss-120b
      api_key: os.environ/FIREWORKS_AI_API_KEY
  - model_name: qa-embed
    litellm_params:
      model: gemini/gemini-embedding-001
      api_key: os.environ/GEMINI_API_KEY

general_settings:
  master_key: os.environ/QA_MASTER_KEY
  database_url: os.environ/QA_DATABASE_URL

litellm_settings:
  drop_params: true
git checkout <hash>
litellm --config config.yaml --port $PORT --num_workers 2

Before (85dc7cb)

Type-check count

  1. Run basedpyright over the tree the way scripts/type_check_gate.py does:

    .venv-typecheck/bin/basedpyright --outputjson --pythonpath .venv-typecheck/bin/python
    
  2. Observed:

    reportAny             6959
    reportExplicitAny     1719
    Any total             8678
    all errors          139779
    

Chat completions

  1. Send a non-streaming chat completion to qa-gemini:

    curl -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","messages":[{"role":"user","content":"Reply with exactly: PONG"}],"max_tokens":16,"temperature":0}'
  2. Observed:

    HTTP 200
    content='PONG'
    finish_reason=stop model=qa-gemini
    usage keys=['completion_tokens', 'completion_tokens_details', 'prompt_tokens'] prompt>0=True completion>0=True
    id_prefix=5Ke7aom_I
    
  3. Send a streaming chat completion with usage to qa-openai:

    curl -N -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-openai","messages":[{"role":"user","content":"Count: 1 2 3"}],"max_tokens":24,"temperature":0,"stream":true,"stream_options":{"include_usage":true}}'
  4. Observed:

    HTTP 200
    n_chunks=8
    assembled='4 5 6'
    final_usage_present=True prompt>0=True
    
  5. Send a non-streaming chat completion to qa-fireworks:

    curl -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-fireworks","messages":[{"role":"user","content":"Reply with exactly: PONG"}],"max_tokens":512,"temperature":0}'
  6. Observed:

    HTTP 412
    Traceback (most recent call last):
      File "<string>", line 4, in <module>
    KeyError: 'choices'
    

Tool calling

  1. Send a chat completion to qa-gemini carrying a get_weather function tool:

    curl -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","messages":[{"role":"user","content":"What is the weather in Paris? Use the tool."}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}],"tool_choice":"auto","max_tokens":64,"temperature":0}'
  2. Observed:

    HTTP 200
    n_tool_calls=1
    name=get_weather arguments={"city": "Paris"}
    finish_reason=tool_calls
    

Responses API

  1. Send a non-streaming responses request to qa-gemini:

    curl -X POST http://127.0.0.1:$PORT/v1/responses \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","input":"Reply with exactly: PONG","max_output_tokens":16,"temperature":0}'
  2. Observed:

    HTTP 200
    object=response status=completed model=qa-gemini
    text='PONG'
    usage input>0=True output>0=True
    
  3. Send a non-streaming responses request to qa-openai:

    curl -X POST http://127.0.0.1:$PORT/v1/responses \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-openai","input":"Reply with exactly: PONG","max_output_tokens":16,"temperature":0}'
  4. Observed:

    HTTP 200
    object=response status=completed model=qa-openai
    text='PONG'
    usage input>0=True output>0=True
    
  5. Send a streaming responses request to qa-gemini:

    curl -N -X POST http://127.0.0.1:$PORT/v1/responses \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","input":"Reply with exactly: PONG","max_output_tokens":24,"temperature":0,"stream":true}'
  6. Observed:

    HTTP 200
    n_events=9
    first_type=response.created last_type=response.completed
    assembled='PONG'
    completed_event_present=True
    

Embeddings

  1. Send an embedding request to qa-embed:

    curl -X POST http://127.0.0.1:$PORT/v1/embeddings \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-embed","input":"litellm any reduction"}'
  2. Observed:

    HTTP 200
    object=list n_vectors=1 dim=3072
    first3=[-0.024564, 0.00778, 0.001819]
    prompt_tokens=5
    

Virtual key lifecycle, model access control and spend

  1. Generate a key scoped to qa-gemini, use it on both models, read its spend, delete it and reuse it:

    curl -X POST http://127.0.0.1:$PORT/key/generate -H "Authorization: Bearer $QA_MASTER_KEY" \
      -H 'Content-Type: application/json' -d '{"models":["qa-gemini"],"max_budget":1.0,"key_alias":"qa-<label>-<n>"}'
    # then /v1/chat/completions with that key on qa-gemini and on qa-openai,
    # then GET /key/info?key=<key>, POST /key/delete, and one more chat call
  2. Observed:

    generated key prefix: sk-O5GJ...
    chat-with-virtual-key HTTP 200
    content='OK'
    denied-model HTTP 403
    error_mentions_key_not_allowed=False
    key spend recorded > 0: True
    key-delete HTTP 200
    reuse-deleted-key HTTP 401
    

Guardrails and model list

  1. List the guardrails and the models:

    curl http://127.0.0.1:$PORT/guardrails/list -H "Authorization: Bearer $QA_MASTER_KEY"
    curl http://127.0.0.1:$PORT/v1/models -H "Authorization: Bearer $QA_MASTER_KEY"
  2. Observed:

    HTTP 200
    guardrails_key=True count=0
    HTTP 200
    models=['qa-embed', 'qa-fireworks', 'qa-gemini', 'qa-openai']
    

After (3ad6e8f)

Type-check count

  1. Run basedpyright over the tree the way scripts/type_check_gate.py does:

    .venv-typecheck/bin/basedpyright --outputjson --pythonpath .venv-typecheck/bin/python
    
  2. Observed:

    reportAny             6931
    reportExplicitAny     1708
    Any total             8639
    all errors          139760
    

Chat completions

  1. Send a non-streaming chat completion to qa-gemini:

    curl -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","messages":[{"role":"user","content":"Reply with exactly: PONG"}],"max_tokens":16,"temperature":0}'
  2. Observed:

    HTTP 200
    content='PONG'
    finish_reason=stop model=qa-gemini
    usage keys=['completion_tokens', 'completion_tokens_details', 'prompt_tokens'] prompt>0=True completion>0=True
    id_prefix=Iai7asTyK
    
  3. Send a streaming chat completion with usage to qa-openai:

    curl -N -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-openai","messages":[{"role":"user","content":"Count: 1 2 3"}],"max_tokens":24,"temperature":0,"stream":true,"stream_options":{"include_usage":true}}'
  4. Observed:

    HTTP 200
    n_chunks=11
    assembled='1, 2, 3.'
    final_usage_present=True prompt>0=True
    
  5. Send a non-streaming chat completion to qa-fireworks:

    curl -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-fireworks","messages":[{"role":"user","content":"Reply with exactly: PONG"}],"max_tokens":512,"temperature":0}'
  6. Observed:

    HTTP 412
    Traceback (most recent call last):
      File "<string>", line 4, in <module>
    KeyError: 'choices'
    

Tool calling

  1. Send a chat completion to qa-gemini carrying a get_weather function tool:

    curl -X POST http://127.0.0.1:$PORT/v1/chat/completions \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","messages":[{"role":"user","content":"What is the weather in Paris? Use the tool."}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}],"tool_choice":"auto","max_tokens":64,"temperature":0}'
  2. Observed:

    HTTP 200
    n_tool_calls=1
    name=get_weather arguments={"city": "Paris"}
    finish_reason=tool_calls
    

Responses API

  1. Send a non-streaming responses request to qa-gemini:

    curl -X POST http://127.0.0.1:$PORT/v1/responses \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","input":"Reply with exactly: PONG","max_output_tokens":16,"temperature":0}'
  2. Observed:

    HTTP 200
    object=response status=completed model=qa-gemini
    text='PONG'
    usage input>0=True output>0=True
    
  3. Send a non-streaming responses request to qa-openai:

    curl -X POST http://127.0.0.1:$PORT/v1/responses \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-openai","input":"Reply with exactly: PONG","max_output_tokens":16,"temperature":0}'
  4. Observed:

    HTTP 200
    object=response status=completed model=qa-openai
    text='PONG'
    usage input>0=True output>0=True
    
  5. Send a streaming responses request to qa-gemini:

    curl -N -X POST http://127.0.0.1:$PORT/v1/responses \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-gemini","input":"Reply with exactly: PONG","max_output_tokens":24,"temperature":0,"stream":true}'
  6. Observed:

    HTTP 200
    n_events=9
    first_type=response.created last_type=response.completed
    assembled='PONG'
    completed_event_present=True
    

Embeddings

  1. Send an embedding request to qa-embed:

    curl -X POST http://127.0.0.1:$PORT/v1/embeddings \
      -H "Authorization: Bearer $QA_MASTER_KEY" -H 'Content-Type: application/json' \
      -d '{"model":"qa-embed","input":"litellm any reduction"}'
  2. Observed:

    HTTP 200
    object=list n_vectors=1 dim=3072
    first3=[-0.024564, 0.00778, 0.001819]
    prompt_tokens=5
    

Virtual key lifecycle, model access control and spend

  1. Generate a key scoped to qa-gemini, use it on both models, read its spend, delete it and reuse it:

    curl -X POST http://127.0.0.1:$PORT/key/generate -H "Authorization: Bearer $QA_MASTER_KEY" \
      -H 'Content-Type: application/json' -d '{"models":["qa-gemini"],"max_budget":1.0,"key_alias":"qa-<label>-<n>"}'
    # then /v1/chat/completions with that key on qa-gemini and on qa-openai,
    # then GET /key/info?key=<key>, POST /key/delete, and one more chat call
  2. Observed:

    generated key prefix: sk-dHaw...
    chat-with-virtual-key HTTP 200
    content='OK'
    denied-model HTTP 403
    error_mentions_key_not_allowed=False
    key spend recorded > 0: True
    key-delete HTTP 200
    reuse-deleted-key HTTP 401
    

Guardrails and model list

  1. List the guardrails and the models:

    curl http://127.0.0.1:$PORT/guardrails/list -H "Authorization: Bearer $QA_MASTER_KEY"
    curl http://127.0.0.1:$PORT/v1/models -H "Authorization: Bearer $QA_MASTER_KEY"
  2. Observed:

    HTTP 200
    guardrails_key=True count=0
    HTTP 200
    models=['qa-embed', 'qa-fireworks', 'qa-gemini', 'qa-openai']
    

Supplementary live cases

Same two-worker proxies, fresh Postgres per leg, real Gemini, OpenAI and Fireworks keys, --detailed_debug on. Base 85dc7cb, head 3ad6e8f

Case Base Head
gemini-2.5-flash legacy functions, reasoning_effort: low, non-streaming 200, function_call get_weather {"city": "Paris"}, thought_signature present same
Same, stream: true 200, same call assembled, thought_signature present in the deltas same
Same with tools instead of functions 200, tool_calls[0] get_weather {"city": "Paris"} same
dall-e-3 with style: vivid and additional_drop_params: ["style"] outbound body {'model': 'dall-e-3', 'prompt': 'a small red cube', 'response_format': 'url', 'size': '1024x1024'}, no style; OpenAI answers 400 for response_format same
qa-fireworks "Say hi" 412 412
POST /v1beta/models/qa-gemini:generateContent, and :streamGenerateContent?alt=sse 200, text PONG, one SSE candidate same
POST /v1/files to Gemini (resumable upload, URL from X-Goog-Upload-URL) 200, id https://generativelanguage.googleapis.com/v1beta/files/<id>, 30 bytes, uploaded same
GET /v1/files/<built-in function id>/content from OpenAI (streamed file content) 200, upstream content-type and content-length: 139 forwarded, body byte-identical to the upload same

Exact commands and raw responses for every case above, both legs: #43704 (comment) and #43704 (comment)

Raw Fireworks upstream error, identical on both legs apart from the request id:

{"error":{"message":"Account <qa-account> is suspended, possibly due to reaching the monthly spending limit or failure to pay past invoices. Please go to https://fireworks.ai/account/billing for more information.","param":null,"code":"PRECONDITION_FAILED","type":"error"}}

Audit

Deterministic tests/integration/ cells added by this PR, run on a 2-worker proxy with its own Postgres and Redis and doubles only at the upstream and vendor edges. Merge base 85dc7cb ran once, head 3ad6e8f ran twice with identical results, 10 of 10 passed on every run. The change is types only, so every row is expected identical and green on both legs

Row Surface Test node BASE result HEAD result
R1a Gemini functionCall + thoughtSignature, non-streaming providers/test_vertex_gemini_function_call_wire.py::test_vertex_gemini_function_call_thought_signature_is_returned_non_streaming pass pass
R1b Gemini functionCall, no signature, non-streaming providers/test_vertex_gemini_function_call_wire.py::test_vertex_gemini_function_call_without_signature_has_no_provider_fields_non_streaming pass pass
R1c Gemini functionCall + thoughtSignature, streaming providers/test_vertex_gemini_function_call_wire.py::test_vertex_gemini_function_call_thought_signature_is_returned_streaming pass pass
R1d Gemini functionCall, no signature, streaming providers/test_vertex_gemini_function_call_wire.py::test_vertex_gemini_function_call_without_signature_has_no_provider_fields_streaming pass pass
R2 MCP tool permission groupby/merge across 2 owned MCP peers mcp/test_mcp_tool_permission_merge.py::test_tool_permissions_merge_when_keys_resolve_to_same_server pass pass
R3 /v1/images/generations additional_drop_params reaches wire providers/test_image_gen_drop_params_wire.py::test_image_generation_additional_drop_params_reaches_provider_body pass pass
R4 kwargs extra param flows into generationConfig providers/test_vertex_gemini_function_call_wire.py::test_vertex_gemini_kwargs_extra_param_reaches_generation_config pass pass
R5a streaming assembled text + final usage row providers/test_openai_stream_text_usage_wire.py::test_streaming_chat_assembles_text_and_final_usage pass pass
R5b xecguard post-call row against scripted vendor sink observability/test_xecguard_wire.py::test_xecguard_post_call_scan_reaches_vendor_and_call_succeeds pass pass
R6 chaos burst >=20 concurrent, upstream fails fraction, every success id lands once in spend logs spend/test_chaos_burst_spend_once.py::test_burst_with_partial_upstream_failures_logs_each_success_once pass pass

Type

🧹 Refactoring

Caveats (if any)

Low

  • Removing Any unmasks mismatches the checker was silencing
    • reportUnknownArgumentType 44080 to 44102
    • Every one stays inside its basedpyright-code-budget.json limit, and no budget file is touched
  • Seams fed by untyped JSON were left alone instead of annotated without proof
  • The Fireworks case returned HTTP 412 on both legs because the upstream Fireworks account behind the QA key is suspended, with the raw upstream error pasted under Supplementary live cases, so that surface is unproven live today while every other case matched
  • One mapped test, test_claim_token_rejects_breached_password_before_consuming_invite, fails identically at the base commit and at the tip, in a file this PR does not touch
  • Reusing a deleted virtual key right after /key/delete on a two-worker proxy is still accepted about half the time on both legs, a pre-existing cache race this PR does not touch
    • A 12-iteration loop of generate, use, delete and reuse saw HTTP 200 on reuse 5 times at the base commit and 6 times at the tip, HTTP 401 otherwise
  • CodeQL flags passed_params.pop("additional_drop_params", None) in get_optional_params_image_gen for modifying the locals() dict, a pattern the base line already had
  • misc / Run tests fails 4 tests in test_openapi_compliance.py that download Google's live interactions spec, the same 4 failing on unrelated PRs today
  • codecov/patch is red because the retyped lines in llm_http_handler.py have no direct test
  • MCP tool grouping and XecGuard have no live cell, since the QA setup has no live MCP server and the vault has no XecGuard account
    • Both are proven by the audit's integration tests against owned MCP peers and a scripted XecGuard vendor, green at the merge base and the head
  • Two Any parameters remain in edited signatures, _handle_a2a_response_logging(result) and XecGuardGuardrail._extract_choice_content(choice), because no caller proves a narrower type
  • The first commit is titled "11 files" while the PR now changes 7 production files, since four were reverted in later commits instead of rewriting history
  • The pasted Before/After blocks are the harness's parsed summaries; the raw responses for the supplementary cases are in the linked PR comments
  • Three edits rewrite runtime code rather than only types, the Gemini thought-signature dict literal, itemgetter to a lambda in MCP grouping, and dropping an unused binding in get_optional_params_image_gen, each equivalent to the old code and covered live or by the audit
  • The new integration tests carry no mutate-red-restore run; net-negative for a types-only change, since each test pins behavior that is identical on both legs
  • CodeQL flags the locals() copy mutation in get_optional_params_image_gen; the same pop exists at the merge base and this PR only drops its unused binding, so it is left as is
  • oauth waits on the e2e-changed environment approval, which is only granted for PRs touching tests/e2e/, and this PR does not

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

Link to Devin session: https://app.devin.ai/sessions/d8e40fce30e54402847cbd59ed4efd2b
Open in Devin Desktop: https://app.devin.ai/desktop/session/d8e40fce30e54402847cbd59ed4efd2b?variant=devin


Note

Low Risk
Changes are primarily static typing and equivalent refactors; new integration tests cover affected proxy/provider paths without altering auth or billing logic.

Overview
Replaces broad Any annotations with narrower types (object, dt_object, Mapping[...]) across logging, streaming, HTTP handlers, guardrails, and utils parameter plumbing, and tightens a few return types (e.g. async Google GenAI generate content).

Vertex Gemini function-call mapping is refactored to build provider_specific_fields for thought_signature via dict spreads instead of in-place mutation; MCP permission grouping drops itemgetter for lambdas. No intended runtime behavior change on those paths.

Adds integration wire tests for MCP tool-permission merging, XecGuard post-call scans, image additional_drop_params, streaming chat usage assembly, Vertex Gemini function calls / top_k, and burst spend logging uniqueness.

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

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from a team September 29, 2026 10:25
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Type annotations and minor refactors across logging and utilities.

The PR appears safe to merge based on the changes since the previous review and the status of prior findings.

Summary

This PR narrows type annotations across logging, streaming, provider handling, MCP, guardrails, and parameter normalization, and adds integration coverage. Since the previous review, it has tightened an MCP denial assertion and typed two test helpers. No new actionable issue was identified.

Reviews (6) · Last reviewed commit: "test(integration): tighten sweep audit t..."

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
litellm/llms/custom_httpx/llm_http_handler.py 50.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread litellm/utils.py
passed_params.pop("drop_params", None)
drop_params = normalize_drop_params(drop_params)
additional_drop_params = passed_params.pop("additional_drop_params", None)
passed_params.pop("additional_drop_params", None)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing, not introduced here. At the merge base the same line already pops from the locals() copy (additional_drop_params = passed_params.pop("additional_drop_params", None) at litellm/utils.py:3598 on 85dc7cb); this PR only drops the unused binding. passed_params is used as a plain dict afterwards and no local variable is expected to change, and the live and audit image cases show style still dropped on both legs

@codspeed

codspeed Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_any_sweep_20260929 (3ad6e8f) with main (7f95b5f)

Open in CodSpeed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title refactor(types): replace Any with proven types in 11 files refactor(types): replace Any with proven types in 8 files Sep 29, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

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

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

Copy link
Copy Markdown
Contributor Author

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

@devin-ai-integration devin-ai-integration Bot changed the title refactor(types): replace Any with proven types in 8 files refactor(types): replace Any with proven types in 7 files Sep 29, 2026
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

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

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

Copy link
Copy Markdown
Contributor Author

@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 3ad6e8f. Configure here.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

raw cells - qa_extra

Base leg :4300 (85dc7cb), tip leg :4301 (3ad6e8f). Keys redacted as .

base leg

base.L1

curl -sS -w '\nHTTP:%{http_code}\n' http://127.0.0.1:4300/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -H 'Content-Type: application/json' -d @l1.json
{"id":"fqq7aq25Fbqgz7IPmpyN2A8","created":1790683773,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"function_call","index":0,"message":{"role":"assistant","function_call":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather","provider_specific_fields":{"thought_signature":"CpECAWkUfRNwcNev2JPI28ETYNvzLVldlYg1OzTiz6QLdL5syqcs675tOP7xqG0RqRppWKXC4PN7qDk+LnXmL5Ivp9od+3di3XQ5Dp7Y7dbNZ8bYbljwaZiTSX1tRT0Xruo9LsdFAUjrUySEaVKVXKCB+uZtV4e8FhcPwtA/JjTgYf9zxiFJVhpzxc6p52I6R1DIyxpQLTRIb/prWS1xA7Vg+4bbWJRDJp/0kAXzkkvDzREc2vN+XM9DyF8K+azlL1163Gge8FHtsfEGO1bOOxjI/hp0vvTIxogoxkuJb0KDKyiLRx3eyxoHxTy2zMRhbmFfN7P5I7+mMoumYcke5V68UwID4eoP4OAWFCJuWcntHmAS"}},"images":[],"reasoning_content":"Okay, here's my understanding:\n\n**Analyzing the Request and Formulating the API Call**\n\nRight, the user needs weather information for Paris. They've been very clear about wanting to use a function, which is a good cue. Looking at the available tools, specifically `default_api`, I see the `get_weather` function. Excellent, that's precisely what I need! The function takes a `city` argument, so I'll instantiate that function now, setting `city` to 'Paris'. No ambiguity there, it's a straightforward city request. So, `get_weather(city='Paris')` is the correct API call to make.\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's my understanding:\n\n**Analyzing the Request and Formulating the API Call**\n\nRight, the user needs weather information for Paris. They've been very clear about wanting to use a function, which is a good cue. Looking at the available tools, specifically `default_api`, I see the `get_weather` function. Excellent, that's precisely what I need! The function takes a `city` argument, so I'll instantiate that function now, setting `city` to 'Paris'. No ambiguity there, it's a straightforward city request. So, `get_weather(city='Paris')` is the correct API call to make.\n"}],"provider_specific_fields":{"thought_signatures":["CpECAWkUfRNwcNev2JPI28ETYNvzLVldlYg1OzTiz6QLdL5syqcs675tOP7xqG0RqRppWKXC4PN7qDk+LnXmL5Ivp9od+3di3XQ5Dp7Y7dbNZ8bYbljwaZiTSX1tRT0Xruo9LsdFAUjrUySEaVKVXKCB+uZtV4e8FhcPwtA/JjTgYf9zxiFJVhpzxc6p52I6R1DIyxpQLTRIb/prWS1xA7Vg+4bbWJRDJp/0kAXzkkvDzREc2vN+XM9DyF8K+azlL1163Gge8FHtsfEGO1bOOxjI/hp0vvTIxogoxkuJb0KDKyiLRx3eyxoHxTy2zMRhbmFfN7P5I7+mMoumYcke5V68UwID4eoP4OAWFCJuWcntHmAS"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":70,"prompt_tokens":46,"total_tokens":116,"completion_tokens_details":{"reasoning_tokens":55,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200
... <truncated> ...
{"id":"fqq7aq25Fbqgz7IPmpyN2A8","created":1790683773,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"function_call","index":0,"message":{"role":"assistant","function_call":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather","provider_specific_fields":{"thought_signature":"CpECAWkUfRNwcNev2JPI28ETYNvzLVldlYg1OzTiz6QLdL5syqcs675tOP7xqG0RqRppWKXC4PN7qDk+LnXmL5Ivp9od+3di3XQ5Dp7Y7dbNZ8bYbljwaZiTSX1tRT0Xruo9LsdFAUjrUySEaVKVXKCB+uZtV4e8FhcPwtA/JjTgYf9zxiFJVhpzxc6p52I6R1DIyxpQLTRIb/prWS1xA7Vg+4bbWJRDJp/0kAXzkkvDzREc2vN+XM9DyF8K+azlL1163Gge8FHtsfEGO1bOOxjI/hp0vvTIxogoxkuJb0KDKyiLRx3eyxoHxTy2zMRhbmFfN7P5I7+mMoumYcke5V68UwID4eoP4OAWFCJuWcntHmAS"}},"images":[],"reasoning_content":"Okay, here's my understanding:\n\n**Analyzing the Request and Formulating the API Call**\n\nRight, the user needs weather information for Paris. They've been very clear about wanting to use a function, which is a good cue. Looking at the available tools, specifically `default_api`, I see the `get_weather` function. Excellent, that's precisely what I need! The function takes a `city` argument, so I'll instantiate that function now, setting `city` to 'Paris'. No ambiguity there, it's a straightforward city request. So, `get_weather(city='Paris')` is the correct API call to make.\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's my understanding:\n\n**Analyzing the Request and Formulating the API Call**\n\nRight, the user needs weather information for Paris. They've been very clear about wanting to use a function, which is a good cue. Looking at the available tools, specifically `default_api`, I see the `get_weather` function. Excellent, that's precisely what I need! The function takes a `city` argument, so I'll instantiate that function now, setting `city` to 'Paris'. No ambiguity there, it's a straightforward city request. So, `get_weather(city='Paris')` is the correct API call to make.\n"}],"provider_specific_fields":{"thought_signatures":["CpECAWkUfRNwcNev2JPI28ETYNvzLVldlYg1OzTiz6QLdL5syqcs675tOP7xqG0RqRppWKXC4PN7qDk+LnXmL5Ivp9od+3di3XQ5Dp7Y7dbNZ8bYbljwaZiTSX1tRT0Xruo9LsdFAUjrUySEaVKVXKCB+uZtV4e8FhcPwtA/JjTgYf9zxiFJVhpzxc6p52I6R1DIyxpQLTRIb/prWS1xA7Vg+4bbWJRDJp/0kAXzkkvDzREc2vN+XM9DyF8K+azlL1163Gge8FHtsfEGO1bOOxjI/hp0vvTIxogoxkuJb0KDKyiLRx3eyxoHxTy2zMRhbmFfN7P5I7+mMoumYcke5V68UwID4eoP4OAWFCJuWcntHmAS"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":70,"prompt_tokens":46,"total_tokens":116,"completion_tokens_details":{"reasoning_tokens":55,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200

base.L2

curl -sS -N http://127.0.0.1:4300/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -H 'Content-Type: application/json' -d <L2 body stream:true>
data: {"id":"kaq7atOLDcnVz7IP_J2y2AE","created":1790683794,"model":"qa-gemini-think","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"**Defining the Function Call**\n\nI've determined I need to call the `get_weather` function. The user's request, specifically the instruction to \"Use the function,\" makes this clear. Now I know I need to pass the city \"Paris\" as an argument to the function call.\n\n\n","role":"assistant"}}],"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_ratings":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[]}

data: {"id":"kaq7atOLDcnVz7IP_J2y2AE","created":1790683794,"model":"qa-gemini-think","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"provider_specific_fields":{"thought_signatures":["CiQBaRR9EyYuji15lkcRwP8YoLQMXvL0PhocGjxQKY0B9uX4SkgKdgFpFH0ThSBoalIZBh7VJu5hLMMeGgFvN6LqHXV21fmLME45ODmwkjGom1iPu2Hchfg/LvT+bHJc0iVjugMGSUl9UiJrFebK/JqslKo+9w3Dcrm/WNKAo2nE26V20hPlj9ZbZi8VfkQZMPgNWmFmHMKQ/yLB9lIK2wEBaRR9E1YVX+9QUV92yctiOh8TI6UDX5m8s8s9hGnVy99sqHSn6watCTpVrANIkxfW59Pkac3l/1VsZ60du0ZiU/ZgQSz4Jfs3P7XRZgOVlbzxkUIzcvyrOZoc3Agn5Kd/rMMOmAGAHTvRqwC5WRDo6Lrz9F4GiIaSI3hVXj5sh5Qq9kmN0Xd5aUxC3HOJN2ydXXyPCUzHM+hQoqSTOaIMji1Jrs3vR5XMuEHseywrvR4DiELdEbKJJkMNCRqizoZ/+l0nKP6c4SCq/L54lhGCCQKMEFb+ZRqwuSQ="]},"function_call":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather","provider_specific_fields":{"thought_signature":"CiQBaRR9EyYuji15lkcRwP8YoLQMXvL0PhocGjxQKY0B9uX4SkgKdgFpFH0ThSBoalIZBh7VJu5hLMMeGgFvN6LqHXV21fmLME45ODmwkjGom1iPu2Hchfg/LvT+bHJc0iVjugMGSUl9UiJrFebK/JqslKo+9w3Dcrm/WNKAo2nE26V20hPlj9ZbZi8VfkQZMPgNWmFmHMKQ/yLB9lIK2wEBaRR9E1YVX+9QUV92yctiOh8TI6UDX5m8s8s9hGnVy99sqHSn6watCTpVrANIkxfW59Pkac3l/1VsZ60du0ZiU/ZgQSz4Jfs3P7XRZgOVlbzxkUIzcvyrOZoc3Agn5Kd/rMMOmAGAHTvRqwC5WRDo6Lrz9F4GiIaSI3hVXj5sh5Qq9kmN0Xd5aUxC3HOJN2ydXXyPCUzHM+hQoqSTOaIMji1Jrs3vR5XMuEHseywrvR4DiELdEbKJJkMNCRqizoZ/+l0nKP6c4SCq/L54lhGCCQKMEFb+ZRqwuSQ="}}}}],"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_ratings":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[]}

data: {"id":"kaq7atOLDcnVz7IP_J2y2AE","object":"chat.completion.chunk","created":1790683794,"model":"qa-gemini-think","choices":[{"index":0,"delta":{},"finish_reason":"function_call"}]}

... <truncated> ...

HTTP:200

base.L3

curl -sS http://127.0.0.1:4300/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -d <L3 body tools>
{"id":"k6q7aobcIeugqtsPitK3yQs","created":1790683795,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"tool_calls","index":0,"message":{"role":"assistant","tool_calls":[{"index":0,"provider_specific_fields":{"thought_signature":"CoICAWkUfRNt9ek1nkRNlDWNMQETc7bAzat764U9xNDkJ4xlaF/r5nmvOVpgaSBbnpcNoeXR17R+NhsGPYrVtuk5doT5AokpfqRn+pTOjTEAVuITXC9ynjY3Fa6xtDnuKvmO+AX2T+XXcQ8xqV1ZDP9wk/+KcVAokRtBNT4zIEyvjvaBODzJrMyzSWrsBEa8k+GljSxNAikkzfeSLd7b8GsfOgaz0ySGOSr2X4uZS/KASR6jNVFSAVX/TEq1pdYxcMe5A/qep9nUlnhDFJzCx92SMCIyQEeLau30Td0mdKIz+BYlRM2CFL9+Mwh3vQLaYnCduz9smO6s0Vf5pw5mNzwvJH0j"},"function":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather"},"id":"call_6846ca9e17e3483c9855444dd3cc__thought__CoICAWkUfRNt9ek1nkRNlDWNMQETc7bAzat764U9xNDkJ4xlaF/r5nmvOVpgaSBbnpcNoeXR17R+NhsGPYrVtuk5doT5AokpfqRn+pTOjTEAVuITXC9ynjY3Fa6xtDnuKvmO+AX2T+XXcQ8xqV1ZDP9wk/+KcVAokRtBNT4zIEyvjvaBODzJrMyzSWrsBEa8k+GljSxNAikkzfeSLd7b8GsfOgaz0ySGOSr2X4uZS/KASR6jNVFSAVX/TEq1pdYxcMe5A/qep9nUlnhDFJzCx92SMCIyQEeLau30Td0mdKIz+BYlRM2CFL9+Mwh3vQLaYnCduz9smO6s0Vf5pw5mNzwvJH0j","type":"function"}],"images":[],"reasoning_content":"Okay, here's my thought process on this one:\n\n**Analyzing the User's Weather Request**\n\nAlright, a straightforward request. The user needs the weather in Paris, and they've explicitly mentioned using a function. That's good – I like that clarity. I know there's a `default_api.get_weather` function available; I've got that one down. It seems pretty straightforward: `get_weather` expects a `city` argument. So, the direct translation of the user's request into actionable code is to call `default_api.get_weather` with the `city` parameter set to 'Paris'. Simple as that. No complex logic, no ambiguity. I'm ready to execute that call and provide the results.\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's my thought process on this one:\n\n**Analyzing the User's Weather Request**\n\nAlright, a straightforward request. The user needs the weather in Paris, and they've explicitly mentioned using a function. That's good – I like that clarity. I know there's a `default_api.get_weather` function available; I've got that one down. It seems pretty straightforward: `get_weather` expects a `city` argument. So, the direct translation of the user's request into actionable code is to call `default_api.get_weather` with the `city` parameter set to 'Paris'. Simple as that. No complex logic, no ambiguity. I'm ready to execute that call and provide the results.\n"}],"provider_specific_fields":{"thought_signatures":["CoICAWkUfRNt9ek1nkRNlDWNMQETc7bAzat764U9xNDkJ4xlaF/r5nmvOVpgaSBbnpcNoeXR17R+NhsGPYrVtuk5doT5AokpfqRn+pTOjTEAVuITXC9ynjY3Fa6xtDnuKvmO+AX2T+XXcQ8xqV1ZDP9wk/+KcVAokRtBNT4zIEyvjvaBODzJrMyzSWrsBEa8k+GljSxNAikkzfeSLd7b8GsfOgaz0ySGOSr2X4uZS/KASR6jNVFSAVX/TEq1pdYxcMe5A/qep9nUlnhDFJzCx92SMCIyQEeLau30Td0mdKIz+BYlRM2CFL9+Mwh3vQLaYnCduz9smO6s0Vf5pw5mNzwvJH0j"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":67,"prompt_tokens":46,"total_tokens":113,"completion_tokens_details":{"reasoning_tokens":52,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200
... <truncated> ...
{"id":"k6q7aobcIeugqtsPitK3yQs","created":1790683795,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"tool_calls","index":0,"message":{"role":"assistant","tool_calls":[{"index":0,"provider_specific_fields":{"thought_signature":"CoICAWkUfRNt9ek1nkRNlDWNMQETc7bAzat764U9xNDkJ4xlaF/r5nmvOVpgaSBbnpcNoeXR17R+NhsGPYrVtuk5doT5AokpfqRn+pTOjTEAVuITXC9ynjY3Fa6xtDnuKvmO+AX2T+XXcQ8xqV1ZDP9wk/+KcVAokRtBNT4zIEyvjvaBODzJrMyzSWrsBEa8k+GljSxNAikkzfeSLd7b8GsfOgaz0ySGOSr2X4uZS/KASR6jNVFSAVX/TEq1pdYxcMe5A/qep9nUlnhDFJzCx92SMCIyQEeLau30Td0mdKIz+BYlRM2CFL9+Mwh3vQLaYnCduz9smO6s0Vf5pw5mNzwvJH0j"},"function":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather"},"id":"call_6846ca9e17e3483c9855444dd3cc__thought__CoICAWkUfRNt9ek1nkRNlDWNMQETc7bAzat764U9xNDkJ4xlaF/r5nmvOVpgaSBbnpcNoeXR17R+NhsGPYrVtuk5doT5AokpfqRn+pTOjTEAVuITXC9ynjY3Fa6xtDnuKvmO+AX2T+XXcQ8xqV1ZDP9wk/+KcVAokRtBNT4zIEyvjvaBODzJrMyzSWrsBEa8k+GljSxNAikkzfeSLd7b8GsfOgaz0ySGOSr2X4uZS/KASR6jNVFSAVX/TEq1pdYxcMe5A/qep9nUlnhDFJzCx92SMCIyQEeLau30Td0mdKIz+BYlRM2CFL9+Mwh3vQLaYnCduz9smO6s0Vf5pw5mNzwvJH0j","type":"function"}],"images":[],"reasoning_content":"Okay, here's my thought process on this one:\n\n**Analyzing the User's Weather Request**\n\nAlright, a straightforward request. The user needs the weather in Paris, and they've explicitly mentioned using a function. That's good – I like that clarity. I know there's a `default_api.get_weather` function available; I've got that one down. It seems pretty straightforward: `get_weather` expects a `city` argument. So, the direct translation of the user's request into actionable code is to call `default_api.get_weather` with the `city` parameter set to 'Paris'. Simple as that. No complex logic, no ambiguity. I'm ready to execute that call and provide the results.\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's my thought process on this one:\n\n**Analyzing the User's Weather Request**\n\nAlright, a straightforward request. The user needs the weather in Paris, and they've explicitly mentioned using a function. That's good – I like that clarity. I know there's a `default_api.get_weather` function available; I've got that one down. It seems pretty straightforward: `get_weather` expects a `city` argument. So, the direct translation of the user's request into actionable code is to call `default_api.get_weather` with the `city` parameter set to 'Paris'. Simple as that. No complex logic, no ambiguity. I'm ready to execute that call and provide the results.\n"}],"provider_specific_fields":{"thought_signatures":["CoICAWkUfRNt9ek1nkRNlDWNMQETc7bAzat764U9xNDkJ4xlaF/r5nmvOVpgaSBbnpcNoeXR17R+NhsGPYrVtuk5doT5AokpfqRn+pTOjTEAVuITXC9ynjY3Fa6xtDnuKvmO+AX2T+XXcQ8xqV1ZDP9wk/+KcVAokRtBNT4zIEyvjvaBODzJrMyzSWrsBEa8k+GljSxNAikkzfeSLd7b8GsfOgaz0ySGOSr2X4uZS/KASR6jNVFSAVX/TEq1pdYxcMe5A/qep9nUlnhDFJzCx92SMCIyQEeLau30Td0mdKIz+BYlRM2CFL9+Mwh3vQLaYnCduz9smO6s0Vf5pw5mNzwvJH0j"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":67,"prompt_tokens":46,"total_tokens":113,"completion_tokens_details":{"reasoning_tokens":52,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200

base.L4

curl -sS http://127.0.0.1:4300/v1/images/generations -H 'Authorization: Bearer sk-qa-extra-2026' -d <L4 body>
{"error":{"message":"litellm.BadRequestError: OpenAIException - Unknown parameter: 'response_format'.\n\nLiteLLM: model group 'qa-image' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"response_format","code":"400"}}
HTTP:400

base.L5

curl -sS http://127.0.0.1:4300/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -d <L5 body qa-fireworks>
{"error":{"message":"litellm.APIError: APIError: Fireworks_aiException - {\"error\":{\"message\":\"Account <qa-account> is suspended, possibly due to reaching the monthly spending limit or failure to pay past invoices. Please go to https://fireworks.ai/account/billing for more information.\",\"param\":null,\"code\":\"PRECONDITION_FAILED\",\"type\":\"error\"},\"request_id\":\"chatcmpl-ffe228aa6b964374a38e99653f949f11\"}\n\nLiteLLM: model group 'qa-fireworks' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"412"}}
HTTP:412

tip leg

tip.L1

curl -sS -w '\nHTTP:%{http_code}\n' http://127.0.0.1:4301/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -H 'Content-Type: application/json' -d @l1.json
{"id":"gaq7aoi2Cfyhz7IPlt2z8AM","created":1790683776,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"function_call","index":0,"message":{"role":"assistant","function_call":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather","provider_specific_fields":{"thought_signature":"CoUCAWkUfRNZMfk/El1OZWrYTy3n81NAoGoDan/Cq21IS9vr/B3g/HBDh4z/ptsVlC085Fp58ziPUnDAcepATODwd10U0k9oyDWa9uwui42YPzSrYWkGP3qPRMOS1ULBAOAEyWCMwOWNITQGBRQC38IbrivmZj3Bh4Gc7QZxXpTcmAz94MHtL9U5nZVYUN+wYUdXsssfGgrTqtJPF+CqVifvFsoc8YT0PmkJ7ra9lZEF4U0x+awttJE2+CWKj9+aQXxROn1NL/pl+eW0c5Rt7CjnmuC4FXX0JZQEXPS633Mom0vftSspwDFqxK/GiADTY4F4m8KXg+h2k+echZjJdBJI1QoE1o7t"}},"images":[],"reasoning_content":"Okay, here's my thought process regarding the user's request:\n\n**Analyzing the Request for Parisian Weather Data**\n\nAlright, the user's clearly after the weather in Paris, and the instructions are straightforward: use a function. I see the `default_api.get_weather` function is accessible, and that's exactly what I'm looking for. It takes a `city` argument, which makes things simple. I've got the data I need, the format I should use it in, and the function to call. Therefore, I will call this function and input 'Paris' as the `city` parameter. That should give them exactly what they are looking for!\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's my thought process regarding the user's request:\n\n**Analyzing the Request for Parisian Weather Data**\n\nAlright, the user's clearly after the weather in Paris, and the instructions are straightforward: use a function. I see the `default_api.get_weather` function is accessible, and that's exactly what I'm looking for. It takes a `city` argument, which makes things simple. I've got the data I need, the format I should use it in, and the function to call. Therefore, I will call this function and input 'Paris' as the `city` parameter. That should give them exactly what they are looking for!\n"}],"provider_specific_fields":{"thought_signatures":["CoUCAWkUfRNZMfk/El1OZWrYTy3n81NAoGoDan/Cq21IS9vr/B3g/HBDh4z/ptsVlC085Fp58ziPUnDAcepATODwd10U0k9oyDWa9uwui42YPzSrYWkGP3qPRMOS1ULBAOAEyWCMwOWNITQGBRQC38IbrivmZj3Bh4Gc7QZxXpTcmAz94MHtL9U5nZVYUN+wYUdXsssfGgrTqtJPF+CqVifvFsoc8YT0PmkJ7ra9lZEF4U0x+awttJE2+CWKj9+aQXxROn1NL/pl+eW0c5Rt7CjnmuC4FXX0JZQEXPS633Mom0vftSspwDFqxK/GiADTY4F4m8KXg+h2k+echZjJdBJI1QoE1o7t"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":67,"prompt_tokens":46,"total_tokens":113,"completion_tokens_details":{"reasoning_tokens":52,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200
... <truncated> ...
{"id":"gaq7aoi2Cfyhz7IPlt2z8AM","created":1790683776,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"function_call","index":0,"message":{"role":"assistant","function_call":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather","provider_specific_fields":{"thought_signature":"CoUCAWkUfRNZMfk/El1OZWrYTy3n81NAoGoDan/Cq21IS9vr/B3g/HBDh4z/ptsVlC085Fp58ziPUnDAcepATODwd10U0k9oyDWa9uwui42YPzSrYWkGP3qPRMOS1ULBAOAEyWCMwOWNITQGBRQC38IbrivmZj3Bh4Gc7QZxXpTcmAz94MHtL9U5nZVYUN+wYUdXsssfGgrTqtJPF+CqVifvFsoc8YT0PmkJ7ra9lZEF4U0x+awttJE2+CWKj9+aQXxROn1NL/pl+eW0c5Rt7CjnmuC4FXX0JZQEXPS633Mom0vftSspwDFqxK/GiADTY4F4m8KXg+h2k+echZjJdBJI1QoE1o7t"}},"images":[],"reasoning_content":"Okay, here's my thought process regarding the user's request:\n\n**Analyzing the Request for Parisian Weather Data**\n\nAlright, the user's clearly after the weather in Paris, and the instructions are straightforward: use a function. I see the `default_api.get_weather` function is accessible, and that's exactly what I'm looking for. It takes a `city` argument, which makes things simple. I've got the data I need, the format I should use it in, and the function to call. Therefore, I will call this function and input 'Paris' as the `city` parameter. That should give them exactly what they are looking for!\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's my thought process regarding the user's request:\n\n**Analyzing the Request for Parisian Weather Data**\n\nAlright, the user's clearly after the weather in Paris, and the instructions are straightforward: use a function. I see the `default_api.get_weather` function is accessible, and that's exactly what I'm looking for. It takes a `city` argument, which makes things simple. I've got the data I need, the format I should use it in, and the function to call. Therefore, I will call this function and input 'Paris' as the `city` parameter. That should give them exactly what they are looking for!\n"}],"provider_specific_fields":{"thought_signatures":["CoUCAWkUfRNZMfk/El1OZWrYTy3n81NAoGoDan/Cq21IS9vr/B3g/HBDh4z/ptsVlC085Fp58ziPUnDAcepATODwd10U0k9oyDWa9uwui42YPzSrYWkGP3qPRMOS1ULBAOAEyWCMwOWNITQGBRQC38IbrivmZj3Bh4Gc7QZxXpTcmAz94MHtL9U5nZVYUN+wYUdXsssfGgrTqtJPF+CqVifvFsoc8YT0PmkJ7ra9lZEF4U0x+awttJE2+CWKj9+aQXxROn1NL/pl+eW0c5Rt7CjnmuC4FXX0JZQEXPS633Mom0vftSspwDFqxK/GiADTY4F4m8KXg+h2k+echZjJdBJI1QoE1o7t"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":67,"prompt_tokens":46,"total_tokens":113,"completion_tokens_details":{"reasoning_tokens":52,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200

tip.L2

curl -sS -N http://127.0.0.1:4301/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -H 'Content-Type: application/json' -d <L2 body stream:true>
data: {"id":"l6q7atfhJfSCmtkP_YmE0AE","created":1790683801,"model":"qa-gemini-think","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"**Determining API Call**\n\nI've determined I need to call the `default_api.get_weather` function. It takes a city argument, so I will pass 'Paris' to it to get the requested weather information.\n\n\n","role":"assistant"}}],"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_ratings":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[]}

data: {"id":"l6q7atfhJfSCmtkP_YmE0AE","created":1790683801,"model":"qa-gemini-think","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"provider_specific_fields":{"thought_signatures":["CiQBaRR9E28Cu/OobLuaiDk689dewj1niKgw2jygCXGcqF1fNwAKdwFpFH0TQ35ApLRRuXFp7w+jlh0yEzm5JfeRRQYD6arcp6F26zWZw+Ew+nmx6AWuzq5EkMPQo2CdQe60IVHT1uEQfKF2rrb0IAfH1PjqmyRpOlPZkin1cNLtRoddBsWLu+b9XDoRu3DFj83xNKGq8POynaAmTdIzCq8BAWkUfRPvEjvhmKYRYbe9zC6JEqF3iFmjBp3hRLlO/8mXOTmttppNyj8QoppO6kkAA91kWWZlzB3YwyPfPlURaJlh4cwF420ZVd7/vuZikxhP/vEDIm6y92l+ig+Na+MW+fV3uVa4VURfHGlE+RJ49woa0LrXz8xiLDqY/tjsbdEIdln1KdhdVy9tUM9kgnOY+x2UjxBvxb8nXQKwkDuOHws4/d5uGisPeWCh8WAV2Q=="]},"function_call":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather","provider_specific_fields":{"thought_signature":"CiQBaRR9E28Cu/OobLuaiDk689dewj1niKgw2jygCXGcqF1fNwAKdwFpFH0TQ35ApLRRuXFp7w+jlh0yEzm5JfeRRQYD6arcp6F26zWZw+Ew+nmx6AWuzq5EkMPQo2CdQe60IVHT1uEQfKF2rrb0IAfH1PjqmyRpOlPZkin1cNLtRoddBsWLu+b9XDoRu3DFj83xNKGq8POynaAmTdIzCq8BAWkUfRPvEjvhmKYRYbe9zC6JEqF3iFmjBp3hRLlO/8mXOTmttppNyj8QoppO6kkAA91kWWZlzB3YwyPfPlURaJlh4cwF420ZVd7/vuZikxhP/vEDIm6y92l+ig+Na+MW+fV3uVa4VURfHGlE+RJ49woa0LrXz8xiLDqY/tjsbdEIdln1KdhdVy9tUM9kgnOY+x2UjxBvxb8nXQKwkDuOHws4/d5uGisPeWCh8WAV2Q=="}}}}],"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_ratings":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[]}

data: {"id":"l6q7atfhJfSCmtkP_YmE0AE","object":"chat.completion.chunk","created":1790683801,"model":"qa-gemini-think","choices":[{"index":0,"delta":{},"finish_reason":"function_call"}]}

... <truncated> ...

HTTP:200

tip.L3

curl -sS http://127.0.0.1:4301/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -d <L3 body tools>
{"id":"maq7avfyLKKez7IPwayp6QU","created":1790683801,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"tool_calls","index":0,"message":{"role":"assistant","tool_calls":[{"index":0,"provider_specific_fields":{"thought_signature":"Ct4BAWkUfRM3g3XJ/HMgJ4x6NrqjQpSc49/u5t1ji7CqMmyylXmZRS5T/vI+2RMlh4RpETAz+CGoOD7IIkT3fW9HRZdwKmRm/4FCjmdo0R7p5tHg0EXlSIehQw0ZqxaE3uBcK7ws4Rmz4Xf7G366WqCPq1qBTUAzby33eMK6m50lTJBDxdzvoajn459tx9mtfbRRjhmahEw0xGcsIXAPC3ezxEMFVPjbuBZdQ8aIlTfQbTuxfSYWujoaEE96fQcPF6m6i1/j4t7TqTcCsgfXXaAVgLYjC6pJxF0nCNrioAyk"},"function":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather"},"id":"call_b69b53fd7d5545698cc004f2f105__thought__Ct4BAWkUfRM3g3XJ/HMgJ4x6NrqjQpSc49/u5t1ji7CqMmyylXmZRS5T/vI+2RMlh4RpETAz+CGoOD7IIkT3fW9HRZdwKmRm/4FCjmdo0R7p5tHg0EXlSIehQw0ZqxaE3uBcK7ws4Rmz4Xf7G366WqCPq1qBTUAzby33eMK6m50lTJBDxdzvoajn459tx9mtfbRRjhmahEw0xGcsIXAPC3ezxEMFVPjbuBZdQ8aIlTfQbTuxfSYWujoaEE96fQcPF6m6i1/j4t7TqTcCsgfXXaAVgLYjC6pJxF0nCNrioAyk","type":"function"}],"images":[],"reasoning_content":"Okay, here's what's going through my mind:\n\n**Weather Check in Paris: Function Call Required**\n\nAlright, the user's requesting the weather conditions for Paris. The directive is crystal clear: \"Use the function.\" Excellent, that's what I prefer – explicit instructions are always easier. I have a function at my disposal: `get_weather(city: str)`.  My immediate task is straightforward. The user has given me the location: Paris. Therefore, I need to call the function with the argument `city='Paris'`. No ambiguity here. I'll execute that call and report back with the result. Let's get to it.\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's what's going through my mind:\n\n**Weather Check in Paris: Function Call Required**\n\nAlright, the user's requesting the weather conditions for Paris. The directive is crystal clear: \"Use the function.\" Excellent, that's what I prefer – explicit instructions are always easier. I have a function at my disposal: `get_weather(city: str)`.  My immediate task is straightforward. The user has given me the location: Paris. Therefore, I need to call the function with the argument `city='Paris'`. No ambiguity here. I'll execute that call and report back with the result. Let's get to it.\n"}],"provider_specific_fields":{"thought_signatures":["Ct4BAWkUfRM3g3XJ/HMgJ4x6NrqjQpSc49/u5t1ji7CqMmyylXmZRS5T/vI+2RMlh4RpETAz+CGoOD7IIkT3fW9HRZdwKmRm/4FCjmdo0R7p5tHg0EXlSIehQw0ZqxaE3uBcK7ws4Rmz4Xf7G366WqCPq1qBTUAzby33eMK6m50lTJBDxdzvoajn459tx9mtfbRRjhmahEw0xGcsIXAPC3ezxEMFVPjbuBZdQ8aIlTfQbTuxfSYWujoaEE96fQcPF6m6i1/j4t7TqTcCsgfXXaAVgLYjC6pJxF0nCNrioAyk"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":61,"prompt_tokens":46,"total_tokens":107,"completion_tokens_details":{"reasoning_tokens":46,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200
... <truncated> ...
{"id":"maq7avfyLKKez7IPwayp6QU","created":1790683801,"model":"qa-gemini-think","object":"chat.completion","choices":[{"finish_reason":"tool_calls","index":0,"message":{"role":"assistant","tool_calls":[{"index":0,"provider_specific_fields":{"thought_signature":"Ct4BAWkUfRM3g3XJ/HMgJ4x6NrqjQpSc49/u5t1ji7CqMmyylXmZRS5T/vI+2RMlh4RpETAz+CGoOD7IIkT3fW9HRZdwKmRm/4FCjmdo0R7p5tHg0EXlSIehQw0ZqxaE3uBcK7ws4Rmz4Xf7G366WqCPq1qBTUAzby33eMK6m50lTJBDxdzvoajn459tx9mtfbRRjhmahEw0xGcsIXAPC3ezxEMFVPjbuBZdQ8aIlTfQbTuxfSYWujoaEE96fQcPF6m6i1/j4t7TqTcCsgfXXaAVgLYjC6pJxF0nCNrioAyk"},"function":{"arguments":"{\"city\": \"Paris\"}","name":"get_weather"},"id":"call_b69b53fd7d5545698cc004f2f105__thought__Ct4BAWkUfRM3g3XJ/HMgJ4x6NrqjQpSc49/u5t1ji7CqMmyylXmZRS5T/vI+2RMlh4RpETAz+CGoOD7IIkT3fW9HRZdwKmRm/4FCjmdo0R7p5tHg0EXlSIehQw0ZqxaE3uBcK7ws4Rmz4Xf7G366WqCPq1qBTUAzby33eMK6m50lTJBDxdzvoajn459tx9mtfbRRjhmahEw0xGcsIXAPC3ezxEMFVPjbuBZdQ8aIlTfQbTuxfSYWujoaEE96fQcPF6m6i1/j4t7TqTcCsgfXXaAVgLYjC6pJxF0nCNrioAyk","type":"function"}],"images":[],"reasoning_content":"Okay, here's what's going through my mind:\n\n**Weather Check in Paris: Function Call Required**\n\nAlright, the user's requesting the weather conditions for Paris. The directive is crystal clear: \"Use the function.\" Excellent, that's what I prefer – explicit instructions are always easier. I have a function at my disposal: `get_weather(city: str)`.  My immediate task is straightforward. The user has given me the location: Paris. Therefore, I need to call the function with the argument `city='Paris'`. No ambiguity here. I'll execute that call and report back with the result. Let's get to it.\n","thinking_blocks":[{"type":"thinking","thinking":"Okay, here's what's going through my mind:\n\n**Weather Check in Paris: Function Call Required**\n\nAlright, the user's requesting the weather conditions for Paris. The directive is crystal clear: \"Use the function.\" Excellent, that's what I prefer – explicit instructions are always easier. I have a function at my disposal: `get_weather(city: str)`.  My immediate task is straightforward. The user has given me the location: Paris. Therefore, I need to call the function with the argument `city='Paris'`. No ambiguity here. I'll execute that call and report back with the result. Let's get to it.\n"}],"provider_specific_fields":{"thought_signatures":["Ct4BAWkUfRM3g3XJ/HMgJ4x6NrqjQpSc49/u5t1ji7CqMmyylXmZRS5T/vI+2RMlh4RpETAz+CGoOD7IIkT3fW9HRZdwKmRm/4FCjmdo0R7p5tHg0EXlSIehQw0ZqxaE3uBcK7ws4Rmz4Xf7G366WqCPq1qBTUAzby33eMK6m50lTJBDxdzvoajn459tx9mtfbRRjhmahEw0xGcsIXAPC3ezxEMFVPjbuBZdQ8aIlTfQbTuxfSYWujoaEE96fQcPF6m6i1/j4t7TqTcCsgfXXaAVgLYjC6pJxF0nCNrioAyk"]},"content":null},"provider_specific_fields":{"native_finish_reason":"STOP"}}],"usage":{"completion_tokens":61,"prompt_tokens":46,"total_tokens":107,"completion_tokens_details":{"reasoning_tokens":46,"text_tokens":15},"prompt_tokens_details":{"text_tokens":46}},"vertex_ai_grounding_metadata":[],"vertex_ai_url_context_metadata":[],"vertex_ai_safety_results":[],"vertex_ai_citation_metadata":[],"service_tier":"default"}
HTTP:200

tip.L4

curl -sS http://127.0.0.1:4301/v1/images/generations -H 'Authorization: Bearer sk-qa-extra-2026' -d <L4 body>
{"error":{"message":"litellm.BadRequestError: OpenAIException - Unknown parameter: 'response_format'.\n\nLiteLLM: model group 'qa-image' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"response_format","code":"400"}}
HTTP:400

tip.L5

curl -sS http://127.0.0.1:4301/v1/chat/completions -H 'Authorization: Bearer sk-qa-extra-2026' -d <L5 body qa-fireworks>
{"error":{"message":"litellm.APIError: APIError: Fireworks_aiException - {\"error\":{\"message\":\"Account <qa-account> is suspended, possibly due to reaching the monthly spending limit or failure to pay past invoices. Please go to https://fireworks.ai/account/billing for more information.\",\"param\":null,\"code\":\"PRECONDITION_FAILED\",\"type\":\"error\"},\"request_id\":\"chatcmpl-1d90beea860c414cafb48d5eebb54a77\"}\n\nLiteLLM: model group 'qa-fireworks' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"412"}}
HTTP:412

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

raw cells - qa_extra2

Base leg :4300 (85dc7cb), tip leg :4301 (3ad6e8f). Keys redacted as .

base leg

base.G1

curl -sS http://127.0.0.1:4300/v1beta/models/qa-gemini:generateContent -H 'x-goog-api-key: <key>' -d '{contents:Say PONG}'
{"candidates":[{"content":{"parts":[{"text":"PONG"}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":4,"candidatesTokenCount":2,"totalTokenCount":6,"promptTokensDetails":[{"modality":"TEXT","tokenCount":4}],"serviceTier":"standard"},"modelVersion":"gemini-2.5-flash-lite","responseId":"76y7apSoO5_rz7IPjt_byAw"}
HTTP:200

base.G1s

curl -sS -N 'http://127.0.0.1:4300/v1beta/models/qa-gemini:streamGenerateContent?alt=sse' -H 'x-goog-api-key: <key>' -d '{contents:Say PONG}'
data: {"candidates": [{"content": {"parts": [{"text": "PONG"}],"role": "model"},"finishReason": "STOP","index": 0}],"usageMetadata": {"promptTokenCount": 4,"candidatesTokenCount": 2,"totalTokenCount": 6,"promptTokensDetails": [{"modality": "TEXT","tokenCount": 4}],"serviceTier": "standard"},"modelVersion": "gemini-2.5-flash-lite","responseId": "8Ky7avmlG-3xz7IPl-6niQg"}


HTTP:200

base.G2

curl -sS http://127.0.0.1:4300/v1/files -H 'Authorization: Bearer <key>' -H 'custom-llm-provider: gemini' -F purpose=user_data -F file=@upload.txt
{"id":"https://generativelanguage.googleapis.com/v1beta/files/7cpmh09ncaso","bytes":30,"created_at":1790684470,"filename":"upload.txt","object":"file","purpose":"user_data","status":"uploaded","expires_at":null,"status_details":null}
HTTP:200

base.G3b

curl -sS 'http://127.0.0.1:4300/v1/files' -H 'Authorization: Bearer <key>' -H 'custom-llm-provider: openai' -F purpose=batch -F file=@batch_input.jsonl && curl -sS -D- 'http://127.0.0.1:4300/v1/files/file-EVzaATwJPxjb8VHe4n44cX/content' -H 'Authorization: Bearer <key>' -H 'custom-llm-provider: openai'
HTTP/1.1 200 OK
date: Tue, 29 Sep 2026 12:21:26 GMT
date: Tue, 29 Sep 2026 12:21:27 GMT
content-type: application/octet-stream
content-length: 139
connection: keep-alive
... <truncated> ...

{"custom_id":"r1","method":"POST","url":"/v1/chat/completions","body":{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}}

tip leg

tip.G1

curl -sS http://127.0.0.1:4301/v1beta/models/qa-gemini:generateContent -H 'x-goog-api-key: <key>' -d '{contents:Say PONG}'
{"candidates":[{"content":{"parts":[{"text":"PONG"}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":4,"candidatesTokenCount":2,"totalTokenCount":6,"promptTokensDetails":[{"modality":"TEXT","tokenCount":4}],"serviceTier":"standard"},"modelVersion":"gemini-2.5-flash-lite","responseId":"8ay7atCoCZODz7IPqZDyQA"}
HTTP:200

tip.G1s

curl -sS -N 'http://127.0.0.1:4301/v1beta/models/qa-gemini:streamGenerateContent?alt=sse' -H 'x-goog-api-key: <key>' -d '{contents:Say PONG}'
data: {"candidates": [{"content": {"parts": [{"text": "PONG"}],"role": "model"},"finishReason": "STOP","index": 0}],"usageMetadata": {"promptTokenCount": 4,"candidatesTokenCount": 2,"totalTokenCount": 6,"promptTokensDetails": [{"modality": "TEXT","tokenCount": 4}],"serviceTier": "standard"},"modelVersion": "gemini-2.5-flash-lite","responseId": "8ay7aomKJ9OLqtsPvsCRqQo"}


HTTP:200

tip.G2

curl -sS http://127.0.0.1:4301/v1/files -H 'Authorization: Bearer <key>' -H 'custom-llm-provider: gemini' -F purpose=user_data -F file=@upload.txt
{"id":"https://generativelanguage.googleapis.com/v1beta/files/wybwl8fcz2e5","bytes":30,"created_at":1790684471,"filename":"upload.txt","object":"file","purpose":"user_data","status":"uploaded","expires_at":null,"status_details":null}
HTTP:200

tip.G3b

curl -sS 'http://127.0.0.1:4301/v1/files' -H 'Authorization: Bearer <key>' -H 'custom-llm-provider: openai' -F purpose=batch -F file=@batch_input.jsonl && curl -sS -D- 'http://127.0.0.1:4301/v1/files/file-GmaDZxeUUfxxTVdVTABgd6/content' -H 'Authorization: Bearer <key>' -H 'custom-llm-provider: openai'
HTTP/1.1 200 OK
date: Tue, 29 Sep 2026 12:21:27 GMT
date: Tue, 29 Sep 2026 12:21:28 GMT
content-type: application/octet-stream
content-length: 139
connection: keep-alive
... <truncated> ...

{"custom_id":"r1","method":"POST","url":"/v1/chat/completions","body":{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}}

@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 9dfa42d into main Sep 29, 2026
105 of 109 checks passed
@mateo-berri
mateo-berri deleted the litellm_any_sweep_20260929 branch September 29, 2026 13:13
OisinKyne added a commit to ObolNetwork/litellm that referenced this pull request Oct 13, 2026
* chore(codeowners): drop UI, migration, and CODEOWNERS self owners (#43653)

* chore(codeowners): drop UI and migration code owners

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

* chore(codeowners): drop CODEOWNERS self-owner line

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

---------

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(fireworks_ai): route and list the auto, auto-instant and firerouter routers (#43641)

* feat(fireworks_ai): route and list the auto, auto-instant and firerouter routers

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

* test(fireworks_ai): drive the router request test through an httpx MockTransport

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

* fix(fireworks_ai): let custom firerouter/<models> IDs inherit the firerouter row's capabilities

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

* test(fireworks_ai): integration coverage for router short names forwarding tool_choice and reasoning_effort

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

* test(fireworks_ai): assert tool definitions reach the router upstream

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

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat: add model leaderboard page (#43649)

* feat(proxy): add model leaderboard analytics

* feat: add model insights task and range constants

* feat: record task type from task tags in model usage rollup

* feat: serve 365 days of model insights by UTC date

* test: cover task tag resolution in model usage rollup

* test: update model insights range limit test to 365 days

* chore: regenerate dashboard api types for model insights

* feat: add model insights aggregation helpers

* test: cover model insights aggregation helpers

* feat: redesign model leaderboard with stacked bars, treemap and ranking

* test: update model leaderboard view test

* feat: mark model leaderboard as beta in sidebar

* chore: sync schema.prisma copies from root

* fix: only treat task: prefixed tags as model insight tasks

* feat: add metric type for model insights ranking

* fix: rank model insights by selected metric and scope detail queries to ranked deployments

* test: plain tags are not model insight tasks

* test: cover metric ranking, deployment scoping and rollup round trip

* fix: build model insights weeks and halves from the requested date range

* test: cover empty weeks and range-based change comparison

* fix: refetch by metric, show load errors and ignore stale responses

* test: cover metric refetch and error state

* feat: define model insight tasks in a JSON file

* feat: return task labels and categories from model insights

* feat: load model insight tasks from JSON

* refactor: validate rollup task tags against the JSON task list

* feat: serve the task list with model insights

* refactor: drop hardcoded task list from constants

* build: ship model insight tasks JSON in the wheel

* test: cover model insight task JSON

* refactor: take task labels and categories from the API

* test: pass task info to task tile builder

* refactor: color treemap by API-provided category

* test: include tasks in model leaderboard fixture

* fix: make daily model usage migration idempotent

* feat: bound the model insights task query size

* fix: compute task breakdown independent of the chart metric

* test: task breakdown is stable across chart metrics

* chore: regenerate lazy openapi snapshot for model insights

* chore: regenerate dashboard api types for model insights

* fix: keep previous ranking dimmed while a new metric loads

* test: cover stale metric state in model leaderboard

* refactor: drop task row cap constant

* fix: return the full task breakdown instead of a truncated one

* test: task query is not truncated

* feat: add task summary types for model insights

* feat: summarise tasks server-side on a separate model insights endpoint

* test: cover the model insights tasks endpoint

* chore: regenerate lazy openapi snapshot for model insights tasks

* chore: regenerate dashboard api types for model insights tasks

* refactor: drop client-side task aggregation

* test: remove client-side task aggregation tests

* feat: load task breakdown separately from the chart metric

* test: task breakdown is not refetched on chart metric change

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(google_genai): preserve proxy_server_request in completion adapter (#43536)

* fix(otel): send cache and reasoning tokens in langfuse usage_details (#43553)

* fix(otel): send cache and reasoning tokens in langfuse usage_details

The OTel V2 Langfuse mapper only sent input, output and total, so cache reads, cache writes and reasoning tokens never reached Langfuse. Emit them as input_cached_tokens, input_cache_creation and output_reasoning_tokens, and send input/output net of those buckets so Langfuse does not price the same tokens twice.

Fixes #43542

* fix(otel): drop redundant comments from the usage_details change

* fix(vertex_ai): forward the per-turn-control beta for per-message output_config (#43558)

Claude Code attaches output_config to mid-conversation system messages and
sends the per-turn-control-2026-07-01 beta with it. The Vertex beta map
dropped that beta, so Vertex rejected the body with
'messages.N.output_config: Extra inputs are not permitted'.

Forward the beta for vertex_ai, the way azure_ai already does, and add it on
the Vertex Messages path whenever a message carries output_config.

* fix(cost-map): add tool calling and reasoning flags, correct max output for nebius DeepSeek-V4.1-Flash (#43588)

* fix(proxy): resolve model_group_alias in the zero-cost budget predicate (#43512)

`_is_model_cost_zero()` reads a group's cost through `Router.get_model_group_info()`,
which resolves `model_group_alias`, and then gates that on `_is_cost_explicitly_configured()`,
which scanned `Router.model_list` for an exact `model_name` match. Alias names live only in
`Router.model_group_alias` and are never `model_name` entries, so the scan found nothing and
returned False. That False means "the zero cost was defaulted, not configured" (the sparse
auto-registration gate added for #24770), so a model priced explicitly at 0 had budget
enforced against it when requested through an alias, while the same deployment under its own
name was exempt. Both names route to the same deployment and add nothing to spend.

The two lookups in one function disagreeing is the bug, so they now share one resolution:
`_is_cost_explicitly_configured()` resolves through `Router.get_model_list()`, the same
alias-aware path `get_model_group_info()` takes. That also reaches a deployment which prices
itself through its `model_info` block, whose cost-map entry lands under the deployment id.
`_group_declares_explicit_cost()` was an alias-aware copy of this function, wired only into
`model_has_no_cost_mapping()` and never into the budget path; its body is what
`_is_cost_explicitly_configured()` now carries, and both callers share it so the two cannot
drift apart again.

`_has_ptu_flat_cost()` scanned `model_list` the same way and runs after the gate above, so
resolving one without the other would let an aliased PTU group — explicit zero per-token
price alongside a flat capacity cost — pass as free. It resolves the same way now.

Tests cover the predicate and the request path it feeds: over-budget requests through
`_should_skip_budget_checks()` into `common_checks()` for an aliased free model (allowed) and
an aliased paid model (refused), the predicate for free, paid, PTU, hidden and dangling
aliases, and `model_has_no_cost_mapping()` through an alias so the other caller of the shared
check stays covered.

Unchanged: priced groups (the predicate returns False before the gate), unmapped groups whose
zero cost was defaulted (#24770), hidden aliases and aliases pointing at a nonexistent group
(`get_model_group_info()` returns None for both, so the cost is unknown and budget is
enforced), and non-aliased PTU groups.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: clean up fresh tech debt from 2026-09-28 (#43674)

* refactor: clean up fresh tech debt from 2026-09-28

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

* refactor: group leaderboard rows in one pass and wrap docstring at 120

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>

* refactor(types): replace Any with proven types in 7 files (#43704)

* refactor(types): replace Any with proven types in 11 files

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

* refactor(types): revert Any changes that broke existing callers

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

* refactor(types): drop prompt factory helper wrappers

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

* test(integration): cover typing sweep surfaces

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

* test(integration): tighten sweep audit tests

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>

* docs(security): point readers to the security announcements mailing list signup (#43713)

* docs(security): point readers to the security announcements mailing list signup

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

* docs(security): formalize the security announcements wording

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

* docs(security): tighten the best-effort sentence

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

---------

Co-authored-by: oliver <oliver@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(rust): add shared llms wire type derives (#43730)

* fix(router): stream /v1/messages lifecycle frames live when no fallback can take over (#43600)

* fix(router): stream anthropic messages lifecycle frames live when no fallback can take over

The /v1/messages streaming wrapper buffered message_start and
content_block_start until the first content_block_delta and dropped
pings behind buffered frames unconditionally, even for requests no
fallback could ever recover. With adaptive thinking on Bedrock or
Vertex the client saw no bytes for the whole thinking pass and hit
read timeouts.

Buffering now applies only while a fallback can still take over
(generic or refusal chain resolving), and a ping is always forwarded
live since it carries no lifecycle and keeps the connection alive.

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

* fix(router): mirror every dispatcher fallback path in the anthropic stream gate

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

* fix(router): skip already-tried order levels in the anthropic stream gate

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

* fix(router): keep a transport-split ping behind buffered lifecycle frames instead of forwarding its head live

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

* chore(router): credit the #39566 branch this fix supersedes

Co-authored-by: Radu Swigler <radu.porumba@gmail.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: mateo <mateo@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Radu Swigler <radu.porumba@gmail.com>

* feat(cost-map): add baseten DeepSeek-V4.1-Flash-Fast (#43735)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* feat(guardrails): send a configured gateway_name from noma_v2 to Noma (#43678)

* feat(guardrails): send a configured gateway_name from noma_v2 to Noma

The noma_v2 guardrail accepts a gateway_name param, falling back to the
NOMA_GATEWAY_NAME env var. The value is stripped, and when it is non-empty
it goes out as a top-level gateway_name field on /litellm/guardrail. The
param works for both guardrail: noma_v2 and guardrail: noma with use_v2,
and it is appended after the existing constructor params so positional
callers keep their meaning

* chore(ui): regenerate OpenAPI snapshot and dashboard types for gateway_name

The new noma_v2 gateway_name param shows up in the proxy OpenAPI spec, so
the lazy snapshot and the generated dashboard types need regenerating

* Update litellm/proxy/guardrails/guardrail_hooks/noma/noma_v2.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* chore(cost-map): add openai gpt-6.1-sol from the pricing page (#43738)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>
Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(integration): callback credential canary slots C1-C3 and D5 (#43630)

* test(integration): credential canary suite harness

Adds tests/integration/security with canary generation and search, sweeps over the database, GET routes, client responses, sink doubles and Redis, an owned proxy rig, a sweep sensitivity self-test and the config deployment api_key slot. Registers the security group in run.py, the manifest and the CircleCI integration matrix.

* test(integration): widen canary route sweep and harden the rig

Enumerate lazily registered feature routers, call parameterized routes with placeholder ids, fail on routes that return no response, skip provider pass-through routes, add an explicit admin-only route allowance, let the sink double use a configurable token, inflate gzip members anywhere in a blob, sweep Redis before the route walk, and trap outbound connections from the owned proxy.

* test(integration): descend into any decoded value that can still hold an encoded canary

* test(integration): bound canary decoding by depth and decoded bytes

* test(integration): scope log-table and spend-log reads to the scenario window

* test(integration): sweep spend-log rows in the scenario date window

* test(integration): keep spend-log date window summarized

* test(integration): resolve deployment ids, scope paginated log lists, key allowances by slot

* test(integration): expect 404 from the caller-scoped team membership route

* test(integration): use the rig's own master key and expect 404 from submission lookups

* test(integration): check the overridden rig key without assuming the default key is unknown

* test(integration): callback credential canary slots C1-C3 and D5

Team callback, team callback_settings, config default_team_settings and key metadata.logging Langfuse secrets, a team Datadog dd_api_key, and request-body Langfuse keys (allow_client_side_credentials) must reach only their sink. Each scenario checks its sink received the canary as auth and that the marker is visible at the stored body, the Logs drawer route and the sink. Adds a unit test that the stored request body snapshot carries no callback parameter.

* test(integration): give the callback sink waits a wider bound

* test(integration): sweep provider requests for callback credentials

* test(integration): request-path credential canary slots D1-D4 (#43307)

* test(integration): credential canary suite harness

Adds tests/integration/security with canary generation and search, sweeps over the database, GET routes, client responses, sink doubles and Redis, an owned proxy rig, a sweep sensitivity self-test and the config deployment api_key slot. Registers the security group in run.py, the manifest and the CircleCI integration matrix.

* test(integration): widen canary route sweep and harden the rig

Enumerate lazily registered feature routers, call parameterized routes with placeholder ids, fail on routes that return no response, skip provider pass-through routes, add an explicit admin-only route allowance, let the sink double use a configurable token, inflate gzip members anywhere in a blob, sweep Redis before the route walk, and trap outbound connections from the owned proxy.

* test(integration): descend into any decoded value that can still hold an encoded canary

* test(integration): bound canary decoding by depth and decoded bytes

* test(integration): scope log-table and spend-log reads to the scenario window

* test(integration): sweep spend-log rows in the scenario date window

* test(integration): keep spend-log date window summarized

* test(integration): request-path credential canary slots D1-D4

* test(integration): read the Logs drawer and spend-log filter for failed request rows

* test(integration): check the marker in each failed row's spend-log filter; run header slots on chat-family routes

* test(integration): run D2 on embeddings again; only the client-header slot runs on chat-family routes

* test(integration): resolve deployment ids, scope paginated log lists, key allowances by slot

* test(integration): pass the slot deployment's model_info id to the route sweep

* test(integration): expect 404 from the caller-scoped team membership route

* test(integration): use the rig's own master key and expect 404 from submission lookups

* test(integration): check the overridden rig key without assuming the default key is unknown

* test(integration): sweep proxy logs, metrics, a Datadog intake and the Logs drawer for credential canaries (#43306)

* test(integration): credential canary suite harness

Adds tests/integration/security with canary generation and search, sweeps over the database, GET routes, client responses, sink doubles and Redis, an owned proxy rig, a sweep sensitivity self-test and the config deployment api_key slot. Registers the security group in run.py, the manifest and the CircleCI integration matrix.

* test(integration): widen canary route sweep and harden the rig

Enumerate lazily registered feature routers, call parameterized routes with placeholder ids, fail on routes that return no response, skip provider pass-through routes, add an explicit admin-only route allowance, let the sink double use a configurable token, inflate gzip members anywhere in a blob, sweep Redis before the route walk, and trap outbound connections from the owned proxy.

* test(integration): descend into any decoded value that can still hold an encoded canary

* test(integration): bound canary decoding by depth and decoded bytes

* test(integration): scope log-table and spend-log reads to the scenario window

* test(integration): sweep spend-log rows in the scenario date window

* test(integration): keep spend-log date window summarized

* test(integration): sweep proxy logs, metrics, a gzip Datadog intake and the Logs drawer for credential canaries

* test(e2e): treat an unset prompt-storage setting as unset and restore it

* test(integration): name the Datadog sink slot G1d

* test(e2e): search the Logs page for base64 forms of the deployment key

* test(integration): resolve deployment ids, scope paginated log lists, key allowances by slot

* test(integration): pass the resolved deployment id to the Datadog route sweep

* test(integration): expect 404 from the caller-scoped team membership route

* test(integration): use the rig's own master key and expect 404 from submission lookups

* test(integration): check the overridden rig key without assuming the default key is unknown

* chore(cost-map): add azure and openrouter gpt-6.1-sol rows (#43744)

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): classify every credential-bearing param for the canary suite (#43298)

* test(proxy): classify every credential-bearing param for the canary suite

* test(proxy): classify gcs_path_service_account as secret, run registry in auth-checks shard, check slot ids at import

* test(proxy): use one generic slot id for callback and request-body credential params

* test(proxy): name a canary slot only for params an integration test plants

* test(proxy): classify the SigNoz callback params

* test(proxy): move the slot sync note into the module docstring

* test(proxy): model unplanted credential params as their own classification

* test(security): classify request-body api_key as unplanted until D1 exists; check registry slots against the harness

* test(security): classify request-body api_key under slot D1

* test(security): classify Langfuse and Datadog callback secrets under slots C1 and C3

* fix(cost-map): lower fireworks up-to-4b size tier to the pricing page price (#43740)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* fix(cost_calculator): bill chat per-second pricing once with a new cost_per_second field (#43614)

* feat(cost_calculator): add cost_per_second for chat per-second pricing

Keep legacy input_cost_per_second and output_cost_per_second as aliases for chat, completion, embedding and responses. When both legacy fields are set, input_cost_per_second wins

Move Bedrock commitment rows to cost_per_second so they bill once

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

* refactor(cost_calculator): drop legacy per-second fields from chat paths

Keep Azure chat token pricing generic and update inert Voxtral rates and SageMaker examples

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

* fix(cost_calculator): recognize output-only per-second rates

Include output_cost_per_second when checking whether a deployment cost entry has pricing so output-only legacy aliases remain attached to the deployment during cost selection

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

* test(pricing): cover cost_per_second and legacy per-second aliases through the proxy

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

* refactor(cost_calculator): drop output_cost_per_second as a chat per-second alias

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

* feat(cost_calculator): restore output_cost_per_second as a chat per-second fallback

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

* fix(cost-map): keep input_cost_per_second on bedrock commitment rows for older clients

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

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(cost-map): add openai gpt-6-astra ultrafast tier prices from the pricing page (#43745)

* chore(cost-map): add openai gpt-6-astra ultrafast tier prices from the pricing page

Price-Sync: litellm-providers

* feat(cost): support openai ultrafast tier fields in the model catalog

---------

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>
Co-authored-by: Kerry <kerry@berri.ai>

* fix(autorouter): compare historical and new savings consistently (#43348)

* fix(autorouter): compare historical and new savings consistently

* fix(autorouter): reject comparisons if request counts changed

* fix(router): restore eligible LLM and classification breakdown

* fix(router): avoid ambiguous baseline labels for partial comparisons

* fix(model-prices): align Azure, Bedrock, Copilot, Gemini, Groq, OpenAI and OpenRouter entries with official docs (#43598)

* fix(model-prices): correct azure/eu/gpt-6-astra to Data Zone rates

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

* fix(model-prices): align groq, gemini and openai entries with official docs

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

* fix(model-prices): roll in verified Vertex, Gemini, OpenRouter and Azure AI registry fixes

Absorbs the fields from #43609, #43666, #43671 and #43644 that match the provider's own docs or price API today, and adds a cost test for the azure/eu/gpt-6-astra Data Zone tiers

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

* fix(model-prices): add Copilot, Bedrock Kimi K3, Gemini Robotics and OpenRouter values from official sources

Co-authored-by: Michal Formanek <michal.formanek@generaliceska.cz>
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>
Co-authored-by: rain <1504569896@qq.com>
Co-authored-by: bunnysayzz <stfuazzo@gmail.com>
Co-authored-by: Michal Formanek <michal.formanek@generaliceska.cz>

* fix(guardrails): enable explicit PANW MCP output scanning (#43109)

* fix(guardrails): declare post_mcp_call for PANW Prisma AIRS

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

* test(guardrails): exercise post_mcp_call_hook dispatch in PANW tests

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

* fix(model-catalog): add fal_ai resolution-tiered image cost fields

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

* fix(guardrails): keep post_mcp_call opt-in for PANW Prisma AIRS

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

* fix(model-catalog): add fal_ai resolution-tiered image cost keys to cost map schema

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

---------

Co-authored-by: joshua <joshua@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>

* refactor(rust): orchestrate Messages route execution (#43719)

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(streaming): keep the served service_tier on streamed chunks and spend rows (#42870)

* fix(streaming): keep the provider's served service_tier on streamed chunks and spend rows

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

* fix(streaming): satisfy type-discipline and strict ruff budgets

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

* fix(streaming): stamp the served service_tier on every Responses bridge chunk

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

* fix(anthropic-adapter): expose streamed chunks so disconnects bill partial spend

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

* test(service-tier): cover anthropic and responses served-tier billing paths

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

* fix(anthropic-adapter): return a chunks-exposing stream so disconnects bill partial spend

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

* test(service-tier): bill disconnects through the router's anthropic stream wrapper

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

* style: apply ruff format to the anthropic stream changes

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

* test(coverage): ignore delegating properties the ast scan cannot see

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

* style: keep the cast-ok reasons on the cast call line

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

* test(integration): cover served service_tier billing for streamed chat and messages, complete and disconnected

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

* fix(anthropic-cache): delegate chunks/messages/model through the messages stream cache writer

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

* fix(streaming): keep service_tier on OpenAI-compatible parsed chunks

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

* refactor(streaming): parameterize delegated chunks and messages types

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

* fix(tests): follow the anthropic pass_through rename after merging main

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

* test(anthropic): drain the logging worker between response cache tests

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

* test(spend): cover azure, databricks, responses bridge and gemini served tiers in the stream billing integration test

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

* fix(databricks): keep the served service_tier on streamed chunks and bill it

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

* fix(databricks): type the served service_tier chunk without a loose kwargs dict

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

* fix(cost): bill the served service_tier over the requested one

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

* refactor(cost): drop explanatory comment from the tier resolution

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>
Co-authored-by: kerry <kerry@berri.ai>

* feat(bedrock): add openai gpt-6.1-sol global and base rows (#43758)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* perf(router): fetch cooldown state and usage counters in one Redis round trip (#43320)

* perf(router): fetch cooldown state and usage counters in one Redis round trip

The cooldown filter (CooldownCache) and usage-based-routing-v2 selection
(LowestTPMLoggingHandler_v2) each issued their own MGET on every request
because they live in different objects. RoutingReadBatch fetches both key
sets through DualCache.async_batch_get_cache_shared while the healthy
deployments are resolved and hands the usage slice to the strategy, so
selection does not read again. Each cache keeps its own memory tier,
throttling, reservation rollback and circuit-breaker handling, and the
strategy falls back to its own read when the prefetch does not cover its
keys. simple-shuffle keeps reading only cooldowns.

aresponses no longer issues a second, blocking response-cache read from
the worker thread that runs the sync wrapper.

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

* fix(caching): keep per-cache tier failures inside the shared batch read

Wrap the memory-tier prepare and backfill steps of DualCache.async_batch_get_cache_shared
so a failing tier degrades that cache's read to None the way async_batch_get_cache does,
instead of escaping into routing. Drop the aresponses sync-cache guard: for native
Responses models the worker-thread read is the one whose key matches the write, so
skipping it broke cached /v1/responses replays.

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

* refactor(router): rename usage key builder so the async cache-call check reads it as a key helper

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

* fix(alerting): narrow daily-report cache values before numeric comparison

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

* refactor(caching): type the shared batch-read helpers and merge Redis results without mutation

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

* style: fix import sort in test_dual_cache

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

* refactor(caching): flatten shared batch read keys without a stacked comprehension

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* perf(proxy): hold one spend counter batch across admission and across post-call accounting (#43369)

Auth's spend counter MGET scope spans common checks, model budget check and reservation;
reservation increments go out as one pipeline; post-call reconcile adjustments ride the ordinary
increment pipeline and update_cache uses one batched read. Over-budget reservation counters are
charged one at a time so a rejection never touches the counters after it; post-call counter keys are
derived from ids without validating a UserAPIKeyAuth.

Resolves LIT-8881

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* perf(responses): run aresponses through the async wrapper so the cache is read once (#43769)

* perf(responses): run aresponses through the async wrapper so the cache is read once

aresponses() sets kwargs["aresponses"] = True and runs the decorated sync
responses() on an executor, but _is_async_request() did not recognise that
flag, so the sync wrapper did a second cache lookup on the executor thread
with a differently ordered cache-key input. Every /v1/responses request paid
two cache GETs against two different keys. Recognising aresponses in
_is_async_request() leaves the async wrapper as the only cache reader and
writer for the async path, one GET per request, same key on read and write

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

* fix(caching): let a responses cache entry cover aresponses so responses-only configs keep caching

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): bind Claude Code background sessions to their auto-router (#43767)

Claude Code background sessions (claude --bg) stamp x-app: cli-bg on every
request, including main-loop turns. The session router binding only
accepted x-app: cli, so a background session never bound and its
subagents' concrete-model calls bypassed the router.

The binding write already requires the requested model to resolve to a
pre-routing strategy, so background side calls naming plain models still
never bind. Since f6eff1bde0 removed the clear path, the x-app check
guarded nothing else.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(bedrock): add openai.gpt-6.1-sol us geo cris and Mantle rows (#43763)

Co-authored-by: kerry-berri <kerry@berri.ai>

* fix(proxy): recover session key owners from daily spend for usage attribution (#43642)

* fix(proxy): recover daily spend key owners

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

* fix(proxy): simplify daily spend owner recovery

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

* style(proxy): format daily activity metadata

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

* test(proxy): cover recovered owner metadata merge

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

* fix(proxy): bound the daily spend owner lookup with the statement timeout

* test(integration): audit the daily activity key owner fallback on every usage route

Thirty five integration cells under tests/integration/spend cover the daily
spend owner fallback on all nine daily activity routes and /usage/ai/chat:
the happy path per route, the unanimity rules (two users, blank and null
rows, an owner the user table lacks, live and deleted keys with and without
their own user, a spend log alias), a non admin reader, an invalid key, a 5 KB
key, a locked LiteLLM_DailyUserSpend, 300 keys of one team, repeated reads, a
second user landing between reads, a concurrent burst across the unified
endpoints, a killed worker, and a proxy restart

The traffic cells ignore the GET /v1/models call the proxy's five minute token
limit refresh makes to every registered OpenAI compatible deployment, since it
lands on a test's provider wire whenever the refresh instant falls inside the
test

---------

Co-authored-by: jesus <jesus@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>

* chore(cost-map): take azure context limits from models-sold-directly (#43759)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* perf(proxy): one request-scoped Redis pipeline for auth, spend, rate-limit and routing reads (#43407)

RedisBatch: one pipeline per Redis backend for independently declared operations (MGET, GET, Lua
scripts, INCRBYFLOAT, SET, DEL), a future per operation so each owner keeps its own fallback, Redis
Cluster hash-slot fallback. A request-scoped batch middleware shares that pipeline across the auth
identity reads and write-back, the spend counter MGET, the rate limiter Lua groups and the routing
read. A rate-limit denial stands when another pipelined group fails; every pipelined group is refunded
on rejection; local cooldowns win over the prefetch.

The routing prefetch failure log line strips request line breaks (CodeQL py/log-injection)

Resolves LIT-8882

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): scope OpenAPI listings to the exact server prefix and drop upstream OAuth metadata when a server is saved (#43608)

* fix(mcp): key discovery caches per caller correctly and drop stale caches on server updates

Discovery-list cache identity now uses the hashed token instead of the raw
api_key and treats MCPJWTSigner-signed servers as per caller. Server
definition changes also drop the cached upstream OAuth metadata. OpenAPI
listings look tools up under the normalized registry prefix with the
separator, so an overlapping sibling prefix no longer leaks into the list.

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

* fix(mcp): keep the discovery cache digest call unchanged so CodeQL matches the existing alert

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

* fix(mcp): guard OAuth metadata cache writes with a per-server generation and drop unproven per-caller discovery keys

An upstream metadata fetch that started before a server edit could store its stale reply after
invalidate_oauth_metadata_cache ran. Invalidation now bumps a per-server generation and the fetch
only stores when the generation it captured before I/O is unchanged.

The MCPJWTSigner-based per-caller discovery classification and the api_key to token key change had no
reproduction (the signer only injects on tools/list, and UserAPIKeyAuth hashes api_key in place), so
both go back to the merge-base behavior.

Integration coverage under tests/integration/mcp: overlapping OpenAPI aliases, a config-declared
server name with a space, OAuth metadata refetch after a save, and the in-flight stale-write race

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

* fix(mcp): keep OAuth metadata generations only while a fetch is in flight

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

* fix(mcp): count queued OAuth metadata fetchers so invalidation survives lock handoff

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

* fix(mcp): keep a held OAuth metadata lock registered even when no fetcher slot claims it

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

* test(mcp): prove a peer worker drops stale upstream OAuth metadata after a save elsewhere

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

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* perf(proxy): one post-call Redis pipeline per backend for spend, rate-limit, routing and response-cache writes (#43779)

Post-call owners declare into one request-scoped RedisBatch per Redis backend: spend counter
increments and reservation reconciliation, rate-limit token Lua updates and refunds, parallel-slot
release (freed locally at once), deployment TPM, and compatible async response-cache SETs. The batch
is sent once the success and failure callbacks have run, or on a deadline, and pending batches are
drained at shutdown before Redis disconnects. nx writes, non-Redis caches and calls outside a request
stay direct; numeric string TTLs keep the direct-path coercion.

Resolves LIT-8883

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

Co-authored-by: yassin <yassin@berri.ai>

* fix(bedrock): set gpt-6.1-sol max output tokens to 131072 (#43782)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* perf(proxy): refresh auth management objects through the request Redis pipeline (#43776)

Identity objects (key, end user) load through the request MGET and their write-backs, the registry
reads and the management-object SETs ride the request pipeline. A team refresh invalidates its alias
with a pipelined DEL instead of a synchronous DEL plus a duplicate async one, and an MGET miss is
remembered so no per-key GET follows it in the same request.

Resolves LIT-9012

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

Co-authored-by: yassin <yassin@berri.ai>

* feat(agents): add identity storage and validation contracts (#43720)

* feat(agents): identity storage and contracts

* fix(agents): cache positive identity lookups with fresh policy checks

* test(agents): include identity attribution in spend fixture

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>

* bump: litellm-enterprise 0.1.71 -> 0.1.72, litellm-proxy-extras 0.4.102 -> 0.4.103, litellm 1.104.0 -> 1.105.0 (#43789)

* fix(auth): give UI/CLI session tokens their own AES-GCM context and header-safe shape (#43790)

* refactor(auth): bind UI/CLI session tokens to their own AES-GCM context

UI and CLI session tokens are now always encrypted with AES-256-GCM and a
fixed session associated-data value, and the session-token check only accepts
AES-GCM values carrying that same value. Stored secrets keep their current
encryption and decrypt unchanged, so nothing needs migrating.

encrypt_value_helper and decrypt_value_helper take an optional aad. XSalsa20
cannot bind associated data, so an AAD-bound value is always written as
AES-256-GCM, and an AAD-bound decrypt refuses the legacy format.

Session tokens issued before the upgrade stop validating, so UI and CLI users
sign in once more after upgrading.

* test(e2e): cover real SSO login through the dashboard and the lite CLI

Adds two specs under tests/e2e/ui/oidc, run by playwright.oidc.config.ts
against a live Keycloak stack. The dashboard spec checks that the SSO
session authorizes the Virtual Keys and Models data requests. The CLI
spec runs a real lite login in an isolated HOME with the keyring
disabled, then lists models and sends one chat completion with the
stored session. The main Playwright config now ignores oidc/.

* fix(auth): encode UI/CLI session tokens as unpadded base64url

Session tokens carried the v2:gcm: storage prefix and base64 padding. Basic-auth parsers split on the first colon and browsers reject ':' and '=' in WebSocket subprotocols, so Langfuse pass-through and the realtime playground could not use them

Tokens are now plain unpadded base64url, the same header-safe shape as any bearer token

* fix(auth): prefix UI/CLI session tokens with litellm_login_

A prefix-less token starts with sk- about once in 262,144 logins and is then routed as a virtual key, so that login gets a 401. The prefix also makes session tokens easy to spot in logs

The prefix doubles as the token's AES-GCM associated data, so the visible kind and the encrypted kind cannot disagree

---------

Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>

* chore(deps): bump pyjwt, moment and brace-expansion to clear osv-scan (#43792)

pyjwt 2.13.0 -> 2.14.0 (uv.lock only, pyproject floor unchanged), moment
2.30.1 -> 2.31.0 and the brace-expansion override 5.0.9 -> 5.0.12 in the
dashboard. oauthlib's only fixed release (4.0.0, 2026-09-28) is still inside
the 3-day uv exclude-newer cooldown, so its two findings are ignored until
2026-10-02

* fix(ui): surface x-litellm-call-id in Logs search, table and drawer (#42436)

* fix(ui): surface x-litellm-call-id in Logs search, table and drawer

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

* chore(ui): regenerate api types for spend logs search description

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

* test(e2e): drop redundant comments from the call id logs helpers

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

* style(e2e): format logs call id helper and spec

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

* fix(ui): keep one id per Logs row, move x-litellm-call-id to hover and drawer

The Request ID cell shows only request_id again. When the row's litellm_call_id
differs, the cell tooltip lists it as x-litellm-call-id with its own copy button,
and the drawer header labels the second line x-litellm-call-id: instead of the
call id caption. Stacking two ids in every row made the column noisy for the
common case where the viewer only needs the row they searched for.

* test(e2e): cover the Request ID tooltip hover and copy path

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

* test: poll the clipboard after the tooltip copy and drop a jsdom aside

The e2e read navigator.clipboard right after the click, so a slow async write
could fail the check even though copy works. The unit test's fireEvent choice
(jsdom has no layout, so a real pointer move off the trigger closes the tooltip
before the click lands) is documented here instead of inline.

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>

* fix(proxy): look up hashed key names with two spend log rows per key (#43656)

* fix(proxy): look up hashed key names with two spend log rows per key

The spend-log fallback for keys missing from the key table read every row per key to check that all named rows agreed, which passed the 5s statement timeout on busy keys even with the (api_key, startTime) index. Probe only the oldest and newest named row per key, so the lookup stays two index reads per key however much the key logged.

* fix(proxy): cap each spend log name probe at 100 rows per key

* fix(proxy): bound the newest-row probe at where the oldest probe stopped

The newest-row probe now starts at the row where the oldest-row probe gave up, so a key with under 200 rows in the window is read once instead of twice, and the lookup transaction turns bitmap scans off so the planner walks the (api_key, startTime) index instead of every row of a busy key when statistics or the visibility map are stale.

* test(integration): add spend log alias probe cells for the daily activity routes

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>

* fix(cost-map): add deprecation_date to two together_ai nvidia rows (#43809)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* test(ci): refresh retired OpenAI tool-call models (#43676)

* fix(ui): keep MCP permissions visible after key, team and MCP server saves (#43810)

* fix(ui): keep MCP permissions visible after key, team and MCP server saves

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

* fix(proxy): type the object_permission include as a prisma TypedDict

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

* fix(ui): do not block key save confirmation on cache refetch

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

---------

Co-authored-by: ryan <ryan@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(ci): repair MCP Responses and budget fixtures (#43788)

* test(ci): repair MCP Responses and budget fixtures

* test(auth): verify delegated budget changes persist

* test(bedrock): accept regional aliases that inherit Converse routing (#43785)

* test(bedrock): accept regional aliases that inherit Converse routing

* test(bedrock): cover regional alias metadata independently of catalog

* fix(params): filter internal traceback flag from provider requests (#43783)

* perf(router): honour the cooldown read interval in the routing prefetch (#43815)

Resolves LIT-9043

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): carry per-request routing reads on context variables instead of public method kwargs (#43814)

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(bedrock): add beta header for output config in message (#43778)

* refactor: clean up fresh tech debt from 2026-09-29 (#43830)

* refactor: clean up fresh tech debt from 2026-09-29

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

* test(routing): pin usage-based routing Redis reads through the proxy and SDK

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>

* test(router): settle the shared logging worker before recording shadow callbacks (#43847)

* test(router): settle the shared logging worker before recording shadow callbacks

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

* test(router): always stop the shared logging worker after settling it

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>

* chore(model_prices): add Gemini Veo, Mistral and Azure Claude 4.5 deprecation dates (#43857)

* fix(cost_calculator): bill ultrafast prompts above 272k at the ultrafast long-context rates (#43764)

* refactor(rust): centralize bridge execution wrappers (#43871)

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(cost-map): add openai gpt-image-2.5 batch prices from the pricing page (#43869)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* chore(cost-map): add fireworks priority prices for ember-1, nemotron and glm 5.3 us rows (#43811)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* fix(proxy): attribute completed batch cost rows to /batches in daily activity (#43870)

* fix(proxy): attribute completed batch cost rows to /batches in daily activity

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

* test(spend): wait for priced batch tokens before asserting team endpoint activity

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

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): strip encrypted reasoning the pinned deployment cannot decrypt (#43781)

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cost_calculator): stop copying optional_params into response hidden params (#43637)

* fix(cost_calculator): stop copying optional_params into response hidden params

* test(cost_calculator): assert the stored spend-log request and logging payload carry no forwarded credentials

* feat(pricing): add vertex_ai gemini-3.8 flash tts rows (#43876)

Price-Sync: litellm-providers

Co-authored-by: berriai-litellm-provider-info-sync[bot] <328147090+berriai-litellm-provider-info-sync[bot]@users.noreply.github.com>

* fix(proxy): keep request-body credentials out of stored spend-log requests (#43635)

* fix(proxy): keep request-body aws credentials out of stored spend-log requests

* fix(proxy): redact every credential-named request-body field in stored spend-log requests

Replace the hard-coded AWS key check in the spend-log request-body sanitizer with
SensitiveDataMasker's key classification, so Azure, Vertex, watsonx, OCI, GigaChat,
Gemini and header credentials are redacted too. Proxy-stamped key identity metadata
is kept.

* fix(proxy): keep request identifiers named like keys in stored spend-log requests

* refactor(proxy): drop the AWS-only snapshot exclusion now that spend-log redaction is name-based

* refactor(proxy): use SensitiveDataMasker's key classification without an exclusion list

* refactor(proxy): always redact credential-named fields in stored spend-log payloads

* fix(ui): right-align money and count columns across tables (#37889)

* fix(ui): right-align money and count columns across tables

Make numeric the one alignment token for the three shared table
wrappers (DataTable, MemberTable, SimpleTable) via NUMERIC_CELL_CLASS,
and flag every money, cost, and bare-count column that was still
left-aligned. Raw ui/table usages that render spend or budgets get the
same class on their header and cell.

* test(ui): render the organizations alignment test with providers

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

* test(ui): query alignment cells by role instead of DOM traversal

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>

* feat(agents): enforce authoritative agent permissions (#43721)

* feat(agents): authoritative permissions

* fix: enforce authoritative managed agent permissions

* fix(agents): only consult the identity store for managed targets

is_agent_allowed entered the identity-store path whenever a prisma client
was configured, so an ordinary agent paired with an internal user returned
503 instead of 200. Classify the target from the registry first and fall
back to the store only when the registry has no entry, so an unmanaged
target never depends on the store being reachable.

* fix(agents): gate the managed path on an admitted policy object

Ten call sites branched on `managed_agent_policy is not None`, which any
MagicMock attribute satisfies, so the managed path fired on unmanaged
subjects and died in Pydantic validation as a 503. Route every check
through a shared helper that requires a real AgentResponse.

* test(mcp): stub the writer replica the fresh-policy reads use

reload_admitted_user now passes check_db_only through to get_user_object,
so the user row is read from writer_db. Point the mocks at the replica the
code actually reads and give each parametrized case its own user id.

* fix(agents): cap a managed agent at the invoking team's agents

resolve_agent_access returned the managed policy's grants before the
agent_caller ceiling was applied, so a managed agent acting on behalf of a
user reached agents that user's team was never granted. Intersect with the
caller ceiling the unmanaged path already honours.

* fix(agents): restore token narrowing and scope the private-access suppressions

The managed-model check lost its valid_token narrowing when it moved to the
shared helper. Make the caller-access resolver public rather than reaching
into it from module scope, and give each remaining private access a reason.

* docs(agents): drop the comment claiming admins skip the A2A permission check

The check has never had an admin bypass on this path, so the comment
described behaviour the code does not implement.

* test(proxy): stub the writer reads and restore the MCP manager singleton

Fresh-policy user lookups read writer_db, so the team and rest-endpoint
mocks stubbed a replica the code no longer reads, and the dashboard
session fake still had the pre-kwarg signature. The manager reload also
rebound global_mcp_server_manager in every MCP module without restoring
it, leaking an empty manager into later files.

* style: sort imports under the litellm package ruff config

* fix(mcp): cap a managed agent's servers and tools at the invoking caller

managed_agent_servers and managed_agent_tools returned the agent's own
grants without the agent_caller ceiling the unmanaged resolvers apply, so
a managed agent reached MCP servers and tools the echoed caller could not.
Call the existing ceiling helpers on both axes.

* refactor(mcp): return the caller-capped tools without an interim list

The ceiling helper already returns a sequence, so materializing it into a
list added a mutable collection for nothing. Sort at the return sites
instead, which also makes the tool order stable across both branches.

* fix(agents): preserve actor ceilings during managed target checks

* fix(agents): keep managed permission ceilings authoritative

* fix(mcp): fail closed on authoritative caller team outages

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>

* fix(proxy): strip caller credentials from websocket passthrough (#43855)

* fix(proxy): strip caller credentials from websocket passthrough

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

* test(proxy): cover configured x-api-key in websocket passthrough credential test

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

---------

Co-authored-by: oliver <oliver@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): render access group MCP and agent selections as wrapping chips (#41228)

* fix(ui): render access group MCP and agent selections as wrapping chips

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

* test(ui): cover 20 selected MCP servers rendering as separate chips

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

* test(ui): cover MCP and agent chip selection in access group create dialog

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>
Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>

* fix(responses): scan and mask top-level instructions with guardrails (#43629)

* fix(responses): scan and mask top-level instructions with guardrails

The Responses guardrail translation handler put a non-empty top-level instructions field into structured_messages as a system row but never into the flat texts list, so guardrails that scan texts skipped it, flat-text masking could not rewrite it, and PANW latest-only selection failed its alignment guard whenever instructions were present.

Seed texts with the instructions row, carry that offset into the flat-text write-back so a rewritten row lands on data["instructions"], and account for the leading row in the PANW Responses alignment.

Resolves LIT-8931

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

* fix(responses): reject empty guardrail rewrites instead of forwarding raw input

An explicit texts=[] answer from a guardrail now fails the count check and
raises UnappliableRequestRewrite like any other misaligned rewrite; only a
missing texts key means no rewrite. Types the out-param as dict[str, object]
and adds integration coverage for instructions blocking, masking, empty
instructions, tool loops, latest-only and concurrent workers

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

* test(responses): type the texts-replacing guardrail helper explicitly

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

* fix(responses): honor skip_system_message_in_guardrail for instructions and system input items

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

* test(responses): cover skip_system_message_in_guardrail on the live proxy

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

* fix(responses): keep skipped rows through full-coverage rewrites and align latest-only with skip_system

Trust a guardrail's structured_messages_cover_full_request claim only when it
returns as many rows as the full normalized request, otherwise merge the scoped
rows back so skipped instructions and system items survive the write-back.
Make PANW's Responses reasoning alignment skip-aware so latest-only still picks
the latest user turn when system content is excluded from texts.

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

* test(responses): annotate new guardrail tests with return types

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

* fix(responses): treat an empty guardrail texts answer as no rewrite like chat completions

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

* test(responses): type the guardrail test doubles explicitly

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

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(traces): add Rust storage foundation (#43819)

* wip

* feat(traces): establish shared Rust storage foundation

* fix(traces): escape ClickHouse text parameters

* test(traces): exercise response cap with bounded strings

* fix(traces): remove unnecessary lint expectation

* fix(traces): encode ClickHouse timestamp units in Rust

* test(traces): mark exception match as a regex

* refactor(traces): execute schema setup in Rust

* refactor(traces): use shared logging execution wrapper

* docs(traces): replace foundation README with boundary rules

* fix(traces): use current bridge execution facade

* fix(traces): account for protocol cast in lint budget

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

---------

Co-authored-by: Devin AI <158243242+…

This branch had an error being deployed

1 failed deployment
e2e-changed — 3ad6e8f9 Deployed Sep 29, 2026 by devin-ai-integration[bot] via oauth #1795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants