mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* fix(health): probe test_connection without custom-pricing fields
/health/test_connection returns "Missing credentials. Please pass one of
api_key, azure_ad_token, ..." for a healthy configured model as soon as the
request also carries any custom-pricing field.
_request_inherits_config_credentials drops the configured connection when
the request sets one of _BANNED_CONNECTION_PARAMS. That list is
_BANNED_REQUEST_BODY_PARAMS minus the Vertex target fields, and it still
ends with every CustomPricingLiteLLMParams field. Those fields are banned
from a request body because they poison the shared model-cost registry, not
because they retarget or re-authenticate the outbound call. The Admin UI's
Add Model wizard sends them next to "Test Connection", so the button reports
a working deployment as broken.
- _BANNED_CONNECTION_PARAMS now also excludes the custom-pricing fields.
The request-body check is unchanged, so pricing fields stay banned there.
- The probe strips custom-pricing fields from its params, whether they came
from the request or from the configuration: completion registers request
pricing under the shared {provider}/{model} cost-map key (a probe has no
router deployment id), which would re-price every sibling deployment.
Measured against a configured azure deployment: {"model": ...} succeeds,
{"model": ..., "input_cost_per_token": 1e-9} failed and now succeeds, and
{"api_base": ..., "input_cost_per_token": 1e-9} still drops the configured
credentials.
* fix(health): keep only the connection-param gate change for test_connection pricing
The probe-pricing strip is a no-op on main, since completion no longer writes request pricing into the shared cost map. Drop it with its tests and the structure-only tests, and cover every pricing field through the gate instead
* fix(health): price a test_connection probe by the deployment, not the request
Prices sent with a test no longer reach the probe, so its spend row uses the model's configured price while the configured key still applies
---------
Co-authored-by: Mihidum Hettiyahandi <55163074+mihidumh@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_deployment_warning_endpoints.py | ||
| test_graceful_shutdown_endpoints.py | ||
| test_health_endpoints.py | ||