Skip to content

Custom callbacks

Takashi Iwamoto edited this page Mar 4, 2025 · 2 revisions

Usage

  1. Create a custom callback module.
  2. Set your module name in the environment variable LITELLM_CALLBACK_MODULE_NAME.
  3. Run Collmbo.
  4. Send a message in Slack.

Try this Feature

You can try it with examples/callback_handler.py. This sample logs requests to the model.

$ cat env
SLACK_APP_TOKEN=xapp-1-...
SLACK_BOT_TOKEN=xoxb-...
OPENAI_API_KEY=sk-...
LITELLM_MODEL=gpt-4o
LITELLM_CALLBACK_MODULE_NAME=examples.callback_handler

$ docker run -it --env-file ./env ghcr.io/iwamot/collmbo:latest-slim