Interface: LlmMetricsSummary
@kortexya/reasoninglayer / LlmMetricsSummary
Interface: LlmMetricsSummary
Section titled “Interface: LlmMetricsSummary”Defined in: src/types/metrics.ts:34
The calling tenant’s LLM cost and token usage.
Remarks
Section titled “Remarks”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.
Properties
Section titled “Properties”costByModel
Section titled “costByModel”costByModel:
Record<string,number>
Defined in: src/types/metrics.ts:41
Cost in USD per model name.
costByOperation
Section titled “costByOperation”costByOperation:
Record<string,number>
Defined in: src/types/metrics.ts:43
Cost in USD per operation name.
totalCostUsd
Section titled “totalCostUsd”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
Section titled “totalRequests”totalRequests:
number
Defined in: src/types/metrics.ts:47
Number of LLM requests.
totalTokens
Section titled “totalTokens”totalTokens:
LlmTokenSummary
Defined in: src/types/metrics.ts:45
Token counts by type.