feat(demo): token heat map · acceptance strip · watermark radar · speedup gauge#13
Merged
Merged
Conversation
…edup gauge - Feature 1: POST /api/token-heat backend — real_token_heat() uses MockModel logits + softmax to compute per-word confidence probability and rank - Feature 2: Speculative acceptance strip — animated dot grid showing per-token accept/reject/bonus outcomes after each race simulation - Feature 3: Watermark radar chart — animated pentagon canvas showing z-score, green fraction, bias δ, token count, and confidence axes - Feature 4: Speed-up arc gauge — animated half-circle canvas with gradient fill replacing the plain text derivation readout - Feature 5: Token heat map button in Generate tab — ☀ Heat button triggers /api/token-heat and renders colour-coded word spans by rank percentile https://claude.ai/code/session_018AUTq7p346dUTQ6xe5eNVK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/token-heatand re-renders the output with each word colored by MockModel softmax confidence — purple for high-confidence tokens, amber/coral for uncertain ones; hover tooltip shows exact probability and rankBackend change
demo/server.py: new/api/token-heatendpoint —real_token_heat(text, seed)splits on whitespace, runs MockModelnext_token_logits+ softmax for each word, returns{tokens: [{text, prob, rank}], n_tokens}— deterministic via stable character-code hash.Test plan
https://claude.ai/code/session_018AUTq7p346dUTQ6xe5eNVK
Generated by Claude Code