Commit graph

36177 commits

Author SHA1 Message Date
Arindam200
6d12161627 Enhance navigation and sorting functionality in Docusaurus config 2026-03-18 21:45:43 +05:30
Arindam200
06901143aa Update release notes section 2026-03-18 21:25:08 +05:30
Krish Dholakia
0d7425a437
Merge pull request #23774 from michelligabriele/fix/model-level-guardrails-non-streaming-postcall
fix(proxy): model-level guardrails not executing for non-streaming post_call
2026-03-18 08:26:02 -07:00
Arindam200
9ad52b1bf3 update: authors image url & linkedin url 2026-03-18 20:42:29 +05:30
Arindam Majumder
643bfdd042
Update docs/my-website/docs/proxy/docker_quick_start.md
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-18 20:36:56 +05:30
Arindam200
4bedb6439e update sidebar 2026-03-18 20:13:56 +05:30
Arindam200
ca71028798 merge: update sidebars for mcp docs
Made-with: Cursor
2026-03-18 20:05:07 +05:30
Arindam200
40c7873166 chore(docs): add mcp_zero_trust sidebar entry
Made-with: Cursor
2026-03-18 20:04:41 +05:30
Krish Dholakia
b4a5e51668
Merge pull request #23820 from joereyna/release-notes/v1.82.3-v2 2026-03-18 07:10:24 -07:00
Sameer Kankute
ea80a19a39 Fix greptile review 2026-03-18 18:07:25 +05:30
Sameer Kankute
b56fdf188e Fix greptile review 2026-03-18 17:57:27 +05:30
Sameer Kankute
8e943929a2 docs(sidebar): add vertex PayGo tutorial under Spend Tracking
Made-with: Cursor
2026-03-18 17:52:51 +05:30
Sameer Kankute
17efd96e61 docs(vertex): add concise PayGo/Priority guide with cost-tracking flow
Document how to send Vertex Priority PayGo headers and explain how trafficType maps to service-tier pricing in LiteLLM, including an embedded flow diagram for quick understanding.

Made-with: Cursor
2026-03-18 17:49:03 +05:30
Alexandros Solanos
3759d1c82f
Merge branch 'main' into improve-llm-repeated-message-detection-performance 2026-03-18 12:55:36 +01:00
Mr. Ånand
76c8b388f6
Merge pull request #5 from Astrodevil/v0-docs
docs: Learn page updates, card links, integrations, sidebar changes
2026-03-18 17:20:31 +05:30
Mr. Ånand
143cd66fa0 docs: Learn page updates, card links, integrations, sidebar changes
- Remove Explore section from Learn page
- Common Tasks: Stream Responses → core_request_response_patterns, Use Tools → tools_integrations, Add Routing → routing-load-balancing
- Rename Router & Fallbacks card to Routing & Load Balancing on docs index
- Fix Agent & MCP Gateway cards, add letta to Agent SDKs sidebar
- Gateway quickstart: Make LLM Requests card first, rename from Connect SDKs
- Integrations: fix View all links (observability_integrations, guardrail_providers)
- SDK quickstart: remove Use Gateway card, keep When To Use Gateway section

Made-with: Cursor
2026-03-18 17:19:27 +05:30
Sameer Kankute
f29b4981a0 fix(prompting): preserve separator for assistant(tc)->assistant edge case
When scanning backward over counted messages, preserve old behavior for
adjacent assistant turns by inserting user_continue if the immediate
previous raw message is assistant. This handles malformed
assistant(tool_calls)->assistant(no-tool-calls) inputs without splitting
valid assistant(tool_calls)->tool chains.

Made-with: Cursor
2026-03-18 17:13:42 +05:30
Sameer Kankute
021540b2e2 fix: prevent double prompt management in async path, preserve optional params
- aresponses() now pops prompt_id from kwargs after the async hook runs
  and passes merged_optional_params via _async_prompt_merged_params.
  responses() checks for this internal kwarg first and skips the sync
  hook entirely when present — eliminating double-merge of template
  messages.
- merged_optional_params from async_get_chat_completion_prompt is no
  longer discarded (_); it flows through to local_vars in responses().
- Async tests now assert get_chat_completion_prompt.assert_not_called()
  to directly detect any double-execution regression.

Made-with: Cursor
2026-03-18 17:09:28 +05:30
Andrzej Pomirski
cf8d1ac521 fix: streaming container_id and consistent Pydantic types in output
- Populate container_id on streaming code_interpreter_results by
  re-emitting at message_delta when container info arrives
- Reconstruct Pydantic OutputCodeInterpreterCall objects from plain
  dicts in _extract_tool_result_output_items so responses_output
  has uniform types across streaming and non-streaming paths
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
d10007cef4 test: add non-bash skip test and mock end-to-end streaming integration test
- test_non_bash_tool_result_skipped: verifies text_editor results produce
  zero code_interpreter_call items
