Commit graph

36177 commits

Author SHA1 Message Date
Cesar Garcia
bbec0f7657
Update litellm/proxy/response_api_endpoints/endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 20:57:05 -03:00
Cesar Garcia
13dbcb182c
Update transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 20:43:05 -03:00
Julio Quinteros
7512f7dfc3 fix(lint): resolve PLR0915 too-many-statements in 4 files
Extract helpers to reduce statement count below the 50-statement limit:

- a2a_protocol/main.py: extract _execute_a2a_send_with_retry() (56 → 43)
- fine_tuning/main.py: extract _resolve_fine_tuning_timeout() (53 → 48)
- generic_guardrail_api.py: extract _build_request_headers() (51 → 49)
- mcp_streaming_iterator.py: extract _handle_initial_response_phase() (73 → 31)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 20:34:15 -03:00
Ishaan Jaff
b7f43d411a
feat(ui): add time to first token (TTFT) to logs (#22819)
* feat(ui): add TTFT (s) column to request logs table

* feat(ui): add Time to First Token metric to log detail drawer

* docs: add TTFT screenshot
2026-03-04 15:19:07 -08:00
Harshit Jain
063a1a437a
Update litellm/proxy/management_endpoints/jwt_key_mapping_endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-05 04:43:37 +05:30
Marty Sullivan
0909eee744
add missing bedrock models (#22810) 2026-03-04 15:13:09 -08:00
Cesar Garcia
1fb38dfa31
Update litellm/llms/openai/responses/count_tokens/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:54:49 -03:00
Ishaan Jaff
09e1a06f47
fix(ui): allow internal users/team admins to select guardrails when creating keys (#22816)
* fix(proxy): add guardrails list routes for internal users

* fix(ui): add guardrails fetch with v1/v2 fallback in networking

* fix(ui): allow internal users/team admins to select guardrails in create key modal

* fix(ui): show guardrails selector for internal users in key edit view

* fix(ui): pass canEditGuardrails flag to key info view

* test(ui): add tests for role-based guardrails access in key info view

* test(ui): update key edit view test for guardrails
2026-03-04 14:54:05 -08:00
Cesar Garcia
028dd3fddc
Merge pull request #22814 from Chesars/fix/gemini-live-supported-endpoints
fix: update gemini-live model endpoints and mode to realtime
2026-03-04 19:47:05 -03:00
Cesar Garcia
d346f5cfab
Merge pull request #17550 from Chesars/fix/gemini-async-streaming-custom-client-17148
Fix: User specified async client ignored with Gemini streaming+async
2026-03-04 19:46:51 -03:00
Cesar Garcia
59c64cb633
Update litellm/proxy/response_api_endpoints/endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:46:34 -03:00
Cesar Garcia
91928d9d67
Update litellm/llms/openai/responses/count_tokens/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:46:10 -03:00
Chesars
0e1a633e30 fix: update mode to realtime for gemini-live models
The mode field is used by health checks to determine the correct
check method (WebSocket for realtime vs REST for chat).
2026-03-04 19:43:23 -03:00
Chesars
ddf9598f30 fix: use /v1/realtime for gemini/ provider live model
The gemini/ prefix indicates Google AI Studio, which uses /v1/realtime
endpoint (OpenAI-compatible), not /vertex_ai/live.
2026-03-04 19:43:23 -03:00
Chesars
20a41a67d6 fix: update gemini-live model supported_endpoints to /vertex_ai/live
The gemini-live-2.5-flash-preview-native-audio-09-2025 model only works
with WebSocket (Live API), not REST endpoints. Changed supported_endpoints
from /v1/chat/completions to /vertex_ai/live to reflect the actual
passthrough endpoint available in LiteLLM proxy.
2026-03-04 19:43:23 -03:00
Chesars
bca8730041 Merge remote-tracking branch 'upstream/main' 2026-03-04 19:43:06 -03:00
Harshit Jain
36e63bd1ee
Update litellm/proxy/management_endpoints/jwt_key_mapping_endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-05 04:12:54 +05:30
Chesars
28a20c180f fix: add ProxyException handling to count_tokens endpoint
Match the error handling pattern used in the Anthropic count_tokens
endpoint: catch ProxyException separately to surface its status code
and message, and include error details in the generic 500 fallback.
2026-03-04 19:39:48 -03:00
Chesars
872554df42 Fix: User specified async client ignored with Gemini streaming+async
The user-specified async client was being overwritten by
`litellm.module_level_aclient` in `streaming_handler.py` when using
async+streaming with Gemini.

This fix adds a `gemini_client` parameter to `make_call()` (matching
the existing pattern in `make_sync_call()`) so the user's custom client
is preserved and not overwritten.

Fixes #17148
2026-03-04 19:38:08 -03:00
Chesars
c185652577 fix: avoid chat-format fallback for empty input_items, remove duplicate instructions and elif 2026-03-04 19:32:05 -03:00
Cesar Garcia
cb54215966 Update litellm/proxy/response_api_endpoints/endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:32:05 -03:00
Cesar Garcia
39762983b1 Update litellm/proxy/response_api_endpoints/endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:32:05 -03:00
Cesar Garcia
018750e0cd Update litellm/llms/openai/responses/count_tokens/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:32:05 -03:00
Chesars
d33dec86ad fix: address Greptile review feedback
- Log provider token counting failures instead of silently swallowing
- Fall back to local tokenizer when provider returns error response
- Map assistant tool_calls to Responses API function_call items
- Concatenate multiple system messages instead of overwriting
- Hide internal error details from proxy API responses
- Narrow exception catch in handler to network/JSON errors only
- Update test to match new fallback behavior
2026-03-04 19:32:05 -03:00
Chesars
43d2a19f79 feat(openai): add OpenAI token counting API support and public litellm.acount_tokens()
- Add OpenAITokenCounter using POST /v1/responses/input_tokens endpoint
- Add litellm.acount_tokens() public async API that auto-routes to provider APIs
- Add proxy endpoint POST /v1/responses/input_tokens for OpenAI-compatible counting
- Transform chat tools format to Responses API format for correct token counting
- Fall back to local tiktoken when provider API unavailable

Fixes #22302
2026-03-04 19:32:05 -03:00
Harshit28j
63459d6777 docs: add JWT-to-Virtual-Key mapping documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:59:59 +05:30
Chesars
6fa9a0e52b fix(bfl): validate empty image list in edit handler
Raise explicit error instead of letting IndexError propagate when
an empty image list is passed to image_edit.
2026-03-04 19:23:37 -03:00
Cesar Garcia
835e4c4a75
Update litellm/llms/black_forest_labs/image_generation/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:20:19 -03:00
Cesar Garcia
d9f37011a2
Update litellm/llms/black_forest_labs/image_generation/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:20:03 -03:00
Cesar Garcia
92297df30c
Update docs/my-website/sidebars.js
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:19:30 -03:00
Harshit28j
2f15686ea2 fix: address greptile feedback - redact hashed tokens, proper error codes, add tests
- Remove token field from JWTKeyMappingResponse to prevent hashed key exposure
- Use _to_response() helper on all CRUD endpoints to control returned fields
- Return 409 for unique constraint violations, 400 for FK violations, 404 for not found
- Add response_model to endpoint decorators
- Add 8 new unit tests covering error handling and token redaction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:46:03 +05:30
Chesars
88dc0c1b18 feat(bfl): add kontext models to image generation support
Kontext models (flux-kontext-pro, flux-kontext-max) support both
text-to-image and image editing. Add them to IMAGE_GENERATION_MODELS
and update supported_endpoints in model prices JSON.
2026-03-04 19:12:28 -03:00
Chesars
7ee4a40fc4 fix(bfl): correct mode and variable shadowing from review feedback
- Change mode from "image_generation" to "image_edit" for all 4 BFL
  image edit models (flux-kontext-pro, flux-kontext-max, flux-pro-1.0-fill,
  flux-pro-1.0-expand)
- Rename shadowed api_base variable to complete_url in async handler
  for consistency with sync path
2026-03-04 19:07:36 -03:00
Cesar Garcia
6fa74af6c3
Update litellm/llms/black_forest_labs/image_edit/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:06:45 -03:00
Cesar Garcia
269911d6fe
Update litellm/llms/black_forest_labs/image_edit/handler.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 19:06:22 -03:00
Chesars
cf01ef5949 fix(tests): align BFL test assertions with implementation
- image_edit: get_supported_openai_params returns [] not [n, size, response_format]
- image_generation: remove response_format assertion (not in supported params)
- image_generation: unknown model raises ValueError, not defaults to flux-pro-1.1
2026-03-04 18:47:59 -03:00
giulio-leone
4d97818f98 fix(tools): gracefully repair truncated JSON in tool call arguments 2026-03-04 22:45:53 +01:00
giulio-leone
12691dcce3 fix: WebSearch interception fails with thinking enabled + SpendLimit constraint 2026-03-04 22:44:52 +01:00
giulio-leone
fb8bd60c7d fix(streaming): prevent Vertex AI Claude content truncation when finish_reason races content 2026-03-04 22:44:48 +01:00
Cesar Garcia
4059b4f942
Merge pull request #19280 from Chesars/docs/update-main-page-index
docs: sync main page with docs/index.md
2026-03-04 18:38:04 -03:00
Chesars
52d2ea237f fix(bfl): remove unsupported params and error on unknown models
- Remove response_format from supported params (BFL always returns URLs)
- Remove n and size from image edit supported params (not mapped)
- Raise ValueError on unknown model names instead of silently defaulting
2026-03-04 18:34:05 -03:00
Cesar Garcia
8eb7ca3726
Update litellm/llms/black_forest_labs/image_edit/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 18:26:47 -03:00
Chesars
00cf9550af fix(bfl): handle URL and file path inputs in image edit
_read_image_bytes was not handling string inputs (URLs or file paths),
causing a TypeError when passing a URL as the image source.
2026-03-04 18:16:21 -03:00
Cesar Garcia
d9d39d545a
Update litellm/llms/black_forest_labs/image_edit/transformation.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-04 18:11:50 -03:00
Chesars
727fd76841 refactor(bfl): separate HTTP logic into dedicated handlers
- Create handler.py for image generation and image edit
- Move polling logic from transformation to handlers
- Handlers use _get_httpx_client() / get_async_httpx_client()
- Transformation files now only transform request/response data
- Follows Bedrock pattern for provider-specific handlers

Addresses feedback: transformation files should not make HTTP requests
2026-03-04 18:10:09 -03:00
Chesars
a14a79619a docs: add Black Forest Labs image generation documentation 2026-03-04 18:09:52 -03:00
Chesars
e0af575ee8 feat(black_forest_labs): add image generation support
Add native text-to-image generation for Black Forest Labs Flux models
(flux-pro-1.1, flux-pro-1.1-ultra, flux-dev, flux-pro).

- Polling-based async API with sync and async support
- OpenAI-compatible parameter mapping (size, n, quality)
- Reuses shared HTTP clients via _get_httpx_client()
- 39 unit tests added
2026-03-04 18:09:34 -03:00
Chesars
d180db31e7 Use _get_httpx_client for HTTP polling in BFL image edit
Replace direct httpx.get() calls with _get_httpx_client() to reuse
cached HTTP client, following the pattern used by other providers
(RunwayML, Azure AI OCR, Sagemaker, etc.).
2026-03-04 18:09:12 -03:00
Chesars
77ca224a7f docs: add Black Forest Labs image edit documentation 2026-03-04 18:09:12 -03:00
Chesars
23bda9cc8e fix: remove unused Union import 2026-03-04 18:08:50 -03:00