Real value, not just lessons

The AI Engineer Toolkit

36 copy-paste templates you can use at work today: a production LLM client, RAG on Supabase pgvector, hybrid search, an agent loop with guardrails, an MCP server, an eval harness, a security checklist and more. Each lesson unlocks one.

Unlock all for $69, once

Foundations

From lesson: Your First Day as an AI Engineer

AI Engineer 90-Day Plan & Skills Checklist

Checklist

A self-assessment and week-by-week plan to go from developer to job-ready AI engineer.

ai-engineer-90-day-plan.md

From lesson: Tokens: What Models Actually Read

Token & Cost Calculator

Python

Count tokens exactly with tiktoken (or estimate offline) and price any request before you ship it.

token_budget.py

From lesson: Next-Token Prediction & Temperature

Generation Settings Cheat Sheet

Checklist

Which temperature, top_p, max_tokens and stop settings to use for each type of task.

generation-settings.md

From lesson: How LLMs Are Built (and Why They Hallucinate)

Model Selection Scorecard

Checklist

Pick the right model for a feature with evidence: a weighted scorecard you fill in with your own eval results.

model-scorecard.md

From lesson: Context Windows, Latency & Cost

Chat History Trimmer

Python

Keep long conversations under a token budget: always keep the system prompt, drop the oldest turns first.

trim_history.py

Prompting & LLM APIs

From lesson: Anatomy of an LLM API Call

Production LLM Client (Anthropic + OpenAI)

Python

A small wrapper with timeouts, retries, stop-reason checks and token/cost logging, for either provider.

llm_client.py

From lesson: Streaming Responses

Streaming Chat Endpoint (FastAPI + SSE)

Python

A backend endpoint that streams model output to the browser token by token, plus the browser code to read it.

stream_server.py

From lesson: Prompt Engineering That Works

Production Prompt Template

Template

A battle-tested system-prompt structure: role, context, rules, examples, output format.

prompt-template.txt

From lesson: Reasoning Models & Chain of Thought

Self-Consistency Voting Wrapper

Python

Sample several answers in parallel and return the majority answer with an agreement score: higher accuracy on hard questions.

self_consistency.py

From lesson: Structured Output (JSON)

Validated JSON with Pydantic + Retry

Python

Turn any model reply into a typed, validated Python object, with an automatic retry that feeds back the error.

structured.py

From lesson: Tool Use (Function Calling)

Tool Registry with Auto-Generated Schemas

Python

Register Python functions as LLM tools with a decorator; schemas are built from type hints and docstrings.

tools.py

Retrieval (RAG)

From lesson: Embeddings & Similarity

Semantic Search in 40 Lines

Python

Embed documents once, search by meaning with NumPy. Fast enough for tens of thousands of chunks.

semantic_search.py

From lesson: Chunking Documents

Recursive Text Chunker

Python

Split documents on paragraphs, then sentences, then words, with overlap and metadata. A solid default for RAG.

chunker.py

From lesson: Building a RAG Pipeline

Production RAG on Supabase pgvector

SQL

SQL to set up a vector store in Supabase (table, HNSW index, search function) plus the Python to use it.

supabase_rag.sql

From lesson: Hybrid Search & Reranking

Hybrid Search: BM25 + Vectors + RRF

Python

Combine keyword and semantic search with Reciprocal Rank Fusion: better results on codes, names and meaning.

hybrid_search.py

From lesson: Evaluating RAG: Recall, MRR & Faithfulness

RAG Retrieval Eval Script

Python

Score any retriever on recall@k and MRR from a labeled JSONL file, and compare configs side by side.

rag_eval.py

Agents

From lesson: Workflows vs Agents

Workflow vs Agent Decision Checklist

Checklist

Decide in 5 minutes whether you need a prompt, a workflow or an agent, and which pattern to use.

agent-decision-checklist.md

From lesson: The Agent Loop

Production Agent Loop

Python

A provider-agnostic agent loop with step limits, tool errors as text, human approval for risky tools, and tracing.

