Post-Call Rules
Use this to fail a request based on the output of an llm api call.
Quick Start​
Step 1: Create a file (e.g. post_call_rules.py)​
def my_custom_rule(input): # receives the model response
if len(input) < 5:
return {
"decision": False,
"message": "This violates LiteLLM Proxy Rules. Response too short"
}
return {"decision": True} # message not required since, request will pass