Docs »

Metrics »

cerb.agent.model.tokens.input

Description

This counter tracks uncached prompt tokens sent to a model on each agent turn, broken down by model, agent, and the worker the turn ran for.

Use it to see which models an installation actually spends on, and where that spend comes from – per model, per agent, or per person.

Prompt tokens served from a provider's cache are counted separately in cerb.agent.model.tokens.cache_read, so this metric is the portion billed at the full input rate.

Dimensions

Dimension Description
model_id The agent model that ran the turn
agent_id The AI worker the turn ran as
worker_id The worker the turn ran for. This is 0 when the conversation belongs to a portal visitor rather than a worker

What is counted

Interactive and background turns are both recorded, as is the compaction pass that summarizes a long conversation, so the totals reconcile with a transcript's own token accounting.

A turn that failed contributes nothing here. The provider's usage report never arrives, so there are no tokens to count – but the turn is still counted in cerb.agent.model.turns with its status and latency. Token totals will therefore read slightly low on an installation with frequent provider errors.

llm.chat: and the model connection test are excluded. Neither has an agent session behind it, so every dimension would be zero.

A token kind a provider reports as zero is skipped rather than written, so a provider that never uses a prompt cache doesn't accumulate empty samples.

Related