You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/source/user_manual/router/cmd.rst
+44
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ Logging Options
44
44
+++++++++++++++
45
45
46
46
- ``--log-stats``: Log statistics every 30 seconds.
47
+
- ``--callbacks``: The path to the callback instance extending CustomCallbackHandler (e.g. ``my_callbacks.my_callback_handler_instance``).
47
48
48
49
49
50
Build docker image
@@ -78,3 +79,46 @@ You can install the router using the following command:
78
79
--engine-stats-interval 10 \
79
80
--log-stats \
80
81
--routing-logic roundrobin
82
+
83
+
84
+
Hooking into custom callbacks
85
+
-----------------------------
86
+
87
+
The router can be extended to add custom callbacks at various points in the request lifecycle.
88
+
89
+
For this you will need to create a custom callback handler instance, implementing at least one of the available callback methods. You can find all available callbacks along with detailed descriptions in the abstract `CustomCallbackHandler <https://github.com/vllm-project/production-stack/tree/main/src/vllm_router/services/callbacks_service/custom_callbacks.py>`_ class.
90
+
91
+
.. code-block:: python
92
+
93
+
# my_callbacks.py
94
+
95
+
from fastapi import Request, Response
96
+
97
+
from vllm_router.services.callbacks_service.custom_callbacks import CustomCallbackHandler
0 commit comments