Python code on a laptop screen with a tree diagram

Hands-On Build Guide: Tree‑Based Speculative Decoding Engine with Medusa‑Style Draft Heads

A hands‑on implementation of tree‑based speculative decoding with Medusa draft heads in pure Python, ready to run and extend.

November 8, 2026 · 9 min · 1737 words · martinuke0
A Python script visualising token generation and speculative decoding

Build a Medusa Speculative Decoding Engine in Pure Python

Learn how to construct a Medusa‑style speculative decoding engine in pure Python, from architecture to testing, and how the project signals production‑grade systems skills to hiring managers.

November 4, 2026 · 8 min · 1627 words · martinuke0
A visual representation of a speculative decoding engine processing tokens across multiple parallel heads.

Building a Medusa Speculative Decoding Engine from Scratch

Learn how to build a high-performance speculative decoding engine from scratch, mastering KV-cache management and token-tree verification to optimize LLM inference.

September 21, 2026 · 8 min · 1620 words · martinuke0
Diagram of a speculative decoder with Medusa draft heads feeding a verification pass on a target model.

Building a Speculative Decoder with Medusa-Style Draft Heads in PyTorch

Build a speculative decoder with Medusa-style draft heads and modern samplers in PyTorch. A production-flavored portfolio project that signals real ML systems skill.

September 6, 2026 · 17 min · 3446 words · martinuke0
Feedback