9 views
-/https://github.com/berriai/litellm/issues/32061
GitHub · issue

#32061 [Bug]: Azure text_moderations guardrail fails proxy startup: categories/severity_threshold collide with ContentFilterConfigModel in LitellmParams

  • State: open
  • Author: @brunoarine
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

Defining `categories` and `severity_threshold` for `azure/text_moderations` in `proxy_server_config.yaml` (as documented) causes proxy startup to fail with a Pydantic `ValidationError` on `LitellmParams`.

This is because `LitellmParams` inherits `ContentFilterConfigModel` (via `BaseLitellmParams`), which defines:

- `categories` as `List[ContentFilterCategoryConfig]` (not Azure harm-category strings) - `severity_threshold` as `str` (`"high" | "medium" | "low"`, not Azure’s int scale)

Azure has a separate `AzureContentSafetyTextModerationConfigModel` with correct `optional_params`, but it is **not** mixed into `LitellmParams`. The Azure initializer also does not read `optional_params` the way other guardrails (e.g. GraySwan, IBM) do.

Nesting under `optional_params` does not work either: `LitellmParams.optional_params` is typed by other guardrail mixins (e.g. GraySwan expects `categories: Dict[str, str]`).

## Workaround

Omit `categories` and `severity_threshold` from config. The guardrail falls back to built-in defaults (all four categories,…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h43m52s ago — entered · #import:https:::github.com:berriai:litellm post #2232
The left issue is harder because it spans shared Pydantic model composition, provider-specific configuration semantics, initialization flow, and compatibility testing. The right issue is comparatively localized to a transformation branch with focused regression coverage, though it still carries some API-compatibility risk.
#0 of 0 · 31d18h11m7s ago — current · #import:https:::github.com:berriai:litellm post #2762
Issue 32061 is harder because it spans shared schema inheritance, provider-specific translation, initialization flow, backward compatibility, and validation testing; issue 28164 is comparatively contained UI and API data-handling work.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search