Open Weight Models · Keep nearby
Ollama quick reference
Use these commands on your own computer after completing the setup lesson. Examples use the local model gemma3:1b.
Everyday commands
| Command | Use it to… |
|---|---|
ollama --version | Check the installed version. |
ollama list | List models downloaded to this Ollama server. |
ollama pull gemma3:1b | Download or update the course example model. |
ollama run gemma3:1b | Start a terminal chat. Downloads the model if it is missing. |
/bye | Leave an interactive Ollama chat; enter this at its prompt, not in your system shell. |
ollama show gemma3:1b | Inspect the model’s details. |
ollama ps | See currently loaded models and their resource placement. |
ollama stop gemma3:1b | Unload this model from memory; keep its downloaded files. |
ollama create cybercorps-study -f Modelfile | Create a named configuration from your saved Modelfile. |
ollama rm cybercorps-study | Remove this local model entry when you no longer need it. |
ollama serve | Start a server when one is not already running. An existing app or service may already own port 11434. |
Run one command at a time. Model removal changes your local installation; unloading a model only releases its memory. See Lesson 7 for troubleshooting and privacy settings.
Make a local API request
Start Ollama and download gemma3:1b first. These examples request one complete JSON response. The answer is in message.content. Use the example for your shell.
Chat request on macOS or Linux · Shell
curl http://localhost:11434/api/chat \
-H 'Content-Type: application/json' \
-d '{
"model": "gemma3:1b",
"messages": [{"role": "user", "content": "Explain a computer backup in two sentences."}],
"stream": false
}'Chat request on Windows · PowerShell
$body = @{
model = 'gemma3:1b'
messages = @(@{ role = 'user'; content = 'Explain a computer backup in two sentences.' })
stream = $false
} | ConvertTo-Json -Depth 5
$result = Invoke-RestMethod -Uri 'http://localhost:11434/api/chat' -Method Post -ContentType 'application/json' -Body $body
$result.message.contentThe local endpoint needs no API key. Keep it on your own machine; it is not an authenticated public service. See Lesson 5 for a Python client and conversation history.
Key terms
Weights
The learned numerical parameters used by a model. Their availability does not by itself describe the permissions in its licence.
Inference
Using an existing model to generate a result from an input.
Token
A unit of text processed by the model. A word may occupy more than one token.
Context
The working input available for a generation, including instructions, supplied material, and conversation history.
Quantisation
Representing model values with fewer bits to reduce storage and memory needs, with possible quality trade-offs.
Model tag
A model identifier such as gemma3:1b. Record the model ID as well when you need to track a particular downloaded version.
Modelfile
An Ollama configuration that selects a base model and supplies settings or instructions.
Evaluation
Checking outputs against defined tasks and expected behaviour, while recording errors as well as successes.