Skip to main content
GACS will never ask for your seed phrase, private keys, or payment. free and ad-free.
Back to lessonLab · Module 12 / 12
Lab

Capstone Preparation

Hands-on lab with starter code you can copy + run, and guided steps to produce the artifact for this module.

Setup

  1. Open a fresh terminal in a new folder, e.g. mkdir lab-12 && cd lab-12.
  2. Create a Python 3.11 venv: python -m venv .venv && source .venv/bin/activate.
  3. Install the dependencies noted on each starter snippet (the small pip install … line above the code).
  4. Copy each starter into a file with the suggested name, then run it and capture the output.

Starter code

01 · End-to-end capstone scaffold
Skeleton: data → fine-tune → eval → serve → bench
save as: 12_01_lab.py
python
# 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())
Run with: python 12_01_lab.py

Guided steps

Work through each step in order. Stop when your output matches the expected artifact — then push your work to your lab folder.

  1. 1
    Capstone 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:
  2. 2
    End-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:
  3. 3
    Capstone 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.