Gen AIJuly 4, 2025

A print-friendly, interactive Ollama cheat sheet covering commands and advanced tips, built as a quick reference for anyone running local LLMs.

Model Management

ollama pull <model_name>

Downloads a model from the Ollama library.

Example:

ollama pull llama3
ollama list

Lists all models that you have downloaded.

Example:

ollama list
ollama rm <model_name>

Deletes a model from your local machine.

Example:

ollama rm llama3
ollama cp <source_model> <new_name>

Creates a copy of a model.

Example:

ollama cp llama3 my-llama3-copy

Running Models

ollama run <model_name>

Starts a conversation with a model.

Example:

ollama run llama3
ollama run <model_name> "Your prompt"

Runs a model with a single prompt and exits.

Example:

ollama run llama3 "What is the capital of France?"
/set verbose

Inside a chat, toggles verbose mode to see more details.

Example:

/set verbose
/show info

Inside a chat, shows information about the current model.

Example:

/show info

Modelfile Commands

ollama create <model_name> -f ./Modelfile

Creates a model from a Modelfile.

Example:

ollama create my-custom-model -f ./Modelfile
FROM <base_model>

(In Modelfile) Specifies the base model to use.

Example:

FROM llama3
PARAMETER <name> <value>

(In Modelfile) Sets a parameter for the model.

Example:

PARAMETER temperature 0.7
SYSTEM """..."""

(In Modelfile) Sets a system-level message.

Example:

SYSTEM """You are a helpful AI assistant."""

API & Server

ollama serve

Starts the Ollama server. It usually runs in the background.

Example:

ollama serve
curl http://localhost:11434/api/generate -d '{ ... }'

Use the API to generate a response. (Check docs for JSON).

Example:

curl http://localhost:11434/api/generate -d '{ "model": "llama3", "prompt": "Why is the sky blue?" }'
curl http://localhost:11434/api/tags

Fetches the list of local models via the API.

Example:

curl http://localhost:11434/api/tags

Advanced Tips & Useful Tools

Tool Calling / Internet Access

Models can't access the internet directly. Use "Tool Calling" with a library like ollama-python to have the model request external data (e.g., search results), which your code provides.

Example:

// Your Python code detects this request from the model // then calls a search API and feeds results back in.
Open WebUI (Docker)

A powerful, self-hosted web UI for Ollama. Supports RAG, multi-model chat, and more. Run with Docker for an easy setup.

Example:

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
Important Websites

Official resources for documentation, updates, community tools, and SOPHIE's Daddy Blog.

Comments

Educational Disclaimer

This content is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Always conduct your own research and consult a qualified financial professional before making investment decisions.