Files
litellm/litellm/llms/pass_through
f43757f71b Feature/guardrail model argument (#19619)
* [Feat] Add model parameter to Generic Guardrail API

Add model information to guardrail requests, allowing guardrails to make
model-specific security decisions.

Changes:
- Add `model` field to GenericGuardrailAPIInputs TypedDict
- Add `model` field to GenericGuardrailAPIRequest Pydantic model
- Update OpenAI and Anthropic handlers to pass model from request/response
- Add unit tests for model parameter handling

* [Feat] Add model parameter to all guardrail_translation handlers

Extend model parameter support to all guardrail handlers for consistent
implementation across all endpoint types:
- OpenAI Responses API (input/output + streaming)
- OpenAI Image Generation (input only)
- OpenAI Text Completion (input/output)
- OpenAI Text-to-Speech (input only)
- OpenAI Audio Transcription (output only)
- Cohere Rerank (input only)
- Pass-through Endpoints (input/output)
- MCP Server (input only)

This addresses the review feedback requesting consistent model parameter
handling across all guardrail_translation/handler.py files.

---------

Co-authored-by: Igal Boxerman <igal@pillar.security>
2026-01-23 20:48:42 -08:00
..