A real-time LLM stream mutator and token-visualization engine built in Rust.
“Every token tells a story. Every other token tells a different one.”
Every Other Token intercepts OpenAI’s streaming API token-by-token and mutates every other one in real time. Instead of treating prompts like static text, it invites you to see, touch, and reshape the token stream as it flows.
Built in Rust for speed, reliability, and next-gen research.
- Transform every other token:
reverse,uppercase,mock,noise - Visualize token roles with color-coded Visual Mode
- Highlight token-level salience with Heatmap Mode
- Real-time mutation of OpenAI responses
- Designed for LLM interpretability, creativity, and stream manipulation
Instructions:
-
Download the ZIP and extract the
EveryOtherTokenfolder. -
Double-click
EveryOtherToken.bat. -
When prompted:
- Enter your OpenAI API Key (e.g.,
sk-...) - Type your prompt (e.g.,
"Tell me a story") - Choose a transformation (1–4)
- Choose a model (e.g., GPT-3.5 or 4)
- Enable visual mode (Y/n)
- Enable heatmap mode (Y/n)
- Enter your OpenAI API Key (e.g.,
What you’ll see:
Every Other Token - GUI Version
==================================
Enter your OpenAI API Key:
Enter your prompt: Tell me a story
Choose a transformation: [1] Reverse, [2] Uppercase, [3] Mock, [4] Noise
Choose a model: [1] GPT-3.5 Turbo, [2] GPT-4 Turbo, [3] GPT-4
Enable visual mode? (y/n): y
Enable heatmap mode? (y/n): y
[Beautiful, real-time color-coded output appears]You are now seeing the language model think, one token at a time.
- Rust 1.70 or higher
- OpenAI API key (get one from OpenAI)
git clone https://github.com/Mattbusel/Every-Other-Token
cd every-other-token-rust
cargo build --releasecargo run -- "Prompt here" [transform] [model] [--visual] [--heatmap]cargo run -- "Tell me a story about a robot"
cargo run -- "Explain quantum physics" uppercase
cargo run -- "Write a haiku" mock gpt-4
cargo run -- "What is consciousness?" reverse --visual --heatmap- Color-codes even vs odd tokens
- Even tokens: unchanged (normal)
- Odd tokens: transformed (bright cyan + bold)
Shows importance of each token based on:
- Token position
- Length
- Word type
- Syntactic/semantic clues
| Color | Meaning |
|---|---|
| 🔴 Bright Red | Most important (0.8–1.0) |
| 🟠 Red | High importance (0.6–0.8) |
| 🟡 Yellow | Medium (0.4–0.6) |
| 🔵 Blue | Low (0.2–0.4) |
| ⚪ White | Minimal (0.0–0.2) |
| Transform | Effect | Example (input: hello world) |
|---|---|---|
reverse |
Reverses odd tokens | hello dlrow |
uppercase |
Uppercases odd tokens | hello WORLD |
mock |
Alternating case | hello WoRlD |
noise |
Adds junk characters | hello w0rld$ |
Every Other Token is a playground for:
- LLM interpretability & token dependency research
- Creative mutation of AI output
- Robustness & semantic degradation testing
- Real-time token flow control
It’s not just a toy — it’s a research microscope.
Rust implementation offers extreme efficiency:
- 60% lower latency than Python
- ~10k tokens/sec throughput
- 90% lower memory usage Great for long prompts or batch testing
cargo run -- "What is the capital of France?" noise --visualcargo run -- "Solve: 87 * 45 =" reversecargo run -- "Write a love poem to the moon" mockcargo run -- "Explain how transformers work" --heatmapPull requests welcome!
- Fork the repo
- Create a new branch
- Code or tweak a transformation
- Test it
- Submit a PR
- Inspired by token-level control research
- Built in Rust with ❤️
- Thanks to OpenAI and the Rust async ecosystem
