litellm/tests/test_litellm/proxy
Ishaan Jaff adba088df2
Realtime API: spend log storage, playground UI, tools logging, and guardrail support (#22105)
Backend - Spend Log Storage for Realtime Calls:
- Collect user voice transcripts and text input during WebSocket sessions
- Store collected messages in spend logs when store_prompts_in_spend_logs enabled
- Capture tool definitions from session.update and tool calls from response.done
- Enrich proxy_server_request with tools and response with tool_calls for UI

Backend - WebSocket Auth:
- Support browser-based auth via Sec-WebSocket-Protocol subprotocol
- Echo back subprotocol on WebSocket accept

UI - Realtime Playground:
- New RealtimePlayground component with WebSocket voice+text chat
- Mic recording (PCM16 24kHz), server VAD, audio playback, text input
- Handle binary WebSocket frames (Blob/ArrayBuffer decoding)
- Add /v1/realtime endpoint option to playground endpoint selector

UI - Tools Section for Realtime Logs:
- Extract tool calls from realtime response format (response.tool_calls
  and response.results[].response.output[].type=function_call)

Tests:
- 15 new backend tests for realtime streaming and spend log storage
- 4 new UI tests for realtime tool call extraction

Fixes pre-existing build errors:
- ToolPolicies.tsx: duplicate import, antd styles type
- create_key_button.tsx: missing message import

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-25 14:55:27 -08:00
..
_experimental/mcp_server Agents - assign tools (#22064) 2026-02-25 11:44:30 -08:00
agent_endpoints
anthropic_endpoints
auth Revert "fix(vertex_ai): enable context-1m-2025-08-07 beta header (#21870)" (#21876) 2026-02-21 20:12:01 -08:00
client
common_utils Merge origin/main and address Greptile review feedback 2026-02-24 15:13:19 -08:00
db merge: resolve conflict with origin/main in test_db_spend_update_writer.py 2026-02-25 12:15:53 -08:00
discovery_endpoints
experimental/mcp_server
google_endpoints fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:42 +05:30
guardrails fix(guardrails): prevent presidio crash on non-json responses 2026-02-25 16:11:24 +05:30
health_endpoints fix: resolve flaky test failures in health, spend logs, and CLI tests (#21769) 2026-02-21 10:02:24 -08:00
hooks Agents - assign tools (#22064) 2026-02-25 11:44:30 -08:00
image_endpoints
management_endpoints feat(agents): assign virtual keys to agents (#22045) 2026-02-24 18:28:16 -08:00
management_helpers
middleware test: add backwards compatibility tests for PrometheusAuthMiddleware 2026-02-21 12:06:31 -08:00
openai_files_endpoint fix(tests): isolate flaky files endpoint tests from global proxy state (#21788) 2026-02-21 11:20:32 -08:00
pass_through_endpoints fix(tests): isolate auth in vertex passthrough and spend logs date range tests (#21824) 2026-02-21 14:14:50 -08:00
policy_engine Guardrail Policy Versioning (#21862) 2026-02-21 20:14:31 -08:00
prompts
public_endpoints
rag_endpoints tests and route permissions (#21508) 2026-02-18 16:58:38 -08:00
response_api_endpoints
spend_tracking Realtime API: spend log storage, playground UI, tools logging, and guardrail support (#22105) 2026-02-25 14:55:27 -08:00
test_configs
ui_crud_endpoints fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
vector_store_endpoints
__init__.py
conftest.py
test_aiohttp_cleanup_closed.py fix(aiohttp): only set enable_cleanup_closed when required (#21897) 2026-02-23 21:06:29 -08:00
test_api_key_masking_in_errors.py
test_batch_metadata_none_fix.py
test_caching_routes.py
test_chat_completion_metadata.py
test_common_request_processing.py fix(router): emit x-litellm-overhead-duration-ms header for streaming requests (#22027) 2026-02-24 11:56:16 -08:00
test_custom_proxy.py
test_empty_model_list.py
test_enforce_user_param.py
test_fallback_management_endpoints.py
test_fastapi_offline_routes.py
test_health_check_functions.py
test_litellm_pre_call_utils.py Guardrail Policy Versioning (#21862) 2026-02-21 20:14:31 -08:00
test_model_dump_with_preserved_fields.py fix: address PR review comments for model_dump_with_preserved_fields 2026-02-21 10:48:10 -08:00
test_model_id_header_propagation.py
test_proxy_cli.py fix(tests): fix flaky test_use_prisma_db_push_flag_behavior (#21849) 2026-02-21 15:23:55 -08:00
test_proxy_server.py Merge origin/main into litellm_fix_streaming_connection_pool_leak 2026-02-21 12:44:50 -08:00
test_proxy_types.py
test_proxy_utils.py
test_pyroscope.py
test_response_model_sanitization.py
test_route_a2a_models.py
test_route_llm_request.py
test_shared_health_check.py
test_spend_log_cleanup.py
test_swagger_chat_completions.py fix(tests): isolate flaky tests - restore global state in setup/teardown (#21791) 2026-02-21 11:30:35 -08:00
test_team_member_update.py