Skip to content

add --report flag for HTML report generation of pipeline internals - #181

Open
nwaughachukwuma wants to merge 12 commits into
mainfrom
add-report-flag-for-cat-command
Open

add --report flag for HTML report generation of pipeline internals#181
nwaughachukwuma wants to merge 12 commits into
mainfrom
add-report-flag-for-cat-command

Conversation

@nwaughachukwuma

@nwaughachukwuma nwaughachukwuma commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new --report flag to the mm cat command, which generates a self-contained HTML report of pipeline internals (such as encoder outputs, LLM messages, and responses) saved to mm_reports/. Feedback on these changes highlights a high-severity race condition in LlmBackend where self.last_messages is stored directly on the instance rather than in thread-local storage. Additionally, the reviewer suggests respecting the user-specified --output-dir option when writing HTML reports and using defensive dictionary access for llm_usage to prevent potential KeyError exceptions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/mm/llm.py
Comment thread python/mm/commands/cat.py Outdated
Comment thread python/mm/commands/cat.py Outdated
Comment thread python/mm/cat_utils/report.py Outdated
@nwaughachukwuma
nwaughachukwuma marked this pull request as ready for review July 15, 2026 07:50
@nwaughachukwuma
nwaughachukwuma requested a review from spillai July 15, 2026 07:50
nwaughachukwuma and others added 6 commits July 15, 2026 17:27
- use a local price catalog for token cost computation. 
- add logic for keeping the catalog updated using a cron jon
- wire token cost estimation into report (`--report` flag) generation
This branch adds a tokens-per-second (toks/s) `throughput` metric to mm
cat's _verbose_ and _footer_ output for LLM-backed pipelines.

`toks/s` is a CLI-level measure of end-to-end throughput — completion
tokens over the full generate wall-clock — rather than a true decode
number which is only knowable on the inference backend.
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Chukwuma Nwaugha <nwaughac@gmail.com>
@nwaughachukwuma

Copy link
Copy Markdown
Collaborator Author

@spillai, please let me know what else is needed to get this merged.

nwaughachukwuma pushed a commit that referenced this pull request Aug 3, 2026
CI installs the dev extras with an unpinned 'ruff>=0.4', which now
resolves to ruff 0.16.1 — its new/promoted rules flag 298 pre-existing
errors and fail the test-python job. Pin to 0.15.4 (same fix as #181)
so lint results are reproducible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cg3KtFq2ZWMck79bq6YvBV
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