ai-engineer-notebooks README

The project's README from github.com/calmrocks/ai-engineer-notebooks. As one markdown file: README.md.

AI Engineer Notebooks

License: MIT Open In Colab GitHub stars

Learn the applied-LLM stack the way you'll actually be interviewed on it: framework-free, on a free API, from prompting all the way to serving, fine-tuning, and a red-team benchmark.

Runnable Colab notebooks for the AI Engineer / Forward Deployed Engineer (FDE) skill set. You build working systems on top of foundation models (model APIs, RAG, evals, agents, adaptation, serving) using raw APIs, not frameworks.

What makes this different

Built as the hands-on companion to Plan: Transitioning to Forward Deployed Engineer / AI Engineer. The plan explains what to learn and why; these notebooks are where you run it.

Who this is for

Backend or full-stack engineers moving into AI Engineer, FDE, Applied AI, or Solutions Engineer (AI) roles. Different titles, largely the same job. You can ship production code; you want the applied-model layer on top.

Learning order

Work top to bottom. Each notebook is self-contained (installs its own dependencies, reads API keys from Colab secrets) and ends with exercises.

00 — Setup

Notebook What you'll learn
Environment & cost hygiene
Open In Colab
API keys via Colab secrets, spend guards, model picking

01 — Model APIs

Notebook What you'll learn
Prompting fundamentals
Open In Colab
Clear instructions, few-shot, output-format specs, step-by-step reasoning: the cheapest lever, each shown moving a number
Structured output
Open In Colab
Getting reliable JSON out of a model, and where it breaks
Tool calling
Open In Colab
Function/tool calling end to end, error paths included
Streaming
Open In Colab
Streaming responses and what UIs need from them
Context & caching
Open In Colab
Context-window budgeting, prompt caching, batch vs real-time pricing

02 — Evals I: measuring outputs

Notebook What you'll learn
Measuring outputs
Open In Colab
Golden sets and metrics on the section-01 task; install the "measure before you tune" habit before building anything you'd need to tune. Evals is the spine; it returns in every section after this

03 — RAG

Notebook What you'll learn
What is RAG?
Open In Colab
The retrieve → augment → generate loop, why RAG beats a plain LLM, and why RAG isn't the same as embeddings, with a 15-line working demo
Embeddings & retrieval
Open In Colab
Embedding choice, vector search, similarity pitfalls. Get retrieval working first
Hybrid & reranking
Open In Colab
Keyword + vector hybrid retrieval, rerankers, when each earns its cost
Chunking
Open In Colab
Chunking strategies on a real messy corpus, revisited last once you can judge them against retrieval
Why RAG fails
Open In Colab
Diagnosing bad answers: retrieval quality, not generation, is usually the bottleneck

04 — Evals II: the differentiator

Notebook What you'll learn
Golden sets
Open In Colab
Building a golden set for the RAG system from section 03
LLM as judge
Open In Colab
Judge prompts, agreement with humans, and the judge's own failure modes
Regression evals
Open In Colab
Evals as CI: catching quality regressions when you change a prompt or model

05 — Agents

Notebook What you'll learn
Agent loop from scratch
Open In Colab
A working agent loop in raw API calls, no framework
Tool design
Open In Colab
Designing tools the model can actually use well
Guardrails & budgets
Open In Colab
Stopping conditions, cost/latency budgets, when a pipeline beats an agent
MCP & the tool ecosystem
Open In Colab
Concept: what the Model Context Protocol standardizes, how it maps to the raw tool loop, and when to reach for it
Skills & progressive disclosure
Open In Colab
Concept: packaging reusable know-how an agent loads on demand. The SKILL.md pattern, the context-budget payoff, and Tools/MCP/Skills as one story
Harness engineering
Open In Colab
Synthesis: the scaffold around the call: context assembly & compaction, tool-result shaping, and verification loops. Names the discipline the section has been teaching piece by piece

06 — Adapting the model

Notebook What you'll learn
Fine-tune vs RAG vs prompt
Open In Colab
When to change the model's weights vs its inputs; what LoRA/QLoRA are and cost; the argument you'll have in the room, plus an optional real LoRA fine-tune on a free GPU

07 — Security

Notebook What you'll learn
Prompt injection & the trust boundary
Open In Colab
Direct & indirect prompt injection, output handling, PII, excessive agency. The OWASP LLM Top 10 risks, failing live then defended

08 — Operations

Notebook What you'll learn
Observability & LLMOps
Open In Colab
Tracing every call, safe prompt logging, cost/latency/error metrics, drift detection, and the observe→eval feedback loop
Reliability & fallbacks
Open In Colab
Retries with backoff, timeouts, fallback models, output validation, circuit breakers, graceful degradation
Experiment tracking & registry
Open In Colab
MLflow end to end: log runs/params/metrics from the section-04 eval harness, register and version a model, and promote by stage: the tooling that turns "I ran an eval" into a tracked, reproducible workflow

09 — Serving & inference performance

Where the free Groq API can't run the topic (these frameworks need a GPU), the notebook teaches it concept-first and fences an optional Colab-GPU appendix, the same pattern as the section-06 LoRA appendix.

