Skip to main content

Installation

Usage

How It Works

MeshAI registers a global after_llm_call hook with CrewAI. After every LLM interaction, the hook:
  1. Extracts the model name from the LLM context
  2. Extracts token counts from the response
  3. Infers the provider from the model name
  4. Sends the usage event to MeshAI (buffered, batched)
This means each agent in your crew is tracked with its own model, no hardcoding needed.

Multi-Model Crews

CrewAI crews often use different models per agent. MeshAI tracks each one separately: