Skip to content

fix(guardrails): import the decisions provider list from litellm.decisions.call on stable/1.104.x - #45936

Merged
yuneng-berri merged 1 commit into
stable/1.104.xfrom
litellm_guardrail_settings_import_1104
Oct 11, 2026
Merged

yuneng-berri merged 1 commit into
stable/1.104.xfrom
litellm_guardrail_settings_import_1104

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • GET /guardrails/ui/add_guardrail_settings raises ImportError on stable/1.104.x
  • The Add Provider Guardrail wizard in the Admin UI lists no providers

How it solves it:

  • Renames _supported_providers to supported_decisions_providers in litellm.decisions.call
  • Points get_guardrail_ui_settings and its test at litellm.decisions.call
  • Matches main and the rc/1.105.0 fix in fcbb022

#45900 added supported_decisions_providers to litellm.decisions.main and imported it from there in get_guardrail_ui_settings. #45906 then picked #45130, which rewrites litellm.decisions.main and moves the provider list into litellm.decisions.call as _supported_providers, so the import broke once both landed on the line

User Flow

Before: a proxy admin on stable/1.104.x can't add a provider guardrail because the wizard has no providers to pick from

  1. They open https://litellm-domain/ui/?page=guardrails and click Add Guardrail
  2. The wizard calls GET https://litellm-domain/guardrails/ui/add_guardrail_settings and gets a 500 back
  3. The provider dropdown is empty, so they can't finish creating the guardrail

After: the same wizard loads its provider list and the admin can create the guardrail

  1. They open https://litellm-domain/ui/?page=guardrails and click Add Guardrail
  2. GET https://litellm-domain/guardrails/ui/add_guardrail_settings returns 200 with the provider settings, decisions providers included
  3. The provider dropdown is populated and they can pick a provider and save the guardrail

Relevant issues

Follow-up to #45900 and #45906 on stable/1.104.x

Affected release

Regression on stable/1.104.x after #45906 landed on top of #45900. The litellm-e2e Playwright UI suite for 1.104.3 failed 3 guardrail wizard specs because of it

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

The run covers the guardrail endpoint tests (tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py), the decision model tests (tests/test_litellm/proxy/guardrails/guardrail_hooks/test_decision_model.py) and the decisions tests

Before (0939a83)

  1. Run those test files on the stable/1.104.x tip
  2. 4 failed and 264 passed. test_add_guardrail_settings_restricts_hide_secrets_to_pre_call, test_get_guardrail_ui_settings_returns_per_provider_supported_modes, test_ui_settings_map_matches_runtime_supported_event_hooks and test_add_guardrail_settings_returns_decisions_providers all fail on the ImportError from get_guardrail_ui_settings

After (8a834c0)

  1. Run the same test files on this branch
  2. 268 passed

Type

🐛 Bug Fix

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/adc951cfd2604adf8e8455669b712c35
Open in Devin Desktop: https://app.devin.ai/desktop/session/adc951cfd2604adf8e8455669b712c35?variant=devin

…sions.call on stable/1.104.x

The decision model guardrail backport (#45900) added supported_decisions_providers to
litellm.decisions.main and imported it from there in get_guardrail_ui_settings. The
decisions backport (#45906) then picked #45130, which rewrites litellm.decisions.main
and moves the provider list into litellm.decisions.call as _supported_providers, so the
import broke and GET /guardrails/ui/add_guardrail_settings raises ImportError. The Admin
UI's Add Provider Guardrail wizard gets no providers as a result

Match main by naming it supported_decisions_providers in litellm.decisions.call and
pointing the endpoint and its test there, the same fix rc/1.105.0 got in fcbb022
@devin-ai-integration
devin-ai-integration Bot requested a review from a team October 11, 2026 08:18
@devin-ai-integration

devin-ai-integration Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@yuneng-berri
yuneng-berri merged commit 3645fe0 into stable/1.104.x Oct 11, 2026
8 of 9 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_guardrail_settings_import_1104 branch October 11, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant