The terminal chat is the fastest way to try a model and check that everything works.
To chat with a model:
ollama run gemma4:e2bThe first time, Ollama downloads the model (several gigabytes), then opens an interactive chat with a >>> prompt. Type a message and press Enter. Model names in this course come from the official docs and will change over time; browse ollama.com/library for current ones.
Useful things inside the chat (type them at the >>> prompt):
/byeleaves the chat./clearforgets the conversation so far./set system You are a concise assistant.sets a system prompt./set parameter temperature 0.2changes a setting for this session./show infoshows details about the model./?lists all commands.- Wrap text in
"""to type several lines.
One-shot prompts run a single question and exit, which is handy in scripts:
ollama run gemma4:e2b "Summarize what a Linux kernel is in one sentence."You can also pipe a file in: cat notes.txt | ollama run gemma4:e2b "Summarize this:". For models that understand images, include an image file path in the prompt.
Flags worth knowing: --verbose prints speed statistics (tokens per second) after each answer, and --think turns on thinking mode for models that support it.
The desktop app on macOS and Windows offers the same chats in a window, with a model picker.
Example
ollama run gemma4:e2b # downloads once, then opens a chat
>>> /set system You answer in one short sentence.
>>> Why is the sky blue?
Sunlight scatters off air molecules, and blue light scatters the most.
>>> /bye
# One-shot prompt (prints the answer and exits)
ollama run gemma4:e2b "Give me three names for a cat."
# Pipe a file in, and show speed statistics
cat meeting.txt | ollama run gemma4:e2b --verbose "List the action items:"
# ... eval rate: 38.5 tokens/sRemember
ollama run MODELdownloads if needed and opens a chat- In-chat:
/bye,/clear,/set system,/set parameter,/? ollama run MODEL "prompt"for one-shot use;--verboseshows speed
Watch out for
- Assuming a model remembers earlier sessions; each new
ollama runstarts with an empty conversation.