models · beginner · 15 min
Run a model on your laptop
Run a small open model on your own machine and call it two ways: from the terminal and over HTTP.
HANDS-ON LAB · YOU RUN IT ON YOUR MACHINE · 3 STEPS
-
Install Ollama and pull a small model
Everything in this course can start on a model this size. Bigger models come later, when you can measure whether they are worth it.
Run this to check
ollama pull llama3.2 && ollama listYou pass when
The list shows llama3.2 with a size of about 2 GB.
-
Ask it one question from the terminal
Run this to check
ollama run llama3.2 "In one sentence, what is a token?"You pass when
One sentence prints and you get your prompt back.
-
Call the same model over HTTP
This is the same request shape most hosted models accept. Every later lab is this call with more around it.
Run this to check
curl -s http://localhost:11434/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"llama3.2","messages":[{"role":"user","content":"Say hi in three words."}]}'You pass when
JSON comes back with the answer under choices[0].message.content and a usage block that counts prompt and completion tokens.
No transcript here on purpose. This page does not show terminal output, because model answers differ from run to run. Each step says what a pass looks like; your own terminal is the proof.