Run the grader
# grade this stage (from your course directory)
npx theinference test --stage run-the-grader --watchThis is your first green check. It proves the loop works — edit, save, watch it grade — before you write any inference code. Every later step plugs into this exact loop, so it's worth landing the green here and watching how it feels.
The run / learn loop
You work in your own editor and terminal. The flow is:
- Log in (once):
npx theinference login— approves in your browser, and passing stages then tick off here automatically - Scaffold the course:
npx theinference course start llm-inference ./llm-inference - Install dependencies:
cd llm-inference && npm install - Run the grader in watch mode:
npx theinference test --stage run-the-grader --watch
The grader executes your program through ./your_program.sh (which runs src/gpt2.ts), feeds it inputs, and compares the output to a reference. --stage runs everything up to the stage you're on — each lesson shows its exact command — so a green run means your stage is done.
What to do
Run the grader
Nothing to write — the setup command is already wired in src/gpt2.ts. Just run the grader and watch this step pass.
if (command === "setup") {
console.log("theinference: toolchain OK");
process.exit(0);
}
npx theinference test --stage <stage> --watchre-runs on every save — keep it open next to your editor, and bump--stageas you advance (each lesson shows its command).- Debug to stderr (
console.error); the grader only reads stdout, so strayconsole.logwill fail an exact-match check. - Steps unlock in order — with
--stageset, a fully green run means your current stage is complete.
Most steps from Chapter 1 on need the real GPT-2 weights. The download script ships with your course — run it once from your course directory, while you read, so you're never blocked:
./scripts/fetch-weights.sh ./weights
It puts model.safetensors in ./weights/, where the grader expects it. Kick the download off in another terminal now.
How it's graded
Your program is run as ./your_program.sh setup. Its stdout must be exactly:
theinference: toolchain OK