Commit graph

36177 commits

Author SHA1 Message Date
Harshit28j
24d4e5bc60 Deregister VantageLogger on delete and add Decimal cast test
- DELETE /vantage/delete now removes the in-memory VantageLogger from
  litellm.callbacks via remove_callbacks_by_type, preventing the
  scheduler from continuing to fire exports with stale credentials
- Add test_should_cast_decimal_columns_to_float covering the
  Decimal→Float64 cast in FocusCsvSerializer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:28:27 +05:30
michelligabriele
db4cd87979
docs(web_fetch): add newer Claude models to supported models list (#23251)
Add Claude Opus 4.6, Sonnet 4.6, Opus 4.5, Sonnet 4.5, and Haiku 4.5
to the web fetch supported models documentation. These models were
missing from the list despite supporting the web_fetch tool.
2026-03-11 19:09:28 +05:30
Cesar Garcia
5c8e87a9a1
Merge pull request #17155 from Chesars/fix/xai-streaming-empty-chunk-bug
Fix (xai): streaming empty chunk bug for providers using BaseLLMHTTPHandler
2026-03-11 10:36:58 -03:00
Sameer Kankute
ff2fe96717
Merge pull request #23276 from BerriAI/litellm_oss_staging_03_10_2026
Litellm oss staging 03 10 2026
2026-03-11 18:54:38 +05:30
Sameer Kankute
f243e5615f
Merge branch 'main' into litellm_oss_staging_03_10_2026 2026-03-11 18:50:03 +05:30
Sameer Kankute
2343149f2d
Merge pull request #23163 from BerriAI/litellm_oss_staging_03_04_2026
Litellm oss staging 03 04 2026
2026-03-11 18:46:51 +05:30
Sameer Kankute
43217c8a4b
Merge branch 'main' into litellm_oss_staging_03_10_2026 2026-03-11 18:32:17 +05:30
Sameer Kankute
3dab62023c Merge branch 'main' into litellm_oss_staging_03_04_2026 2026-03-11 18:31:20 +05:30
Harshit28j
ce052d07be Fix test helper hour=23 bug and add row-count batching test
- Use timedelta(hours=1) instead of replace(hour=hour+1) in _window()
  to avoid ValueError when hour=23
- Add test_should_batch_by_row_count covering the >10K rows batching
  path (previously only the 2 MB size-limit path was tested)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:12:27 +05:30
Harshit28j
358c2fd033 Add empty-string credential validator to VantageSettingsUpdate
Matches the existing validator on VantageInitRequest so that empty or
whitespace-only api_key/integration_token values are rejected at update
time rather than silently persisted and failing at the next export.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:41:23 +05:30
Harshit28j
212cd0e4aa Fix pod lock collision, empty credential validation, and interval parsing
- Override initialize_focus_export_job in VantageLogger to use
  VANTAGE_USAGE_DATA_JOB_NAME as the Redis pod lock key, preventing
  silent export skips when both Focus and Vantage loggers are configured
- Add field_validator to VantageInitRequest rejecting empty-string
  api_key and integration_token at init time instead of at export time
- Guard FocusLogger FOCUS_INTERVAL_SECONDS with try/except matching
  the pattern already used in VantageLogger

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:28:19 +05:30
Harshit28j
4a9d03f1b1 Fix FocusLogger dedup to use exact type match in litellm_logging.py
Use `type(cb) is FocusLogger` instead of `isinstance(cb, FocusLogger)`
in both _init_custom_logger_compatible_class and
get_custom_logger_compatible_class so that a VantageLogger already in
_in_memory_loggers is not incorrectly returned for a "focus" lookup.
This ensures users with both "vantage" and "focus" in success_callbacks
get separate loggers for each export destination.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:01:16 +05:30
Sameer Kankute
c2fca1124b fix(proxy): preserve multipart/form-data boundary in passthrough endpoints
Fixes issue where multipart file uploads through passthrough endpoints failed with RequestValidationError. The proxy was consuming the request body stream and FastAPI was trying to parse multipart bodies as JSON dicts.

Changes:
- Try JSON parsing first for multipart content-type (handles misconfigured clients)
- Skip multipart parsing if JSON succeeds to avoid stream consumption
- Remove custom_body parameter from endpoint_func to prevent FastAPI auto-parsing
- Check for parsed body before using multipart handler
- Add regression test for multipart boundary preservation

Handles both actual multipart uploads and JSON bodies with incorrect multipart content-type headers.

Made-with: Cursor
2026-03-11 16:52:02 +05:30
Harshit28j
3cc2ccec4a Fix double-scheduling bug and Decimal CSV serialization
- Guard FocusLogger.init_focus_export_background_job with exact type
  check (type(cb) is FocusLogger) to exclude VantageLogger subclass,
  preventing duplicate hourly exports when VantageLogger is registered
  programmatically before startup
- Cast pl.Decimal columns to Float64 in FocusCsvSerializer so CSV
  output uses standard floating-point notation instead of fixed-point
  strings that Vantage's parser may reject

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:42:35 +05:30
Harshit28j
9200b28078 Fix dry-run summary alignment, token logging, and upload error handling
- Align dry-run summary to use pre-transform columns (spend, total_tokens,
  team_id, model) matching FocusExportEngine internals
- Reduce token exposure in debug logs to first 4 chars
- Wrap raise_for_status in try/except to log httpx errors before re-raising

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:31:30 +05:30
Harshit28j
d35abfb55f Fix data truncation, sub-batch resilience, and env var safety
- Split VantageExportRequest (limit=None) and VantageDryRunRequest
  (limit=500) so actual exports don't silently truncate large datasets
- Add try/except around each sub-batch upload in _upload_size_limited,
  consistent with _upload_batched's continue-on-failure guarantee
- Guard VANTAGE_EXPORT_INTERVAL_SECONDS against non-numeric values
  with try/except instead of bare int() cast

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:06:59 +05:30
Harshit28j
25c8658761 Fix oversized-row handling, batch error resilience, and callback registration
Vantage destination:
- Skip individual CSV rows exceeding 2MB limit with a warning instead of
  uploading an oversized batch that Vantage would reject
- Wrap each batch upload in try/except so remaining batches continue on
  failure; re-raise the first error after all batches are attempted

Callback registration:
- Use litellm.logging_callback_manager.add_litellm_callback() instead of
  raw litellm.callbacks.append() for DB-bootstrapped VantageLogger, ensuring
  proper dedup and manager visibility
- Add "vantage" init handler in litellm_logging.py (both creation and
  lookup branches) so config.yaml string callbacks are properly resolved

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:34:24 +05:30
Harshit28j
9e623ceaff Remove redundant empty-frame guard in FocusCsvSerializer
Polars write_csv already handles empty DataFrames correctly (outputs
header-only CSV), so the conditional branch was a no-op.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:16:49 +05:30
Harshit28j
230c85313b Fix dry-run HTTPException guard and VantageLogger instance detection
- Add missing except HTTPException: raise in vantage_dry_run_export
  (consistent with all other endpoints in the file)
- Fix is_vantage_setup_in_config() to detect both the string "vantage"
  and VantageLogger instances in litellm.callbacks, preventing duplicate
  logger registration on startup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:10:53 +05:30
Harshit28j
622d5dabba Fix HTTPException swallowed as 500 in /vantage/export endpoint
Add missing `except HTTPException: raise` guard so intentional 404
responses (e.g. when settings are not configured) are not caught by the
generic Exception handler and re-raised as 500 errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:59:52 +05:30
Harshit28j
9cc6df6b8d Fix Greptile round 4: preserve backward compat, add guards, fix defaults
- Revert FocusExportEngine.dry_run_export_usage_data to use original raw
  column names (spend, total_tokens, team_id, model) preserving backward
  compatibility for existing callers
- Vantage dry-run endpoint computes its own summary from FOCUS columns
  independently, avoiding coupling to the engine method
- Set VantageExportRequest.limit default to 500 (was None) matching docstring
- Add empty-settings guard in /vantage/export returning 404 instead of
  deferring ValueError to runtime
- Fix misleading docstring in _build_tags_expr about Rust-level execution
- Clarify Tags schema comment: parquet is self-describing so existing
  exports are unaffected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:51:03 +05:30
Harshit28j
4583c90194 Address remaining Greptile feedback: mask token, reuse HTTP client, align columns
- Mask integration_token in GET /vantage/settings response (renamed field to integration_token_masked)
- Reuse single httpx.AsyncClient across all batch uploads in deliver()
- Align FocusExportEngine.dry_run_export_usage_data to use post-transform FOCUS columns (BilledCost, SubAccountId, ResourceType) matching the Vantage dry-run endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:38:19 +05:30
Harshit28j
e07297fa87 Address Greptile round 3 feedback for improved security and consistency
- Encrypt integration_token alongside api_key in Vantage settings storage
- Align dry-run summary with FocusExportEngine helper methods
- Vectorize Tags JSON building using pl.struct + map_elements
- Reuse registered VantageLogger in /export endpoint instead of creating fresh instances

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:27:24 +05:30
Harshit28j
e1c44fe088 Fix Greptile round 2 review issues
- DB-only Vantage config now registers VantageLogger at startup so
  background job actually schedules (was silently skipping)
- Add missing `except HTTPException: raise` in /vantage/init endpoint
- Use consistent batch filenames (always .partN suffix)
- Document Tags schema change from pl.Object to pl.String

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:17:03 +05:30
dependabot[bot]
a78bd9a468
build(deps): bump hono from 4.10.6 to 4.12.7 in /litellm-js/spend-logs (#23312)
* Rename 'Team-Based Guardrails' to 'Team Bring-Your-Own Guardrails' (#23307)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* build(deps): bump hono from 4.10.6 to 4.12.7 in /litellm-js/spend-logs

Bumps [hono](https://github.com/honojs/hono) from 4.10.6 to 4.12.7.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.10.6...v4.12.7)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.12.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-11 14:13:33 +05:30
Harshit28j
f683befeed Fix Greptile review issues in Vantage integration
- Enforce 10K row limit in single-shot upload path (not just 2MB size)
- Fix KeyError crash in update_vantage_settings when no settings exist
- Remove unreachable status_code==400 dead code branch
- Make dry-run endpoint work without Vantage credentials by using
  FOCUS database + transformer directly instead of VantageLogger

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:02:05 +05:30
Harshit28j
69a94a873c Add Vantage integration for FOCUS CSV export
Adds a pluggable Vantage destination to the existing FOCUS export pipeline,
enabling LiteLLM to export spend data in FOCUS format directly to Vantage's
cost-import API. Supports automatic hourly exports via scheduled background job,
with admin API endpoints for manual control and configuration. Includes CSV
serializer, batching for 10K row / 2MB API limits, and enriched Tags JSON with
team/user/key metadata for Vantage Token Allocation feature.

- Add CSV serializer (FocusCsvSerializer) for FOCUS data
- Add Vantage API destination with automatic batching
- Add VantageLogger that wraps FocusLogger with Vantage defaults
- Add proxy endpoints: /vantage/{init,settings,export,dry-run,delete}
- Register "vantage" callback in logger registry and literal type
- Wire up background job in proxy_server.py startup
- Populate Tags column with JSON metadata (team_id, user_id, user_email, etc.)
- Add 14 unit tests covering serializer, destination, and factory

All tests pass (23 focus tests total, no regressions).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-11 13:51:36 +05:30
yuneng-jiang
628510d1b5
Merge pull request #23298 from BerriAI/litellm_/silly-pasteur
[Test] UI - Logs: Add unit tests for view_logs components
2026-03-11 00:57:26 -07:00
yuneng-jiang
09e2676e85
Merge pull request #23328 from BerriAI/litellm_mcp_recheck_health
[Feature] UI - MCP Servers: Per-server health recheck
2026-03-11 00:56:44 -07:00
yuneng-jiang
fdf925a3a3 [Feature] UI - MCP Servers: Add per-server health recheck
Allow users to recheck health for individual MCP servers by clicking
the health status badge. On hover the badge text changes to "Recheck"
with a refresh icon, and the check runs only for that server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:54:25 -07:00
Sameer Kankute
a6fb16aea0
Merge pull request #23103 from netbrah/fix/anthropic-tool-schema-type-enforcement
fix(anthropic): enforce type:"object" on tool input schemas in _map_tool_helper
2026-03-11 13:06:59 +05:30
Sameer Kankute
b9a311743f
Merge pull request #23104 from netbrah/fix/anthropic-deduplicate-tool-results
fix(anthropic): deduplicate tool_result messages by tool_call_id
2026-03-11 13:04:59 +05:30
yuneng-jiang
4f36d29d0c
Merge pull request #23326 from BerriAI/litellm_mcp_permissions_yj
[Fix] MCP Key Scope Type Fix
2026-03-11 00:27:18 -07:00
yuneng-jiang
ff2f96d09e Fix mcp_tool_permissions JSON string deserialization in _resolve_team_allowed_mcp_servers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:23:40 -07:00
yuneng-jiang
b48682f61a
Merge pull request #23323 from BerriAI/litellm_mcp_permissions_yj
[Feature] MCP Server Team-Scoped Filtering for Key Creation
2026-03-11 00:20:19 -07:00
yuneng-jiang
860cb17571 Fix cross-team MCP server info disclosure and restricted key bypass
The GET /v1/mcp/server endpoint allowed any authenticated user to pass
an arbitrary team_id and enumerate another team's MCP server config.
Restricted virtual keys could also use the team_id param to bypass
their access limitations. Add team membership check for non-admins
and block restricted keys from using the team_id filter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:48:30 -07:00
Sameer Kankute
e394914d34 Fix code qa 2026-03-11 11:49:02 +05:30
yuneng-jiang
c362ae5095 Add team-scoped MCP server filtering for key creation and fix UnboundLocalError
When creating a key, the MCP server list now filters by the selected team's
allowed servers. Also fixes UnboundLocalError on `is_restricted_virtual_key`
when `team_id` query param was provided to GET /v1/mcp/server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:15:14 -07:00
Sameer Kankute
2a9bcf2530 Fix greptile reviews 2026-03-11 11:41:29 +05:30
Sameer Kankute
1c144fc896 Add embedding model documentation 2026-03-11 11:02:49 +05:30
Sameer Kankute
8c5478df70 Add embedding model in model map 2026-03-11 10:58:50 +05:30
Sameer Kankute
d25b8e6d00 Add support for gcs url for vertex ai embeddings 2026-03-11 10:58:04 +05:30
Sameer Kankute
2c4a495619 Add support for vertex ai gemini multimodal embedings 2026-03-11 10:39:34 +05:30
Sameer Kankute
b108c02fd7 Add support for gemini multimodal embedings 2026-03-11 10:08:17 +05:30
Krrish Dholakia
57a48e3526 fix(agents.tsx): support granting agents access to subagents 2026-03-10 21:03:20 -07:00
Joe Reyna
40210ce750
fix(codeql): remove ruby from language matrix (#23227) 2026-03-10 20:45:23 -07:00
Ishaan Jaff
65842eb7b5
[Feat] UI - Show logos on MCP Apps page (#23320)
* feat(ui): add MCP server logo support across admin and chat UIs

- New MCPLogoSelector component with grid of well-known logos (GitHub,
  Slack, Notion, Linear, Jira, etc.) and custom URL input
- Create MCP Server form: logo picker with preview, OpenAPI presets
  auto-fill logo from registry icon_url
- Edit MCP Server form: logo picker pre-populated from mcp_info.logo_url
- Admin table: logos rendered next to server name in Name column
- Chat MCPAppsPanel: logos on server cards (list + detail view) with
  graceful fallback to letter avatars
- Chat MCPConnectPicker: logos next to server names in toggle list
- Fix pre-existing bug: setTools -> clearTools in create form cancel
- All 321 vitest files / 3211 tests pass

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* feat(ui): use local SVG logos for MCP services, fix Chat UI rendering

- Add 15 new MCP service logo SVGs (Slack, Notion, Linear, Jira, Figma,
  Gmail, Stripe, Salesforce, Shopify, HubSpot, Twilio, Sentry, Zapier,
  GitLab, Google Drive) to both source and pre-built directories
- Switch MCPLogoSelector from CDN URLs (cdn.simpleicons.org) to local
  asset paths (/ui/assets/logos/) for reliable rendering
- Logos now served by the proxy itself, working from any page path
  including /ui/chat/ (absolute paths resolve correctly everywhere)

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-03-10 20:27:13 -07:00
Cesar Garcia
260c37d670
Merge pull request #21398 from Chesars/feat/openai-like-responses-api
feat(openai_like): add Responses API support to JSON providers
2026-03-11 00:15:06 -03:00
Chesars
da76e1738a fix(perplexity): restore type='message' safety net for list inputs
Perplexity requires type='message' on input items. Add _ensure_message_type
to automatically set it when missing, matching the old _format_input behavior.
2026-03-11 00:14:13 -03:00
Cesar Garcia
5e32ace260
Update litellm/types/llms/openai.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-11 00:11:01 -03:00