Skip to content

Heatmap reports (HTML, Markdown, terminal), README visuals and a project site - #9

Merged
Mattbusel merged 1 commit into
mainfrom
shine
Sep 25, 2026
Merged

Mattbusel merged 1 commit into
mainfrom
shine

Conversation

@Mattbusel

Copy link
Copy Markdown
Owner

Makes the detector's output something you want to look at, and gives the repo a front page built from real runs.

Before / after: terminal (same command, same sample)

llm-token-visualizer --logprobs-file examples/logprobs/cuyp.json --threshold 0.6

Before (v0.2.0) After

Before / after: README top

Before After

What changed

  • --format html in detect mode: a self-contained page (no scripts, no external assets, light and dark) with the answer as a confidence heatmap, a per-token probability strip, and bars for the alternatives at each flagged span. Hover or focus any word for its probability and alternatives.
  • --format markdown in detect mode: numbered spans plus a table of alternatives, for PRs, issues and $GITHUB_STEP_SUMMARY.
  • Terminal: heatmap answer, aligned alternative bars, confident tokens keep the terminal's own color (works on light themes), NO_COLOR honored. --help gains examples; emoji removed from the visualizer headers.
  • New report module with 7 tests; CI now smoke-tests the HTML and Markdown output too. JSON output and all existing public APIs are unchanged.
  • README: hero (light/dark), real terminal capture, table of what the detector flags on the four bundled samples (from cargo run --example detect), the confidently-wrong moonwalk example as an image, formats; long reference moved into <details>.
  • docs/: GitHub Pages site. The sample viewer has a threshold slider that runs a JS port of detect.rs; I checked it against the CLI's JSON output for all 4 samples at 5 thresholds (20/20 identical).
  • .github/social-preview.png (1280x640) to upload in Settings.

Every image comes from running the CLI on the bundled Llama 3.1 8B responses today.

…site

- detect mode: --format html writes a self-contained report (heatmap, per-token
  strip, alternative bars; no scripts), --format markdown a PR-ready summary,
  and the terminal output is a heatmap with aligned alternative bars
- new report module with tests; CI smoke-tests html and markdown output
- --help examples; emoji removed from visualizer headers
- README: hero, real terminal capture, sample table, the confidently-wrong
  example, formats; long reference in <details>
- docs/: GitHub Pages site with the bundled samples, a threshold slider that
  runs the same detection rules in the browser, and the honest failure case
- .github/social-preview.png
@Mattbusel
Mattbusel merged commit a04c89d into main Sep 25, 2026
1 check passed
@Mattbusel
Mattbusel deleted the shine branch September 25, 2026 21:01
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