agent.py

From lesson: Memory for Assistants & Agents

Long-Term Memory Store (SQLite)

Python

Save, rank and delete user memories with recency + importance + relevance scoring. No infrastructure needed.

memory_store.py

From lesson: Multi-Agent Systems

Orchestrator-Workers Template

Python

A lead agent plans sub-questions, workers research in parallel, and the lead synthesizes. Provider-agnostic.

orchestrator.py

From lesson: MCP: Model Context Protocol

Your First MCP Server (Python)

Python

A working MCP server (Python SDK v2) with a tool and a resource, plus the config to plug it into an AI app.

mcp_server.py

Evals & Production

From lesson: Evals: Testing LLM Systems

Eval Harness + LLM-Judge Rubric

Python

Run a JSONL test set through your system, grade with code checks and a judge, and fail CI on regressions.

eval_harness.py

From lesson: Prompt Injection & Guardrails

Prompt-Injection Defense Checklist

Checklist

A layered checklist to review any LLM feature or agent before launch, based on the OWASP LLM Top 10.

llm-security-checklist.md

From lesson: Reliability, Cost & Observability

Resilient LLM Call: Backoff, Jitter, Timeouts

Python

Drop-in retry wrapper with exponential backoff + full jitter, retry-after support and cost logging.

resilient_call.py

From lesson: Observability: Traces, Latency & Cost

Minimal LLM Tracer

Python

Nested spans with timing, tokens and cost written to JSONL, plus a p50/p95 report. Upgrade path to OpenTelemetry included.

tracing.py

From lesson: Cutting LLM Costs: Caching, Batching & Routing

LLM Cost-Cutting Playbook

Checklist

A prioritized checklist with the math to estimate each saving before you build it.

cost-playbook.md

ML for AI Engineers

From lesson: Neural Networks in One Lesson

Neural Network from Scratch (NumPy)

Python

A 2-layer network with backpropagation that learns XOR. The whole training loop in ~50 readable lines.

tiny_mlp.py

From lesson: How Models Learn: Gradient Descent

Gradient Descent from Scratch (NumPy)

Python

Linear regression trained with mini-batch gradient descent, plus a learning-rate comparison you can run.

gradient_descent.py

From lesson: Data Splits, Overfitting & Leakage

Leak-Free Dataset Splitter

Python

Deduplicate, then split into train/val/test reproducibly, and verify no example leaks across splits.

split_dataset.py

From lesson: Prompting vs RAG vs Fine-Tuning

Fine-Tuning Data Kit

Python

The chat-format JSONL that fine-tuning APIs expect, plus a validator that catches common data mistakes.

finetune_data.py

Build an AI SaaS

From lesson: Pick an AI Feature People Pay For

AI SaaS Idea Scorecard & Unit Economics

Checklist

Score ideas in 10 minutes and check the margin per user before you write any code.

ai-saas-scorecard.md

From lesson: Call AI From Your App, Safely

Secure LLM Endpoint (FastAPI)

Python

A production-shaped /api/generate: auth, validation, quota, timeout, fallback model, clean errors, cost logging.

generate_endpoint.py

From lesson: Protect User Data

PII Redaction Module

Python

Redact emails, cards, phones and IDs before prompts and logs, with optional restore after the model answers.

pii.py

From lesson: Usage Limits & Pricing That Cover AI Costs

Quotas & Rate Limits (Postgres/Supabase + Python)

Python

An atomic daily quota in SQL, a per-minute rate limiter, and the plan table that ties them to pricing.

usage_limits.py

From lesson: AI UX People Trust

AI UX Checklist

Checklist

Ship-ready checklist for AI features people trust: speed, transparency, control, failure and feedback.

ai-ux-checklist.md

From lesson: Launch, Measure, Improve

AI SaaS Launch Checklist & Weekly Metrics

Checklist

Everything to check before launch, and the weekly dashboard that tells you what to fix next.

launch-checklist.md