- test_end_to_end_streaming_chunks_to_code_interpreter_output: exercises
  full path from Anthropic SSE chunks through ModelResponseIterator,
  stream_chunk_builder, and _extract_tool_result_output_items without
  a live server
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
8f60117228 fix: guard code_interpreter conversion to bash_code_execution results only
Skip non-bash tool result types (e.g. text_editor_code_execution_tool_result)
to avoid producing empty code_interpreter_call items in Responses API output.
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
3962fbc33a fix: non-dict tool result content falls back to outputs=None
Replace str(content) fallback with empty string so non-dict content
(e.g. list-shaped text_editor results) produces outputs=None instead
of raw Python object representations in logs.
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
5b3e84f383 fix: address remaining review feedback
- Empty stdout/stderr now produces outputs=None (matching OpenAI parity)
  instead of outputs=[{logs:""}], in both streaming and non-streaming paths
- Fix test fixture to use real Anthropic type "bash_code_execution_tool_result"
  instead of "code_execution_tool_result"
- Add test for empty-output → outputs=None behavior
- Add unit tests for _extract_tool_result_output_items: Pydantic objects,
  plain dicts (post-model_dump), empty/missing provider_specific_fields,
  and in-place substitution preserving output ordering
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
4be1d76fd7 fix: empty stdout/stderr produces str(content) instead of empty logs
When both stdout and stderr are empty strings, the `if parts else
str(content)` fallback produced the raw dict representation as logs.
Drop the fallback so logs is correctly empty.
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
2bf8751f6b fix: streaming code_interpreter_results dropped for multiple code executions
stream_chunk_builder uses "last value wins" for list-valued
provider_specific_fields keys. _build_code_interpreter_results was
emitting only new items (incremental), so earlier results were silently
dropped when multiple sequential code executions occurred.

- Emit cumulative list from _build_code_interpreter_results, matching
  web_search_results pattern
- Assemble server_tool_use input from input_json_delta deltas at
  content_block_stop (Anthropic streams input: {} in start block)
- Handle dict items in _extract_tool_result_output_items after
  model_dump() serialization in stream_chunk_builder
- Simplify _merge_provider_specific_fields to last-value-wins for lists,
  matching stream_chunk_builder semantics
2026-03-18 12:37:13 +01:00
Andrzej Pomirski
92b89353ae fix: surface Anthropic code execution results as code_interpreter_call in Responses API
PR #18945 added support for capturing Anthropic server-side tool results
(bash_code_execution_tool_result, etc.) in provider_specific_fields, but
the data never reached the Responses API output because:

1. Non-streaming: provider_specific_fields wasn't copied into _hidden_params
2. Streaming: chunk delta's provider_specific_fields wasn't accumulated
3. Tool results weren't mapped to standard output items

This fix:
- Copies provider_specific_fields to _hidden_params in transform_response()
- Accumulates provider_specific_fields from streaming chunk deltas
- Maps bash_code_execution_tool_result to code_interpreter_call output items
  with code and outputs (matching OpenAI's native shape)
- Removes redundant function_call items for server-side tools
- Adds OutputCodeInterpreterCall type to the output union
2026-03-18 12:37:13 +01:00
Sameer Kankute
22fc08d602 fix(prompting): revert _insert_assistant_continue_message to adjacent-check logic
Restore backward-compatible behavior: only insert assistant_continue
between directly adjacent user messages, not across tool-call chains.
The _counts_for_alternation skip logic was a silent behavioral change
for [user, assistant(tc), tool, user] sequences.

Made-with: Cursor
2026-03-18 16:59:16 +05:30
Sameer Kankute
d333dc4077 address greptile review feedback (greploop iteration 1)
- Fix async path: call async_get_chat_completion_prompt in aresponses()
  before executor dispatch, mirroring acompletion() in main.py. Discard
  merged_optional_params in async path (sync responses() handles them
  via local_vars), avoiding TypeError from duplicate kwargs in partial().
- Fix provider re-resolution: replace "/" in model heuristic with
  model != original_model comparison so bare model names are handled.
- Add 3 async tests covering hook invocation, optional param
  propagation, and non-message item filtering in aresponses().

Made-with: Cursor
2026-03-18 16:49:07 +05:30
Sameer Kankute
67f5ce9c7c address greptile review feedback (greploop iteration 1)
- Restore backward compat for leading assistant(tool_calls) — always prepend user_continue
- Replace partial assertions with full list assertion in trailing tool-call test

Made-with: Cursor
2026-03-18 16:41:26 +05:30
Sameer Kankute
b32f5ea379 Fix greptile comments 2026-03-18 16:37:52 +05:30
Sameer Kankute
0941e40363 fix(prompting): address greptile review - fix SyntaxError, restore backward compat, add trailing tool-call test
- Remove stray ): on line 303 (P0 SyntaxError)
- Restore backward-compatible trailing-assistant behavior (P1)
- Add test_ensure_alternating_roles_trailing_tool_call_assistant
- Keep role check alongside _counts_for_alternation (P2 is false positive)

