mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-24 22:09:56 +00:00
* fix(proxy): make litellm --test pick a served model and send the master key litellm --test raised ValueError on every run since the flag became a plain switch, defaulted to the retired gpt-3.5-turbo, and sent a hardcoded key. It now reads GET /v1/models with LITELLM_MASTER_KEY and picks the first chat model not past its deprecation date. litellm --health sends the same key, and the startup banner curl carries the Authorization header and a model placeholder * fix(proxy): pick only named chat models for litellm --test and drop its max_tokens GET /v1/models on a wildcard proxy lists every id the wildcard expands to, in a random order per worker, and many of them cannot answer a plain text chat (fine-tune bases, audio-only, access-gated, or ones that reject max_tokens). --test now asks for return_wildcard_routes and keeps only the model names listed before the first wildcard route, so it picks a model the config names, and a wildcard-only proxy is asked to pass --model. The test chat request no longer sends max_tokens=256, which OpenAI reasoning models that LiteLLM does not map yet reject with a 400. * fix(proxy): send the master key only to a local host and fail --health on an error status litellm --test and --health now send LITELLM_MASTER_KEY only when --host is local, name that rule when the proxy answers 401 or 403, and --health exits non-zero on an error status. The local-host check moves from the lens adapter to url_utils so both share it * fix(proxy): let litellm --health wait on slow model checks and pick past prefixed retired models --health now waits on the proxy's own per-model health check timeout instead of httpx's 5 second read default, so a model slower than 5 seconds no longer makes it exit with httpx.ReadTimeout The --test model pick checks a provider-prefixed name like openai/gpt-3.5-turbo against the cost map row for the name after the prefix too, and counts responses mode models as chat, since the proxy serves them on chat completions * fix(proxy): keep --test and --health off env proxies for a local host Requests to a local --host now skip HTTP_PROXY and ALL_PROXY, so the master key never reaches a forward proxy. IPv6 hosts such as :: get a bracketed URL, a 401 or 403 on the --test requests names LITELLM_MASTER_KEY like the model list does, and a provider-prefixed model is checked under its bare name only when the cost map has no entry for the full name * fix(proxy): bound --health at 10 minutes and keep the key off *.localhost names --health read with no timeout, so a proxy that accepted the connection and never answered hung the command forever. It now uses the OpenAI SDK's default timeout, 5 seconds to connect and 10 minutes to read, the same bound --test's client has, which outlasts a model check at the proxy's 60 second default --test and --health sent LITELLM_MASTER_KEY to any *.localhost name, which the system resolver may send off the machine. The CLI now sends it only to localhost and loopback or unspecified addresses through url_utils.is_loopback_host, and the lens adapter keeps is_local_host The startup banner now says to export LITELLM_MASTER_KEY in the new terminal tab it sends you to * fix(proxy): keep the banner curl's master key off env proxies The startup banner's sample curl sends LITELLM_MASTER_KEY to http://0.0.0.0, and curl routes that through http_proxy or ALL_PROXY when the shell sets one. It now passes --noproxy '*', the same way --test and --health skip env proxies for a local host * test(proxy): expect --noproxy in the gunicorn banner curl * fix(proxy): name LITELLM_MASTER_KEY when no HTTP header can carry it A key with a newline, a trailing space or a non-ASCII character crashed --health and --test with an httpx traceback. Both now stop before any request with an error naming the variable --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| host | ||
| __init__.py | ||
| _user_table.py | ||
| conftest.py | ||
| test_access_group_rules.py | ||
| test_admin_viewer_handler_access.py | ||
| test_app_auth.py | ||
| test_auth_checks.py | ||
| test_auth_checks_object_access_and_lookup.py | ||
| test_auth_exception_handler.py | ||
| test_auth_hot_path_network_requests.py | ||
| test_auth_object_prefetch.py | ||
| test_auth_utils.py | ||
| test_authorization.py | ||
| test_banned_params_extra_body.py | ||
| test_cli_auth.py | ||
| test_core.py | ||
| test_custom_auth_end_user_budget.py | ||
| test_customer_hierarchy_auth.py | ||
| test_customer_member_auto_create.py | ||
| test_customer_provisioning.py | ||
| test_customer_spend.py | ||
| test_default_end_user_budget_simple.py | ||
| test_denial.py | ||
| test_fallback_budget.py | ||
| test_fallback_model_access.py | ||
| test_fallback_rate_limit.py | ||
| test_fallback_rate_limit_rust.py | ||
| test_impersonation.py | ||
| test_info_routes.py | ||
| test_jwt.py | ||
| test_legacy_empty_models_check.py | ||
| test_litellm_license.py | ||
| test_login_utils.py | ||
| test_master_key_boot_check.py | ||
| test_mcp_ip_filtering.py | ||
| test_model_access_group_budgets.py | ||
| test_model_checks.py | ||
| test_model_checks_fallbacks.py | ||
| test_models_fallback_endpoint.py | ||
| test_multi_budget_windows.py | ||
| test_multipart_bypass_repro.py | ||
| test_network.py | ||
| test_oauth2_proxy_hook.py | ||
| test_object_permission_loading.py | ||
| test_onboarding.py | ||
| test_organization_budget_enforcement.py | ||
| test_password_hashing.py | ||
| test_password_policy.py | ||
| test_personal_key_team_model_access.py | ||
| test_proxy_routes.py | ||
| test_rds_iam_token.py | ||
| test_resolvers_exceptions.py | ||
| test_resolvers_grants.py | ||
| test_resolvers_models.py | ||
| test_resolvers_seam.py | ||
| test_resolvers_store.py | ||
| test_route_checks.py | ||
| test_router_override_fallback_auth.py | ||
| test_scalar_budget_windows.py | ||
| test_search_tool_deny_by_default.py | ||
| test_team_grants.py | ||
| test_team_member_budget.py | ||
| test_unmapped_model_budget_enforcement.py | ||
| test_user_api_key_auth.py | ||
| test_user_api_key_auth_deployment_profile.py | ||
| test_user_api_key_auth_request_flow.py | ||
| test_vector_store_access_groups.py | ||