litellm/tests/test_litellm/proxy/management_endpoints
yucheng-berri 873215572a
fix(ptu): stop a PTU deployment billing for grounded search (#37043)
* fix(ptu): stop a PTU deployment billing for grounded search

A PTU deployment is billed by the flat cost of its reserved capacity, so the
model write endpoints refuse a rate the caller supplies and zero the ones already
stored. search_context_cost_per_query escaped both: it holds its rates in a table
keyed by context size, and the guard only recognised a number as a price, so a
grounded request on a PTU deployment kept billing per search on top of the flat
cost.

A table now counts as a price when it holds a non-zero rate. It is zeroed in
place rather than emptied the way tiered_pricing is, because an absent table
means the provider's own default rate rather than free, so dropping it would
start a charge instead of stopping one. For the same reason an all-zero table is
not read as a price: it is how an operator expresses free.

* fix(ptu): zero the search rate on every PTU deployment

A deployment that never stored its own search table is the normal case, and an
absent table means the provider's default rate, so the zeroing has to be written
unconditionally the way the per-token zeros already are. Writing it only where a
table was already stored left the default path billing per grounded search, which
is the charge this set out to stop.

The predicate that reads a table is split out rather than recursing, since the
repo's recursion gate rejects an unignored recursive function and one level is
all a rate table needs.
2026-08-15 12:15:46 -07:00
..
management_v1 test(proxy): guard management_v1 against fastapi names removed in supported releases 2026-08-08 21:15:56 -07:00
policy_endpoints style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
scim fix(scim): stop provisioning nested group ids as internal users (#34997) 2026-07-29 09:38:17 -07:00
search_endpoints test(proxy): type the search tool test helpers and record lookups with AsyncMock 2026-08-05 23:40:16 -07:00
usage_endpoints fix(proxy): reject user_id=None on non-admin analytics endpoints (cross-tenant disclosure) 2026-04-30 23:54:01 +02:00
test_access_group_endpoints.py update test cases to match new behaviour. The earlier test cases assumed the cache stores a pydantic object 2026-04-28 21:08:46 +00:00
test_access_group_management.py fix(proxy): report when a model write does not survive the post-write reload 2026-07-28 18:52:06 -07:00
test_activity_tenant_scoping.py fix(proxy): deny agent access when key and team grants resolve to nothing (#36221) 2026-08-07 20:44:11 +00:00
test_auto_router_endpoints.py feat(shadow_eval): add reverse-direction shadow eval jobs (#36865) 2026-08-14 17:05:55 -07:00
test_budget_endpoints.py fix(reset_budget_job): atomic budget cascade with chunked reset scans (#36287) 2026-08-10 14:42:36 -07:00
test_cache_settings_endpoints.py fix(ui): reflect REDIS_* env cache config and stop the UI overwriting the stored password (#34160) 2026-07-21 18:36:26 -07:00
test_callback_management_endpoints.py fix(galileo): use ingest traces API and standard logging payload (#29651) 2026-06-05 09:03:17 -07:00
test_common_daily_activity.py feat(ptu): gate PTU flat-cost attribution behind an opt-in env var (#36138) 2026-08-10 12:23:20 -07:00
test_common_utils.py fix(reset_budget_job): atomic budget cascade with chunked reset scans (#36287) 2026-08-10 14:42:36 -07:00
test_compliance_endpoints.py fix(proxy): match multi-mode guardrail_mode without false-COMPLIANT (#32832) 2026-07-10 16:41:28 -07:00
test_config_override_endpoints.py fix(audit): label vault POST as updated when DB row exists 2026-05-01 02:44:47 +00:00
test_coordination_redis_endpoints.py fix(proxy): give proxy_admin_viewer read parity with proxy_admin (#35851) 2026-08-05 18:33:55 +00:00
test_cost_tracking_settings.py fix(proxy): honor model_info custom pricing in /cost/estimate 2026-08-11 23:25:01 -07:00
test_credential_migration.py feat(proxy): add AES-256-GCM at-rest credential encryption with versioned format and re-encryption migration (#31215) 2026-06-29 20:14:22 +02:00
test_customer_budget.py feat(proxy): type Customer Management response_model for OpenAPI coverage (#31043) 2026-06-30 09:58:01 -07:00
test_customer_endpoints.py fix(reset_budget_job): atomic budget cascade with chunked reset scans (#36287) 2026-08-10 14:42:36 -07:00
test_delete_callbacks_endpoint.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_delete_verification_tokens_failed.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_encryption_endpoints.py feat(proxy): add AES-256-GCM at-rest credential encryption with versioned format and re-encryption migration (#31215) 2026-06-29 20:14:22 +02:00
test_entraid_app_roles.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_gateway_request_endpoints.py feat(sgr): make the gateway middleware the source of truth for successful requests (#35717) 2026-08-05 12:40:47 -07:00
test_internal_user_endpoints.py test: remove tests that never execute 2026-08-12 10:45:38 -07:00
test_key_management_endpoints.py fix(access groups): sync assigned_key_ids from the key write paths (#36843) 2026-08-14 02:47:02 +00:00
test_mcp_management_endpoints.py test(proxy): stop monkeypatch.undo re-planting fixture-mocked prisma_client 2026-08-13 20:11:06 -07:00
test_model_management_endpoints.py feat(complexity_router): calibrate the classifier rubric with worked examples, selectable per router (#36578) 2026-08-13 12:22:20 -07:00
test_org_admin_team_access.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_organization_endpoints.py feat(organization): add RESTful PATCH /v2/organization/{organization_id} (#32350) 2026-07-23 04:53:20 +00:00
test_policy_endpoints.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_project_org_authz.py fix(tests): use canonical litellm_enterprise import path (#27699) 2026-05-12 12:32:57 -07:00
test_ptu_model_settings.py fix(ptu): stop a PTU deployment billing for grounded search (#37043) 2026-08-15 12:15:46 -07:00
test_router_settings_endpoints.py feat: routing groups ui 2026-05-04 18:09:14 -07:00
test_saml_sso.py feat(proxy): add SAML 2.0 SSO for the admin UI (#31429) 2026-07-24 12:51:28 -07:00
test_tag_management_endpoints.py refactor(test): tighten typing on the tag list verification token double 2026-07-31 09:52:46 -07:00
test_team_callback_endpoints.py fix(team-callbacks): actually stop logging when disable_logging is called (#35520) 2026-08-03 11:02:51 -07:00
test_team_default_params.py feat(teams): apply default organization to new teams from default team settings (#35540) 2026-08-03 12:57:12 -07:00
test_team_endpoints.py fix(access groups): sync assigned_team_ids from the team write paths (#36825) 2026-08-14 04:45:36 +00:00
test_team_model_alias_merge.py chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00
test_tool_management_endpoints.py fix(tool-management): drop unsupported prisma select kwarg from team lookup (#35293) 2026-07-31 11:42:52 -07:00
test_ui_sso.py fix(access groups): sync assigned_team_ids from the team write paths (#36825) 2026-08-14 04:45:36 +00:00
test_workflow_management_endpoints.py fix(proxy): give proxy_admin_viewer read parity with proxy_admin (#35851) 2026-08-05 18:33:55 +00:00