Notebook What you'll learn
Serving frameworks
Open In Colab
The serving stack an AI engineer actually picks between (vLLM, TGI, Triton, TensorRT-LLM): what each optimizes, how they map onto the raw API you've been calling, and when to reach for which
Inference performance
Open In Colab
The levers behind throughput and latency: continuous batching, the KV cache, quantization, and the throughput-vs-latency trade, with the napkin math to size a deployment

10 — ML system design & performance

Notebook What you'll learn
Designing an inference service
Open In Colab
Concept: the ML system design interview, worked end to end: QPS/VRAM/latency/cost estimation, replica scaling, queueing, caching, and the SLA trade-offs, on a realistic LLM-serving prompt

11 — Customer craft (the FDE differentiator)

Notebook What you'll learn
Scoping & discovery
Open In Colab
Turn a vague customer ask into a scoped, evaluable system: discovery questions, a one-page scoping doc, the demo discipline: the customer-scenario interview round most engineers can't evidence

12 — Case Studies & Capstone

Where the skills come together into projects. First a case study (one realistic scenario worked end to end, runnable), then the capstone: the deployed repo you build yourself. (Section overview.)

Notebook What you'll learn
Case study A — Customer-support assistant
Open In Colab
One scenario scoped → built → served → debugged in production: a vague ask becomes a deployed, evaluated RAG+agent assistant, then a live quality regression (a stale index after a corpus migration) that you diagnose and fix. A build-to-debug arc threading sections 02–11
Case study B — Contract extraction: pipeline vs agent
Open In Colab
The judgment call interviewers love: build the same extraction task as both an agent and a pipeline, then prove with accuracy + token cost that the pipeline wins when the steps are known
Case study C — Red-team robustness benchmark
Open In Colab
A different kind of system, a harness that evaluates a model instead of serving one: an attacker→target→judge (PAIR) loop that measures attack success rate, composing the agent loop, LLM-judge, security, and evals

Capstone: the brief for the deployed project that goes on your resume, a real repo with a serving component and an eval report. Case studies are for learning; the capstone is for hiring.

Conventions

Setup

  1. Get a free API key at console.groq.com, no credit card required.
  2. In Colab: the key icon in the left sidebar → add GROQ_API_KEY as a secret, and toggle notebook access on.
  3. Open any notebook via its badge and run top to bottom.

Running locally instead: pip install -r requirements.txt && pip install -e . (the second installs the aien setup helper), export GROQ_API_KEY=..., open with Jupyter.

ai-engineer-notebooks (calmrocks/ai-engineer-notebooks)

Searching Database…

这是什么?一套不依赖框架、注重动手实践的 Jupyter/Colab 笔记本合集,教授应用型 LLM 工程师的技能——模型 API、RAG、评估、智能体、微调、安全和 LLMOps——为转向 AI Engineer / Forward Deployed Engineer(FDE)岗位的工程师打造。
这是现成的框架,还是需要自己动手完成的东西?它是一系列自成体系的 Colab/Jupyter 笔记本,不是框架——你用原始 API 调用亲手编写智能体循环、RAG 流水线和评估,而不使用 LangChain 或类似工具。
怎么开始学习这些笔记本?在 console.groq.com 获取免费的 Groq API 密钥,将其作为 GROQ_API_KEY secret 添加到 Colab,然后通过徽章打开任意笔记本并从头到尾运行;如果想改在本地运行,就配合 Jupyter 使用 'pip install -r requirements.txt && pip install -e .'。
运行这些笔记本需要 OpenAI 或 Anthropic 的密钥吗?不需要——所有内容都能在免费的 Groq API 上端到端运行,无需信用卡;接口与 OpenAI 兼容,稍作修改即可把同样的模式迁移到 OpenAI 或 Anthropic。
每个笔记本都能在免费的 Groq 套餐上运行吗?几乎全部可以——仅有的两个例外是 LoRA 微调(第 06 节)和自托管推理服务(第 09 节),Groq 无法托管它们,所以这两节以概念讲解为主,附有可选且相互隔离的 Colab-GPU 附录,已在真实 T4 上验证。
这个系列是写给谁的?面向正转向 AI Engineer、FDE、Applied AI 或 Solutions Engineer(AI)岗位的后端或全栈工程师——也就是已经能交付生产代码、想在之上补齐应用模型层的人。
这门课说的“评估为主轴”是什么意思?评估在第 02 节早早登场,并在之后每一节反复出现,贯彻“先测量再调优”的习惯,在构建任何需要调优的东西之前先建立度量。
结业部分包含哪三个案例研究?一个在生产环境中调试的支持助理、一场针对合同抽取的流水线与智能体的成本对决,以及一个测量攻击成功率的红队(PAIR)鲁棒性基准。
它讲 MCP 和智能体 Skills 吗?讲——第 05 节从概念上介绍 Model Context Protocol,以及它如何映射到底层工具循环,还有用于渐进式披露智能体技能的 SKILL.md 模式。
课程比较了哪些推理服务框架?第 09 节讲 vLLM、TGI、Triton 和 TensorRT-LLM,解释各自优化了什么,以及它们如何映射到整套笔记本中使用的底层 API。
Creator
calmrocks
Size
0.8 MB
Stars
706
Age
2mo
Commits · 90 Days