Commit Graph
7 Commits
Author SHA1 Message Date
yuneng-jiangandClaude Opus 4.6 fbad073a1f [Fix] Use cached async HTTP client in Vantage destination
Replace per-request `httpx.AsyncClient` with `get_async_httpx_client`
to avoid the +500ms latency penalty from creating new clients per
request. Updates tests to mock the cached client factory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 12:23:40 -07:00
yuneng-jiangandClaude Opus 4.6 6abdf5adde [Fix] Responses bridge variable mismatch and outdated CI tests
Fix genuine regression in responses_api_bridge_check where the second
call assigned to `model_info` instead of `responses_api_model_info`,
preventing gpt-5.4 + tools + reasoning_effort from routing to the
Responses API bridge.

Also update outdated tests:
- Vantage tests: match "csv" file key and use supported column names
- Anthropic caching test: add "type": "custom" to expected tool payload
- Claude Agent SDK test: remove non-deterministic LLM content assertion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 12:12:35 -07:00
Harshit28jandClaude Opus 4.6 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
Harshit28jandClaude Opus 4.6 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
Harshit28jandClaude Haiku 4.5 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
Yuta Saito 48bc5ccb4f fix: test 2026-01-09 11:23:47 +09:00
Yuta Saito 271ee0959b test: focus 2026-01-08 16:53:09 +09:00