
Count tokens before designing an LLM feature
Build an explicit token budget for an international document assistant, reserve output capacity, and handle oversized inputs without silently dropping evidence.
Foundation
The journal / Ideas in progress
Engineering & everyday learningSoftware, systems, and the things I’m learning along the way. From first principles to AI in production.
Find something to readA little theory. A lot of practice.

Build an explicit token budget for an international document assistant, reserve output capacity, and handle oversized inputs without silently dropping evidence.

Calculate a tiny attention row, apply a causal mask, and follow the weighted value sum while keeping attention weights separate from an explanation.