Made-with: Cursor
2026-03-18 16:30:42 +05:30
Sameer Kankute
35b3ed58a8 Fix greptile review 2026-03-18 16:19:11 +05:30
Sameer Kankute
ae350ed370 Fix greptile comments 2026-03-18 16:10:33 +05:30
Sameer Kankute
7e4ec10007
Update litellm/litellm_core_utils/prompt_templates/common_utils.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-18 16:08:15 +05:30
Sameer Kankute
f1421d1082 fix(prompting): preserve tool chains in alternation insertion
Avoid inserting assistant continue messages in the middle of assistant tool_call->tool chains by inserting before the next counted user turn, and add regression coverage for this edge case.

Made-with: Cursor
2026-03-18 15:55:51 +05:30
Sameer Kankute
0d70864d09 Add support for prompt management for responses 2026-03-18 15:48:31 +05:30
Sameer Kankute
3cdabff323 Fix greptile review 2026-03-18 15:45:09 +05:30
Sameer Kankute
b9266bb3b9 Fix ensure_alternating_roles for correct order 2026-03-18 15:25:57 +05:30
Cursor Agent
3f7f23cd3c
chore: restore original dev_config.yaml
Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-18 08:51:12 +00:00
Cursor Agent
5e7645a99b
chore: remove unused imports (get_key_object, _cache_key_object)
These were only used in block_key/unblock_key for cache refresh,
which now uses _delete_cache_key_object instead.

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-18 08:47:44 +00:00
Cursor Agent
b428cfb4a4
test: add unit tests for block_key/unblock_key with non-existent keys
- test_block_key_nonexistent_key_returns_404: verifies block_key returns
  404 (not misleading 401) when the key doesn't exist in the DB
- test_unblock_key_nonexistent_key_returns_404: same for unblock_key
- test_block_key_existing_key_succeeds: verifies block_key succeeds and
  invalidates cache for existing keys
- Update test_unblock_key_supports_both_sk_and_hashed_tokens to reflect
  the new cache invalidation pattern (_delete_cache_key_object instead
  of get_key_object + _cache_key_object)

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-18 08:44:22 +00:00
Cursor Agent
19efe556cb
fix: /key/block and /key/unblock return 404 instead of misleading 401 for non-existent keys
The block_key() and unblock_key() handlers previously returned a
misleading 401 'Authentication Error' when the body 'key' didn't exist
in the database, even though authentication (via Authorization header)
succeeded correctly.

Root cause: After auth passed, the handlers called get_key_object() for
cache refresh. This function was designed for auth token lookup and
raises ProxyException(code=401) when a token isn't found. Additionally,
Prisma's update() silently returns None for non-existent records instead
of raising an error, so the code reached get_key_object() without
detecting the missing key.

Fix:
- Add an explicit existence check (find_unique) before the update
- Return 404 ProxyException with 'Key not found' if the key doesn't exist
- Replace get_key_object() + manual cache update with _delete_cache_key_object()
  to invalidate the cache (next read will re-fetch from DB)
- Reuse the find_unique result for audit logs, eliminating duplicate queries

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-18 08:41:32 +00:00
Arindam Majumder
464e5fa2b4
Merge pull request #4 from Astrodevil/v0-docs
V0 docs
2026-03-18 13:46:21 +05:30
Arindam200
b200d472f5 fix: docker proxy guide 2026-03-18 13:38:23 +05:30
yuneng-jiang
bbabdaab38
Merge pull request #23973 from BerriAI/litellm_/fervent-hypatia
[Refactor] UI - Playground: Extract FilePreviewCard from ChatUI
2026-03-18 00:44:17 -07:00
yuneng-jiang
cd549bf4f5 [Refactor] UI - Playground: Extract FilePreviewCard from ChatUI
Extract duplicate file preview JSX blocks (responses and chat image
previews) into a reusable FilePreviewCard component, reducing ~50
lines of duplicated markup in ChatUI.tsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 00:40:00 -07:00
Arindam200
70a9e6038e fix:expected response 2026-03-18 13:03:39 +05:30
Arindam200
3fd50c9132 docker proxy guide fix 2026-03-18 12:58:57 +05:30
Sameer Kankute
32ded9b2f8 fix double-billing issue 2026-03-18 12:47:42 +05:30
Sameer Kankute
7660f39fdb fix(file_search): promote DB helper, suppress sub-call billing, add queries-plural test
- Promote _fetch_managed_vector_stores_by_uuids from @staticmethod to a module-level
  async helper get_managed_vector_store_rows_by_uuids, following the same standalone
  helper pattern as get_team_object / get_key_object so the hot-path DB read is a
  named importable function rather than an inline prisma_client.db.* call
- Pass no-log=True to both inner _call_aresponses sub-calls so they do not fire
  independent billing/monitoring callbacks; cost is accumulated in the synthesized
  response's _hidden_params for the outer responses() call
- Add test_H11b covering the primary queries (plural array) function-tool schema,
  complementing H11 which exercises only the backward-compat singular query path

Made-with: Cursor
2026-03-18 11:38:49 +05:30