The lab notebook
Field notes on AI engineering
824 articles · page 2 of 28
AI Data Enrichment Pipelines in n8n
Learn how to build production-grade n8n AI enrichment pipelines that pull raw records from a database, enrich them with an LLM, validate the output, and write clean structured data back, complete with batching, retries, and cost controls.
Communication Patterns for Multi-Agent Systems
A practical breakdown of how autonomous agents pass messages, share state, and stay observable, with runnable Python patterns you can drop into a real project.
Mocking LLM APIs in Your Tests
Learn practical patterns for mocking LLM APIs in your test suite, so you get fast, deterministic tests without burning API credits or waiting on network calls.
MCP vs LangChain Tools
A hands-on comparison of MCP vs LangChain tools, covering how each defines, discovers, and executes tool calls, with runnable code for both.
Input Validation for MCP Tools
MCP tool input validation stops malformed and malicious arguments before they reach your handler code. This guide covers schema design, runtime checks, and error messages that help an LLM self-correct.
Monitoring MCP Servers in Production
A hands-on guide to MCP server monitoring: the metrics that matter, structured logging for tool calls, health checks, OpenTelemetry tracing, and alerting rules that catch failures before your agents do.
Deploying MCP Servers with Docker
A hands-on guide to packaging a Model Context Protocol server into a Docker image, wiring it up with docker compose, and connecting it to Claude Desktop or Claude Code.
Authenticating MCP Servers
A hands-on guide to MCP server authentication, covering API key auth, OAuth 2.1 flows, token storage, and the mistakes that leak credentials to a model.
MCP Python SDK Tutorial
A hands-on walkthrough of the MCP Python SDK: build a real MCP server with tools and resources, wire up a client, and connect it to Claude Desktop or Claude Code.
Progress Notifications in MCP
MCP progress notifications let a server stream live status updates for long-running tools instead of leaving the client waiting on a silent request. Here is how the progress token flow works and how to wire it up in Python and TypeScript.
Building an MCP Client in Python
Learn how to build an MCP client in Python from scratch, connect it to a local server over stdio, list and call tools, and wire the whole thing into a Claude API tool-use loop.
Building an OpenAI Scenario in Make
A hands-on walkthrough for wiring Make to OpenAI, from the first connection through error handling, structured outputs, and two production-ready scenarios.
Load Testing AI Endpoints
Load testing AI endpoints means measuring token throughput, time-to-first-token, and streaming stability under concurrency, not just requests per second. This guide walks through k6 and Locust scripts, streaming test patterns, and cost-safe ramp strategies you can run today.
Configuring Timeouts for LLM Calls
A practical guide to setting connection, read, and total timeouts for LLM API calls, with working code for the OpenAI SDK, the Anthropic SDK, raw HTTP clients, and streaming responses.
Serving Open LLMs with vLLM
A hands-on guide to deploying open LLMs with vLLM, covering installation, the OpenAI-compatible server, continuous batching, quantization, and tuning throughput for production traffic.
Request Queuing for LLM Backends
Learn how to design and build an LLM request queuing layer that batches prompts, enforces backpressure, and keeps GPU throughput high under bursty traffic.
A Practical Guide to LLM Quantization
LLM quantization shrinks model weights from 16-bit or 32-bit floats down to 8-bit or 4-bit integers, cutting memory and latency with only a small accuracy hit. This guide walks through the formats, the tools, and the tradeoffs with runnable code.
Toxicity Detection for LLM Outputs
A hands-on guide to building toxicity detection into your LLM evaluation pipeline, with runnable code for classifier-based scoring, LLM-as-judge checks, and CI gating.
How to Build an LLM Regression Suite That Actually Catches Prompt Breakage
A practical walkthrough for building an LLM regression suite that runs on every prompt or model change, so you catch quality drops before users do.
Evaluating RAG with Ragas: A Tutorial
A hands-on ragas tutorial for scoring retrieval-augmented generation pipelines on faithfulness, relevancy, and context quality, with runnable Python code and a CI-ready evaluation harness.
Benchmarking LLM Evaluation Latency
A hands-on guide to measuring and reducing llm eval latency across judge calls, batching, and CI gates, with runnable Python harnesses you can drop into any eval pipeline.
Building a Golden Dataset for LLM Evaluation
A practical, code-first walkthrough for building an llm golden dataset from scratch: sourcing examples, writing rubrics, versioning, and wiring it into a CI eval loop.
The Faithfulness Metric in LLM Evaluation
The faithfulness metric checks whether an LLM's answer is actually grounded in the context it was given, catching hallucinations before they reach users. Here's how to compute it, score it, and wire it into a test suite.
LLM Evaluation with Braintrust: A Hands-On Guide
A practical walkthrough of setting up braintrust llm eval pipelines, from writing your first Eval script to scoring outputs, logging production traces, and gating deploys in CI.
Bias Testing for LLM Applications
A hands-on guide to LLM bias testing: how to design demographic perturbation tests, counterfactual templates, and LLM-judge scoring pipelines that catch skewed outputs before they ship.
Error Recovery for LLM Applications: A Production Playbook
LLM error recovery is the set of retry, validation, fallback, and circuit-breaker patterns that keep an AI application working when a model call times out, returns malformed output, or gets rate limited. This guide walks through runnable Python patterns for each failure mode.
Deploying LLM Services on Kubernetes
A hands-on guide to running LLM inference services on Kubernetes, covering GPU scheduling, autoscaling, model serving frameworks, and the operational details that separate a demo from a production deployment.
LLM Cost Monitoring Tools Compared
A hands-on comparison of the LLM cost monitoring tools teams actually run in production, with setup code for each and a decision framework for picking one.
Caching LLM Responses with Redis
A hands-on guide to LLM caching with Redis, covering exact-match keys, semantic caching with vector search, TTL strategy, and how to wire it into a real request pipeline.
LLM App Frameworks Compared
A practical comparison of the LLM app frameworks developers actually reach for in 2026, from lightweight SDKs to full multi-agent orchestrators, with runnable code and a decision checklist.