Capstone Preparation
Hands-on lab with starter code you can copy + run, and guided steps to produce the artifact for this module.
Setup
- Open a fresh terminal in a new folder, e.g.
mkdir lab-12 && cd lab-12. - Create a Python 3.11 venv:
python -m venv .venv && source .venv/bin/activate. - Install the dependencies noted on each starter snippet (the small pip install … line above the code).
- Copy each starter into a file with the suggested name, then run it and capture the output.
Starter code
# 1. Data
# python scripts/prep_data.py --in raw/ --out data/train.jsonl
# 2. LoRA fine-tune
# accelerate launch scripts/sft.py --base Qwen/Qwen2.5-1.5B --data data/train.jsonl
# 3. Evaluate
# lm_eval --model hf --model_args pretrained=out/merged --tasks mmlu,gsm8k
# 4. Serve
# vllm serve out/merged --port 8000
# 5. Load test
import asyncio, time, httpx
async def hit(c): t=time.time(); await c.post("http://localhost:8000/v1/chat/completions",
json={"model":"out/merged","messages":[{"role":"user","content":"hi"}]}); return time.time()-t
async def main():
async with httpx.AsyncClient() as c:
lat = await asyncio.gather(*[hit(c) for _ in range(64)])
print(f"p50={sorted(lat)[len(lat)//2]:.2f}s")
asyncio.run(main())python 12_01_lab.pyGuided steps
Work through each step in order. Stop when your output matches the expected artifact — then push your work to your lab folder.
- 1Capstone plan
Do — Write a 1-page plan: domain, dataset, base model, fine-tune method, eval set, serving target, success metric.
Expected artifact — plan.md with the seven sections filled in and reviewed by a peer.
Run free: - 2End-to-end run
Do — Ship the full pipeline: data prep → LoRA SFT → DPO → eval → vLLM serve → load test. Commit the repo.
Expected artifact — A git repo with Makefile that reproduces the whole run with `make all`.
Run free: - 3Capstone report
Do — Write a 5-page report covering decisions, metrics, failure modes, and cost.
Expected artifact — report.pdf with at least 2 figures, a metrics table, and a cost breakdown in USD.
Run free:
Authoritative sources
Independent primary sources used to check and corroborate the guidance on this page.
- NIST National Initiative for Cybersecurity Education (NICE)
US national framework for cybersecurity work roles and competencies.
- Financial Action Task Force (FATF)
Global AML/CFT standards referenced by financial-crime curricula.
- FBI Internet Crime Complaint Center — Annual Reports
Primary loss and typology data used in fraud-investigation training.
- US Federal Trade Commission — Consumer Sentinel Data Book
Official complaint statistics for teaching fraud trend analysis.
