Skip to content

Interface: LlmMetricsSummary

@kortexya/reasoninglayer


@kortexya/reasoninglayer / LlmMetricsSummary

Defined in: src/types/metrics.ts:34

The calling tenant’s LLM cost and token usage.

Every field is scoped to the tenant the client is configured with: no other tenant’s spend, model, operation or total appears in it, and a tenant that has made no LLM call reads all zeros. The engine keeps the ledger in process, so it resets when the engine restarts.

The keys of LlmMetricsSummary.costByModel and LlmMetricsSummary.costByOperation are model and operation names, as the engine reports them; they are data, not schema, and are not case-converted.

costByModel: Record<string, number>

Defined in: src/types/metrics.ts:41

Cost in USD per model name.


costByOperation: Record<string, number>

Defined in: src/types/metrics.ts:43

Cost in USD per operation name.


totalCostUsd: number

Defined in: src/types/metrics.ts:39

Total cost in USD, over models with a known price. A model with no pricing entry adds tokens and requests but no cost.


totalRequests: number

Defined in: src/types/metrics.ts:47

Number of LLM requests.


totalTokens: LlmTokenSummary

Defined in: src/types/metrics.ts:45

Token counts by type.