You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
infer headless --format ag-ui (inference-gateway/cli PR #1254, fixing inference-gateway/cli#1253) now emits a per-step AG-UI CUSTOM event named token_usage after every LLM step. Its value carries the same cumulative session stats object as the terminal RUN_FINISHED result: inputTokens, outputTokens, cacheReadTokens, totalToolCalls, lastInputTokens, contextWindow, cost. The CLI's own contract page (docs/ag-ui-output.md in the cli repo) is updated in that PR; the org docs pages covering headless output and the AG-UI stream should mention the new event as well.
Acceptance Criteria
The AG-UI output documentation mentions the per-step token_usage custom event and its cadence (after each LLM step, before tool execution continues).
The documented value keys match the RUN_FINISHED result keys, including contextWindow being omitted when the model's window is unknown.
Any headless output / streaming examples showing usage stats are updated to reflect streaming cumulative usage.
What changed - cli.md only (the only page in this repo covering the ag-ui headless stream; cli-judge-mode.md and opentask.md show no usage stats, so they needed nothing):
The ag-ui--format bullet now mentions the token_usage custom event.
The "AG-UI RUN_FINISHED result" section documents the per-step event: emitted after every LLM step before tool execution continues, value keys identical to the RUN_FINISHEDresult (including contextWindow omitted when the model's window is unknown), suppressed until the session has made a model request, plus a full example event mirrored from cli PR 1254's contract.
The AG-UI consumer guidance now points at the streamed per-step stats (live indicators stay current during the run instead of jumping at RUN_FINISHED).
Skipped: no edits to the json-format session_stats example or the json assistanttoken_usage row - those describe the json stream and are unaffected by the ag-ui event; the existing json stream already documents per-turn usage. No docs ticket needed (this run is itself the docs change); no downstream impact beyond the linked cli PR.
Validated: bun run lint:md, bun run format:check, bun run build all pass; commit 6d53ea2 pushed to fix/issue-700, tree clean. Issue moved to QA on the Roadmap 2026 board.
Activity
edenreich commentedon Sep 20, 2026
@infer Can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Sep 20, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#701
✅ Infer Result: Success
Done. PR: #701 (ready for review)
What changed -
cli.mdonly (the only page in this repo covering the ag-ui headless stream;cli-judge-mode.mdandopentask.mdshow no usage stats, so they needed nothing):ag-ui--formatbullet now mentions thetoken_usagecustom event.RUN_FINISHEDresult" section documents the per-step event: emitted after every LLM step before tool execution continues,valuekeys identical to theRUN_FINISHEDresult(includingcontextWindowomitted when the model's window is unknown), suppressed until the session has made a model request, plus a full example event mirrored from cli PR 1254's contract.RUN_FINISHED).Skipped: no edits to the json-format
session_statsexample or the jsonassistanttoken_usagerow - those describe the json stream and are unaffected by the ag-ui event; the existing json stream already documents per-turn usage. No docs ticket needed (this run is itself the docs change); no downstream impact beyond the linked cli PR.Validated:
bun run lint:md,bun run format:check,bun run buildall pass; commit6d53ea2pushed tofix/issue-700, tree clean. Issue moved to QA on the Roadmap 2026 board.Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 2m 38sTokens: 832,866 in · 6,815 out · 839,681 total (23 requests)
Tool calls: 33 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
feat(render): stream per-step token usage in ag-ui headless output (#…
inference-gateway-releaser commentedon Sep 22, 2026
🎉 This issue has been resolved in version 0.9.14 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