TodayTools

Run models locally with Ollama flashcards

Run open AI models on your own computer.

Donate
Beginner friendly, starts from zero
Section
How to study
0
Run models locally with OllamaStart from zero · 1 of 12

What is Ollama, in one plain sentence?

Ollama is a free app that runs an AI chat , like the ones behind chat assistants, on your own computer instead of on a company's servers.

Your own AI helper, living on your laptop.

All topics

Run models locally with Ollama at a glance

Ollama is a free app that runs AI chat models on your own computer.

Online AI is eating out; Ollama is cooking at home: your data stays in your kitchen, but your stove limits the dish.

Words you will meet

Model
A big file of learned numbers that turns your text into a reply
Parameters
The learned numbers inside a model; 8b means 8 billion
Prompt
The text you give the model
Token
A small piece of text, about three quarters of a word
Context
How much text the model can keep in mind at once
Quantised
Stored with fewer digits so the model needs less memory
GPU
The graphics chip that runs models much faster
Tag
The part after the colon in a model name that picks its size or version

The steps

  1. 1. Start from zero (12 cards): What Ollama is, what a model is, and the plain words for memory, size and setup before your first chat.
  2. 2. Core basics (15 cards): Install, pull, chat, tags, memory and the local API.
  3. 3. Next steps (16 cards): REST and Python APIs, Modelfiles, context, structured output and embeddings.
  4. 4. Go deeper (17 cards): Quantisation, GGUF, tools, vision, serving, memory tuning and scaling out.
All 12 cards in Start from zero
What is Ollama, in one plain sentence?
Ollama is a free app that runs an AI chat model, like the ones behind chat assistants, on your own computer instead of on a company's servers.
What problem does Ollama solve? What was it like before?
Running an AI model yourself used to mean hunting for files, setting up Python and fixing errors for hours. Ollama makes it one command, and your words stay on your computer.
Where do you already meet something like this every day?
Chat assistants on your phone, writing help in email apps and Summarise buttons all use AI models. Ollama lets you run a similar helper at home, even with no internet.
What everyday thing is Ollama like?
Online AI is eating at a restaurant; Ollama is cooking at home. Your ingredients (your data) never leave the kitchen, but the size of your stove (your computer) limits the dish.
What are a model, its parameters and an open model?
A model is a big file of learned numbers, called parameters, that turns your text into a reply. 8b in a name means 8 billion parameters. An open model is one the maker lets anyone download.
What are a prompt, a token and the context?
A prompt is the text you give the model. Models read text in small pieces called tokens, about three quarters of a word each. The context is how much text the model can keep in mind at once.
What do RAM, CPU and GPU mean, and why do they matter here?
RAM is your computer's short-term memory, and a model must fit in it to run. The CPU is the main chip; the GPU is the graphics chip, which runs models many times faster.
What does quantised mean?
Quantised means the model's numbers are stored with fewer digits, like 4-bit instead of 16-bit. The model then needs about a quarter of the memory, with only a small drop in quality.
What are the terminal, a command and a CLI?
The terminal is a window where you type commands, short text instructions like ollama list. A CLI, a command-line interface, is a program you drive by typing commands instead of clicking.
What are a local server, localhost and an API?
Ollama runs a local server, a helper program that waits quietly in the background. localhost means your own computer, and the API is the set of web addresses other apps use to send it prompts.
What do you need, and what is your first tiny win?
A computer with 8 GB of memory and the free Ollama app. In the terminal type ollama run and a model name: it downloads the model once, then you type after >>> and get an answer.
What will you be able to do after this topic?
Pick a model that fits your computer, chat with it, use it from scripts and your own apps, shape its behaviour with a Modelfile, and keep it fast and safe.
Run models locally with Ollama cheatsheet

CLI

  • ollama run qwen3:8b Chat, pulling the model if needed
  • ollama run gemma3:4b "prompt" One-off answer, then exit
  • ollama pull / rm / cp Download, delete, copy a model
  • ollama list Installed models and sizes
  • ollama ps Loaded models, GPU/CPU split
  • ollama stop qwen3:8b Unload from memory now
  • ollama show qwen3:8b --modelfile Print the recipe
  • ollama create name -f Modelfile Build a custom model

In the chat prompt

  • /set parameter num_ctx 8192 Change a setting for this session
  • /set system "..." Replace the system prompt
  • /show info Model details
  • /clear Forget the conversation
  • /save my-model Save session as a model
  • """ ... """ Multi-line input
  • /bye Exit

Modelfile

  • FROM qwen3:8b Base model, tag or .gguf path
  • SYSTEM """...""" Fixed instructions
  • PARAMETER temperature 0.2 Default sampling
  • PARAMETER num_ctx 8192 Context size
  • PARAMETER stop "<|im_end|>" Stop sequence
  • TEMPLATE """...""" Chat format (Go template)
  • ADAPTER ./lora.gguf Apply a LoRA adapter

REST API (port 11434)

  • POST /api/chat Chat with a messages list
  • POST /api/generate Single prompt completion
  • POST /api/embed Embeddings for one or many inputs
  • GET /api/tags Installed models
  • GET /api/ps Loaded models
  • /v1/chat/completions OpenAI-compatible endpoint
  • format, think, keep_alive Schema output, reasoning, memory time

Server environment

  • OLLAMA_HOST=0.0.0.0:11434 Listen on all interfaces
  • OLLAMA_ORIGINS Allowed browser origins (CORS)
  • OLLAMA_CONTEXT_LENGTH Default context size
  • OLLAMA_KEEP_ALIVE=30m How long models stay loaded
  • OLLAMA_NUM_PARALLEL Parallel requests per model
  • OLLAMA_FLASH_ATTENTION=1 Less attention memory
  • OLLAMA_KV_CACHE_TYPE=q8_0 Half-size KV cache
  • OLLAMA_MODELS Model storage folder
Donate