← Course overview

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

CommandUse it to…
ollama --versionCheck the installed version.
ollama listList models downloaded to this Ollama server.
ollama pull gemma3:1bDownload or update the course example model.
ollama run gemma3:1bStart a terminal chat. Downloads the model if it is missing.
/byeLeave an interactive Ollama chat; enter this at its prompt, not in your system shell.
ollama show gemma3:1bInspect the model’s details.
ollama psSee currently loaded models and their resource placement.
ollama stop gemma3:1bUnload this model from memory; keep its downloaded files.
ollama create cybercorps-study -f ModelfileCreate a named configuration from your saved Modelfile.
ollama rm cybercorps-studyRemove this local model entry when you no longer need it.
ollama serveStart 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.content

The 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.

Official references