Outlet
Latest stories
KV Cache Memory Management
Overview This post is divided into five parts; they are: • Estimating Cache Capacity • Contiguous and Paged Allocation • Configuring the KV Cache in vLLM • A Block Allocator with Copy-on-Write •…
Continuous Batching and Scheduling: An Introduction
Overview This post is divided into three parts; they are: • From Static to Continuous Batching • An Iteration-Level Scheduler • Token Budgets and Prefill Policy From Static to Continuous Batching…
Model Routing for AI Agents: Send Each Step to the Right LLM in Python
In this article, you will learn how to send each step of an AI agent to the right model, escalate to a stronger model…
Calibrating Scikit-LLM Classifiers: Knowing When to Trust an LLM Prediction
Looking at the diagram, it is not difficult to notice the classic LLM overconfidence issue.
Build a Lightweight LLM Evaluation Harness in Python
In this article, you will learn how to build a lightweight, reusable LLM evaluation harness in Python that combines exact-match scoring, an LLM-as-a-judge, and…
Anatomy of an LLM Serving Engine
Overview This post is divided into four parts; they are: • The Request Path • A Minimal Asynchronous Engine • Cancellation, Backpressure, and Failure • Metrics and Production Interfaces The Request…
Building an MCP Client in Python from Scratch
In this article, you will learn how to build a working MCP client in Python with the official MCP Python SDK 2.0, connect it…
Long-Context Inference
Overview This post is divided into four parts; they are: • The Cost of a Long Context • Chunked Prefill • Managing Long-Lived KV State • Selecting Useful Context The Cost of a Long Context For full…
Building a Multi-Agent Verification Loop in Python with Small Open Models
In this article, you will learn how to build a Proposer-Critic-Judge verification loop in Python with a single small open model, and how to…
Prefix Caching and Prompt Reuse
Overview This post is divided into five parts; they are: • Reusing Prefill Work • Finding the Longest Cached Prefix • Block Hashes, Radix Trees, and Compatibility • Designing Prompts for Reuse •…
Running 1-Bit LLMs Locally: A Practical Guide to BitNet Inference
Before running anything, it helps to know what Microsoft measured.
Speculative Decoding
Overview This post is divided into six parts; they are: • Draft and Verify • Sampling-Based Speculative Decoding • Assisted Generation with a Draft Model • Measuring Acceptance and Speedup • Other…
The Complete Guide to Embedding Models for Machine Learning
In this article, you will learn how embedding models differ, what they cost to run at scale, and how to benchmark open-weight models on…
How to Build Tool-Calling Local AI Agents in Python
In this article, you will learn how to build a local AI agent in Python that uses Ollama and Qwen3 to call tools that search,...
Decoding Policies in a Serving Engine
Overview This post is divided into six parts; they are: • Running Decoding Policies with vLLM • Sampling Filters and Per-Token Work • Multiple Outputs and Beam Search • Stop Conditions and Request…
7 Ways AI Agents Fail in Production (and How to Catch Each One)
Three events that look alike need separate names.
Model Compression Beyond Quantization
Overview This post is divided into three parts; they are: • Pruning and Sparsity • Structured Pruning • Knowledge Distillation Pruning and Sparsity Pruning sets selected model parameters to zero or…
Visualizing Information Entropy in Language Models
In this article, you will learn how information entropy and cross-entropy loss connect classical information theory to the way large language models are trained…
Graph-RAG for Enterprise Documents: Building a Knowledge Graph from PDFs, Wikis, and Databases
Prerequisites You'll need Python 3.
Activation and Floating-Point Quantization
Overview This post is divided into three parts; they are: • Why Activations Are Hard to Quantize • W8A8 Inference and SmoothQuant • Floating-Point Quantization Why Activations Are Hard to Quantize
Gradient Boosting vs. Random Forest vs. Neural Networks: A 2026 Performance Benchmark
In this article, you will learn how gradient boosting, random forest, neural networks, and tabular foundation models compare on accuracy, speed, and data requirements…
Serving Scikit-LLM Pipelines as REST APIs with FastAPI
In this article, you will learn how to serve a Scikit-LLM zero-shot text classification pipeline, powered by a local Ollama model, as a REST…
Weight-Only Quantization
Overview This post is divided into five parts; they are: • Asymmetric Affine Quantization • Post-Training Quantization with PyTorch • GPTQ and AWQ • Quantizing a Model to GGUF • Evaluating Weight-Only…
The Complete Guide to LLM Evaluation
In this article, you will learn how to evaluate LLM applications systematically, from choosing scorers and designing reliable LLM judges to evaluating RAG systems…
Fast Attention Kernels and Operator Fusion
Overview This post is divided into four parts; they are: • Operator Fusion • FlashAttention-Style Kernels • Paged Attention Kernels • Fusion and CUDA Graphs with torch.
Getting Reliable Structured Outputs from LLMs: Validation, Retries and Constrained Decoding
The fixture suite turns the sentences above into fourteen test cases, from a missing required key and a code fence around the JSON to a fabricated quote, a refusal and exhaustion with no fourth call.
What Are Diffusion Language Models, and Why Are They Different From GPT?
Then you train the neural network to reverse this process, commonly using a mean squared error objective.
Attention Variants and Memory Efficiency
Overview This post is divided into eight parts; they are: • The Checkpoint Fixes the Attention Architecture • A Closer Look at Attention Memory • Multi-Head Attention • Multi-Query and Grouped-Query…
Benchmarking Scikit-Ollama vs. Groq-Backed Scikit-LLM: Speed, Cost, and Accuracy
In this article, you will learn how to build a side-by-side benchmark of local and cloud LLM classifiers using Scikit-Ollama and a Groq-backed Scikit-LLM pipeline....
Floating-Point Precision and Its Effects to Model Inference
Overview This post is divided into five parts; they are: • How Floating-Point Numbers Work • Common Precision Formats • Loading a Model at a Different Precision • Mixed Precision and Sensitive…
DiffusionGemma: Hands-On with Google’s Text Model That Writes All at Once
In this article, you will learn what DiffusionGemma is, how its diffusion-based text generation differs from standard autoregressive language models, and how to run…
Free AI and Data Courses with 365 Data Science: 100% Unlimited Access until Nov 20
Sponsored Content From November 5 to November 20, 2026 (starting at 8:00 a.m. UTC), 365 Data Science will grant free access…
Decorators for Timing, Retries, Caching, and Validation in Python
In this article, you will learn how Python decorators work under the hood and how to build reliable ones for timing, retries, caching, and…
How to Train Your own Decision Model like Jev using Unsloth
In this article, you will learn how to turn an open-weight language model into a decision model that classifies user intent, by fine-tuning Qwen3.5-4B…
Choosing an LLM Inference Optimization Technique: A Decision-Tree Approach
In this article, you will learn how to match an LLM inference optimization technique to the actual bottleneck in your workload by working through…
The AI Agent Memory Stack: Building Blocks, Patterns, and Frameworks
In this article, you will learn how agent memory works, what types of memory exist, and how different frameworks approach storage, retrieval, and memory…
7 Ways Your AI Agent Is Wasting Tokens (And What to Do Instead)
In this article, you will learn seven common token-waste patterns in production AI agent systems, and the architectural fixes that address each one.
Fine-Tuning vs. Frozen Embeddings: When to Adapt the LLM vs. the Sklearn Head
In this article, you will learn how to compare two strategies for adapting a large language model to a specific domain: fine-tuning with LoRA…
Context Managers Beyond Opening Files in Python
The stopwatch in the opening script is the smallest case of the pattern.
Robust Serialization with JSON and Custom Types
In this article, you will learn how to build a robust JSON serialization pipeline in Python that handles custom data types, graceful error recovery…
Speculative Decoding Explained: How to Get 3× Faster Inference from Any LLM
In this article, you will learn how speculative decoding works, why it produces real speed gains at the hardware level, and what modern implementations…
How to Build a Multi-Modal RAG Pipeline for Images and Documents in Python
In this article, you will learn how to build a multi-modal RAG pipeline in Python that retrieves and reasons over both text and images…
pgvector vs. Dedicated Vector Databases: A Production Benchmark
Run this on a typical laptop and both systems will report latencies in the low single-digit to tens of milliseconds range, with the exact numbers depending heavily on your CPU, available RAM, and…
Descriptors and Controlled Attributes in Python
In this article, you will learn what Python descriptors are and how to use them to build three types of controlled attributes: validated, computed…
Choosing a Chunking Strategy for Your LLM Apps: A Decision-Tree Approach
In this article, you will learn how to choose the right chunking strategy for a retrieval-augmented generation system by working through a structured decision…
Building a Custom LLM Evaluation Harness in Python from Scratch
In this article, you will learn how to build a custom LLM evaluation harness in Python from scratch, structured around four modular components that…
Building a RAG Pipeline with LLM Embeddings and Scikit-learn
In this article, you will learn how to build a lightweight, end-to-end RAG pipeline using scikit-learn for vector retrieval and open-source models for embeddings…
AI Agent Benchmarks Explained: SWE-Bench, GAIA, WebArena, and More
In this article, you will learn what the major AI agent benchmarks measure, how they differ from traditional model benchmarks, and how to use…
How to Fine-Tune Llama 3 for Custom Tool Calling with Unsloth in Python
Llama 3 is a capable generalist, but that's exactly the problem when you need an agent that reliably outputs structured JSON for a specific API.
Evaluating Graph-RAG vs. Standard RAG: A Hallucination Benchmark on Fact-Dense Queries
In this article, you will learn how to benchmark a deterministic 3-Tiered Graph-RAG system against a standard vector RAG pipeline on fact-dense queries, and…