A diagram of a sampler pipeline

Building a Pure-Python Top-p/Top-k Sampler with Temperature Scaling for LLM Logits

This post walks through building a pure-Python top-p/top-k sampler with temperature scaling, providing runnable code and a roadmap for productionizing it.

October 14, 2026 · 7 min · 1299 words · martinuke0
A diagram of a lazy weight loader pipeline

Lazy Loading LLM Weights with Safetensors, Async Prefetch, and Checksum Verification

A practical guide to building a lazy weight loader for large LLMs using safetensors, async prefetch, and checksum verification.

October 12, 2026 · 7 min · 1355 words · martinuke0
A sleek illustration of a sliding window over text tokens

Dynamic Sliding-Window Context Manager for LLM Prompt Histories

A hands‑on guide to building a production‑ready context manager that automatically trims prompt histories using attention‑weighted saliency, keeping your LLM prompts within any context window.

October 9, 2026 · 8 min · 1539 words · martinuke0
Diagram of a quantizer converting weights

Mini Post-Training Quantizer: FP32 to INT4 with Calibration and Dithering in Pure Python

This post walks through building a lightweight post-training quantizer that maps FP32 LLM weights to INT4 using calibration and dithering, with full Python code and testing steps.

October 7, 2026 · 7 min · 1393 words · martinuke0

Memory‑Aware KV Cache Eviction Engine for Long‑Context LLM Inference

A hands‑on guide to constructing a pure‑Python KV cache eviction engine that uses attention‑based pruning to reduce memory footprint for long‑context LLM inference.

October 3, 2026 · 7 min · 1425 words · martinuke0
Feedback