← Course overview

Open Weight Models · macOS · Keep nearby

Ollama quick reference · macOS

Use these commands in macOS Terminal with the native Ollama app running. Enter ~/CyberCorps/open-weight-models for commands that read or write the course files. Model removal is optional cleanup; the local-only setting requires an app restart and verification.

Everyday commands

CommandUse it to…
ollama --versionRecord the installed client version and any warning.
python3 --versionConfirm Python 3 is available for the API client and capstone.
mkdir -p ~/CyberCorps/open-weight-modelsCreate the project folder if needed.
cd ~/CyberCorps/open-weight-modelsEnter the workspace in each Terminal window used for project files.
ollama listCheck the local service and its downloaded model inventory.
ollama pull gemma3:1bDownload the exact course model after checking its terms and requirements.
ollama run gemma3:1bStart a local chat; type /bye inside the chat to return to Terminal.
ollama show gemma3:1bInspect the model's details.
ollama psInspect currently loaded models and processor allocation.
ollama stop gemma3:1bUnload the model while keeping its downloaded copy.
ollama rm gemma3:1bOptional cleanup: delete this local model copy; a later use may require another download.
python3 local_chat.pyRun the saved API client from the workspace.
ollama create cybercorps-study -f ModelfileCreate or update the named configuration from your saved recipe.
ollama show --modelfile cybercorps-studyInspect the named assistant's saved recipe.
python3 study_assistant.pyRun the five capstone cases from the workspace.
launchctl setenv OLLAMA_NO_CLOUD 1Set local-only mode for a subsequent native-app launch; fully quit and reopen Ollama, then verify its startup log. Recheck after a new login or restart.
tail -n 80 ~/.ollama/logs/server.logRead recent native-app server messages, including the local-only startup verification.

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.

macOS Terminal: local /api/chat request · bash

curl --fail --show-error --max-time 120 \
  http://localhost:11434/api/chat \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gemma3:1b",
    "stream": false,
    "messages": [
      {"role": "user", "content": "Note: the workshop starts at 09:30. Using only this note, what time does it start?"}
    ]
  }'

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