Skip to content

[FEATURE]: Add Model-Agnostic Guardrails Documentation Using LiteLLM and Hooks #1088

@Arindam200

Description

@Arindam200

Problem Statement

  • Only Bedrock guardrails are documented
  • No examples for LiteLLM-based providers (OpenAI, Anthropic, Nebius, etc.)
  • Hooks are provider-specific
  • Missing reusable, cross-provider guardrails pattern

Proposed Solution

Add a new section “Model-Agnostic Guardrails” under the Guardrails documentation with:

  • Basic Implementation: Hook-based guardrails using BeforeInvocationEvent and AfterInvocationEvent
  • Multi-Provider Examples: Show the same guardrails working with OpenAI, Anthropic, and Nebius via LiteLLM
  • Advanced Patterns: Use a dedicated LiteLLM model for content safety evaluation
  • Best Practices: Performance and reliability guidance

Use Case

People who're using Open Source Models via LIteLLM can also use Guardrails.

Alternatives Solutions

No response

Additional Context

I've implemented one similar use case here: AWS Strands Litellm Guardrails

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions