Skip to content

Commit 559142a

Browse files
Add table explaining different callback hooks (#17035)
Co-authored-by: Cursor Agent <[email protected]>
1 parent 7c1dfd4 commit 559142a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/my-website/docs/proxy/call_hooks.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ import Image from '@theme/IdealImage';
1010
**Understanding Callback Hooks?** Check out our [Callback Management Guide](../observability/callback_management.md) to understand the differences between proxy-specific hooks like `async_pre_call_hook` and general logging hooks like `async_log_success_event`.
1111
:::
1212

13+
## Which Hook Should I Use?
14+
15+
| Hook | Use Case | When It Runs |
16+
|------|----------|--------------|
17+
| `async_pre_call_hook` | Modify incoming request before it's sent to model | Before the LLM API call is made |
18+
| `async_moderation_hook` | Run checks on input in parallel to LLM API call | In parallel with the LLM API call |
19+
| `async_post_call_success_hook` | Modify outgoing response (non-streaming) | After successful LLM API call, for non-streaming responses |
20+
| `async_post_call_streaming_hook` | Modify outgoing response (streaming) | After successful LLM API call, for streaming responses |
21+
1322
See a complete example with our [parallel request rate limiter](https://github.com/BerriAI/litellm/blob/main/litellm/proxy/hooks/parallel_request_limiter.py)
1423

1524
## Quick Start

0 commit comments

Comments
 (0)