litellm/tests
ishaan-berri a588f76789
Litellm ishaan april15 2 (#25828)
* [Test] Add Azure async chat completion timeout test. WIP

* Capture TTFT for /v1/messages streaming responses

The pass-through streaming path for /v1/messages (Anthropic, Bedrock,
Vertex AI, Azure AI, Minimax) logged completion_start_time only after
the entire stream finished. async_success_handler then fell back to
end_time, making TTFT equal to total duration or null in the UI and
Prometheus.

Record the timestamp of the first chunk in async_sse_wrapper and
propagate it to model_call_details before the logging handler runs,
so gen_ai.response.time_to_first_token reflects the real first-chunk
latency.

Fixes #25598

* [Refactor] Implement timeout resolution logic in completion function

add fetch ``request_timeout`` from litellm_settings

* remove stale test case

* remove extra print statement

* default request timeout value in constants to 600s to match timeout defaults handled in the proxy

* fix request timeout if using default value from constants.py

* update code structure, test cases

* only override if the global timeout sets timeout to 6000s

* update code structure, move hard coded values to const and make the reslve function readable by moving fallback logic to a seperate function

* modify default timeout values, replacing hard coded ones with default values defined

---------

Co-authored-by: harish876 <harishgokul01@gmail.com>
Co-authored-by: Joaquin Hui Gomez <joaquinhuigomez@users.noreply.github.com>
2026-04-15 18:42:23 -07:00
..
agent_tests refactor: make unit test 2026-03-28 21:44:46 -07:00
audio_tests test: cleanup test impacted by deployment name change 2026-03-30 18:07:50 -07:00
basic_proxy_startup_tests build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
batches_tests test fix us.anthropic.claude-haiku-4-5-20251001-v1:0 (#24931) 2026-04-01 11:01:03 -07:00
benchmarks Add CodSpeed performance benchmarks (#23676) 2026-03-14 18:44:36 -07:00
code_coverage_tests build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
documentation_tests [Fix] Scope documentation workflow to match CircleCI and add missing router settings 2026-03-28 11:23:53 -07:00
enterprise Litellm oss staging 04 02 2026 p1 (#25055) 2026-04-08 21:37:10 -07:00
guardrails_tests resolve merge conflicts: keep null-safety tests + add L3 regression tests from base 2026-04-15 12:34:39 -07:00
image_gen_tests fix: cleanup tests 2026-03-30 16:24:35 -07:00
litellm fix(gemini): assign correct indices in batch embedding response (#25656) 2026-04-14 23:37:49 +05:30
litellm_core_utils
litellm_utils_tests fix: tighten handling of environment references in request parameters 2026-04-11 21:41:41 -07:00
litellm-proxy-extras [Infra] Mirror litellm_table_patch source changes (no binaries) 2026-03-27 16:45:12 -07:00
llm_responses_api_testing test: remove bad e2e tests - e2e failing due to low rate limits on ci/cd 2026-03-30 19:18:10 -07:00
llm_translation Litellm ishaan april15 2 (#25828) 2026-04-15 18:42:23 -07:00
load_tests test: update to new vertex ai keys 2026-03-28 20:19:05 -07:00
local_testing Litellm ishaan april15 2 (#25828) 2026-04-15 18:42:23 -07:00
logging_callback_tests fix(logging): update test_get_additional_headers to reflect provider header passthrough 2026-04-15 12:23:33 -07:00
mcp_tests feat(mcp): add per-user OAuth token storage for interactive MCP flows 2026-04-09 23:58:35 -07:00
multi_instance_e2e_tests
ocr_tests test: update to new vertex ai keys 2026-03-28 20:19:05 -07:00
old_proxy_tests/tests fix: cleanup tests 2026-03-30 16:24:35 -07:00
openai_endpoints_tests E2E test to assert response headers from the openai files change 2026-04-10 18:45:00 +00:00
otel_tests fix(tests): increase MAX_CALLS and reduce sleep in flaky e2e budget test 2026-03-13 00:04:31 -07:00
pass_through_tests Litellm fix update bedrock models (#24947) 2026-04-01 19:22:54 -07:00
pass_through_unit_tests Litellm fix update bedrock models (#24947) 2026-04-01 19:22:54 -07:00
proxy_admin_ui_tests [Fix] Remove neon CLI dependency and pin all JS dependencies 2026-04-01 16:15:32 -07:00
proxy_e2e_anthropic_messages_tests test fix us.anthropic.claude-haiku-4-5-20251001-v1:0 (#24931) 2026-04-01 11:01:03 -07:00
proxy_security_tests
proxy_unit_tests fix(proxy): use model_group for model_max_budget spend tracking cache key (#25549) 2026-04-11 19:37:58 -07:00
router_unit_tests fix(router): address remaining Greptile review comments 2026-03-27 20:11:28 +05:30
scim_tests
search_tests
spend_tracking_tests [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
store_model_in_db_tests [Fix] CI: fix helm not found and MCP tests on Python 3.9 2026-04-10 21:32:22 -07:00
test_litellm Litellm ishaan april15 2 (#25828) 2026-04-15 18:42:23 -07:00
unified_google_tests test: update to new vertex ai keys 2026-03-28 20:19:05 -07:00
vector_store_tests test: update test apis 2026-03-28 18:57:27 -07:00
windows_tests
__init__.py
eval_swe_bench.py feat: add litellm.compress() — BM25-based prompt compression with retrieval tool (#25637) 2026-04-13 12:23:54 -07:00
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
README.MD
test_budget_management.py Fix budget reset test 2026-04-14 20:50:42 +05:30
test_callbacks_on_proxy.py
test_config.py
test_debug_warning.py
test_default_encoding_non_root.py fix: tiktoken cache nonroot offline (#23498) 2026-03-14 10:48:36 -07:00
test_end_users.py
test_entrypoint.py
test_fallbacks.py
test_gpt5_azure_temperature_support.py
test_health.py
test_keys.py
test_litellm_proxy_responses_config.py
test_logging.conf
test_models.py test: replace test_add_and_delete_models integration test with mock 2026-03-30 21:30:57 -07:00
test_new_vector_store_endpoints.py
test_openai_endpoints.py
test_organizations.py
test_otel_thread_leak.py
test_passthrough_endpoints.py
test_presidio_latency.py
test_proxy_server_non_root.py
test_ratelimit.py [Fix] test_ratelimit: skip over-limit cases that race with background RPM tracking 2026-04-11 13:08:59 -07:00
test_resource_cleanup.py
test_service_logger_otel.py
test_spend_logs.py
test_team_logging.py test: cleanup dead tests 2026-03-28 20:49:02 -07:00
test_team_members.py
test_team.py [Fix] Fail fast when team member spend not flushed in time 2026-03-13 12:40:17 -07:00
test_users.py Litellm fix update bedrock models (#24947) 2026-04-01 19:22:54 -07:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.