Skip to content

Model calls report their duration, tokens and outcome per base - #1543

Closed
gedaiu wants to merge 3 commits into
deeplethe:devfrom
re-cinq:feat/otel-model-calls
Closed

gedaiu wants to merge 3 commits into
deeplethe:devfrom
re-cinq:feat/otel-model-calls

Conversation

@gedaiu

@gedaiu gedaiu commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Hi! This builds on #1541 (and #1540), so its diff shows those commits too until they land. Only the last commit is new.

It adds two model call metrics, labelled by model, task, knowledge base and outcome:

  • utopia.llm.call.duration, how long each call took, in seconds
  • utopia.llm.tokens, prompt and completion tokens, with a kind label

The outcome is ok or the existing error class (rate_limited, out_of_credit, unavailable, context_too_long, rejected, unreachable, transient, other), so a run of 429s or an empty balance shows up per base.

utopia-llm stays free of OpenTelemetry. LlmClient gets an optional observer that hears about every chat_at call, and the server attaches one that knows the base. For now only adjudication is wired. Streaming, tool calls, embeddings and the other call sites follow in the next PR, to keep this one small. The settings connection check is left out on purpose, since it belongs to no base.

Thanks for taking a look!

…when OTEL_EXPORTER_OTLP_ENDPOINT is set (deeplethe#1539)

Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
…ane and status (deeplethe#1539)

Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
…ing with adjudication (deeplethe#1539)

Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
@gedaiu

gedaiu commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #1556, in the shape suggested on #1539. Thank you!

@gedaiu gedaiu closed this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant