LiteLLM Integration
Lucidic integrates with LiteLLM via a custom callback bridge that maps LiteLLM events into Lucidic sessions/steps/events. This enables automatic tracking for any provider supported by LiteLLM.Setup
How it works
- Lucidic registers a LiteLLM CustomLogger (
LucidicLiteLLMCallback
) under the hood - Before-call: captures messages to form the event description
- After-call: extracts response text, usage/cost (when available), duration, and model/provider
- Images in multimodal messages are detected and attached as screenshots
- On failure: an error event is recorded with error metadata
Notes
- Ensure your provider-specific API keys are configured per LiteLLM’s docs
- The bridge waits briefly on shutdown for pending callbacks to finish
- Cost is estimated using Lucidic’s pricing tables when usage is provided