litellm/litellm/proxy/policy_engine
devin-ai-integration[bot] 311d9bba37
perf(policy_engine): dedup attachments in one pass after sorting (#40883)
get_attached_policies_with_reasons rescanned the sorted matches with next() once
per distinct policy, which is quadratic and misses the one second budget past a
few thousand global attachments. Build a policy to broadest attachment map in one
pass instead, keeping the specificity sort and result order.

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 14:19:20 -07:00
..
__init__.py chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
architecture.md [Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612) 2026-01-22 19:49:53 -08:00
attachment_registry.py perf(policy_engine): dedup attachments in one pass after sorting (#40883) 2026-09-12 14:19:20 -07:00
condition_evaluator.py perf: build log messages lazily so filtered-out log records cost nothing (#35703) 2026-08-04 04:34:52 +00:00
init_policies.py refactor(typing): replace Any with proven types in 65 backend files 2026-09-02 09:11:36 +00:00
pipeline_executor.py fix(guardrails): stop 500s on POST /responses when a guardrail rewrites input 2026-09-11 01:21:20 -07:00
policy_endpoints.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
policy_matcher.py fix(auth): support wildcard prefixes in jwt team_allowed_routes 2026-08-21 01:56:02 +00:00
policy_registry.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
policy_resolve_endpoints.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_round2 2026-08-25 16:17:29 -07:00
policy_resolver.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
policy_validator.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
response_retrieval.py fix(policy_engine): warn when a poll cannot re-match the submitted model name and keep default_on pre_call claims 2026-09-08 15:04:19 -07:00