- 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>
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.
- 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>
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>
- 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>
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>
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
- 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>
- 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>
- 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>
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>
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>
- 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>
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>
- 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>
- 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>
- 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>
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>
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>
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>
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>
* 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>
Perplexity requires type='message' on input items. Add _ensure_message_type
to automatically set it when missing, matching the old _format_input behavior.