Skip to main content
The LiteLLM integration automatically captures steps from your LiteLLM calls and associates them with your TCC runs.

Prerequisites

  • A TCC API key set as TCC_API_KEY environment variable
  • The contextcompany package installed

Setup

Step 1: Install dependencies

Step 2: Initialize the callback

Import and register the TCCCallback with LiteLLM:

Step 3: Create a run with LiteLLM steps

Create a run and use LiteLLM inside your agent loop. You must pass the run ID in the metadata parameter to associate the step with your run:
main.py
That’s it! Your agent run and LiteLLM steps will now be tracked and viewable in the dashboard.

Custom metadata

You can pass additional metadata alongside the required tcc.runId:

What gets captured

The LiteLLM integration automatically captures:
  • Model: Both the requested and used model
  • Messages: Input and output messages
  • Token usage: Prompt and completion tokens
  • Finish reason: Why the LLM stopped generating
  • Tool calls: Any tool calls made by the model
This data is associated with your run and visible in the TCC dashboard.