Quick Start

This chapter walks from the first chat to everyday process commands. The default name follows the official docs: gemma4. If the pull fails or the box is small, switch to a Library tag such as qwen2.5, a Llama-family model, or another small variant.


Open the interactive menu

In a terminal, run just:

ollama

The menu can run a model (interactive chat) and launch tools (official examples include Claude Code, OpenClaw, VS Code, and more). ollama launch or ollama launch claude --model qwen3.5 targets a specific integration. See the CLI reference and Integrations.


Pull and chat

ollama run pulls the model if it is missing, then opens a REPL:

ollama run gemma4

Cloud uses the same command shape (account on ollama.com, then ollama signin):

ollama run gemma4:cloud

Type a first message, for example: Explain why the sky is blue in one paragraph. Wrap multiline input in """. Vision models can take an image path in the same line:

ollama run gemma4 "What's in this image? /Users/you/Desktop/photo.png"

Leave the chat: /bye

At the >>> prompt:

/bye

That is the official quickstart exit. The process ends; the model may still sit in memory until keep-alive expires. Use ps / stop below.


Download without chatting

ollama pull gemma4

Useful to cache weights on CI or a slow link before scripts call the API. Remove:

ollama rm gemma4

List installed models: ollama ls

ollama ls

You get names, IDs, sizes, and modification times. Tags (:latest, :cloud, quant suffixes) are covered in Models.


List running models: ollama ps

ollama ps

Example (columns depend on your build):

NAME             ID              SIZE      PROCESSOR    CONTEXT    UNTIL
gemma4:latest    c6eb396dbd59    9.6 GB    100% GPU     131072     2 minutes from now

Watch PROCESSOR (full GPU or not) and CONTEXT. Agents and retrieval often need a larger window. Set OLLAMA_CONTEXT_LENGTH or Modelfile num_ctx—see context length.


Unload a model: ollama stop

ollama stop gemma4

Stop before loading a larger tag so two weight sets do not fight for VRAM. The API can also set keep_alive to 0 to unload immediately (REST chapter).


Background server

Desktop installs usually already run the server. Without a tray app or systemd:

ollama serve

ollama serve --help lists environment variables (bind address, model dir, debug). On Linux, prefer systemd over a leftover terminal.


Prove the API is alive

Official generate example:

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

On Windows, prefer curl.exe (PowerShell’s curl alias is not the same), or:

Invoke-RestMethod -Method Post -Uri "http://localhost:11434/api/generate" `
  -ContentType "application/json" `
  -Body '{"model":"gemma4","prompt":"Why is the sky blue?","stream":false}'

With default stream: true, curl prints NDJSON line by line. "stream": false returns one JSON object.


Day-one checklist

  1. ollama --version prints a version
  2. ollama run gemma4 (or a smaller stand-in) replies; /bye exits
  3. ollama ls lists the model; you can explain PROCESSOR on ollama ps
  4. One successful request to local /api/generate
  5. Optional: ollama run gemma4:cloud versus local

Next steps

评论