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
| Command | Use it to… |
|---|---|
ollama --version | Record the installed client version and any warning. |
python3 --version | Confirm Python 3 is available for the API client and capstone. |
mkdir -p ~/CyberCorps/open-weight-models | Create the project folder if needed. |
cd ~/CyberCorps/open-weight-models | Enter the workspace in each Terminal window used for project files. |
ollama list | Check the local service and its downloaded model inventory. |
ollama pull gemma3:1b | Download the exact course model after checking its terms and requirements. |
ollama run gemma3:1b | Start a local chat; type /bye inside the chat to return to Terminal. |
ollama show gemma3:1b | Inspect the model's details. |
ollama ps | Inspect currently loaded models and processor allocation. |
ollama stop gemma3:1b | Unload the model while keeping its downloaded copy. |
ollama rm gemma3:1b | Optional cleanup: delete this local model copy; a later use may require another download. |
python3 local_chat.py | Run the saved API client from the workspace. |
ollama create cybercorps-study -f Modelfile | Create or update the named configuration from your saved recipe. |
ollama show --modelfile cybercorps-study | Inspect the named assistant's saved recipe. |
python3 study_assistant.py | Run the five capstone cases from the workspace. |
launchctl setenv OLLAMA_NO_CLOUD 1 | Set 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.log | Read 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
- Ollama CLI reference
- Ollama chat API
- Ollama Modelfile reference
- The course model: Gemma 3 1B
- Ollama: macOS installation and requirements
- Python: using Python on macOS
- Python: official macOS installers
- Apple: TextEdit settings and plain-text files
- Apple: memory use in Activity Monitor
- Ollama: server environment and local-only mode
- Ollama: troubleshooting and server logs