Ollama cheatsheet
Ollama: Running models
12 common Ollama tasks.
Chat with a model
Start an interactive chat. The model is downloaded first if needed. Type /bye to leave.
ollama run llama3.2
Ask a single question
Answer one prompt and exit, which suits scripts.
ollama run llama3.2 "Explain recursion in one sentence."
Summarize a file
Pass the contents of a file inside the prompt.
ollama run llama3.2 "Summarize this: $(cat notes.txt)"
Ask about an image
Use a multimodal model and give the path to an image in the prompt.
ollama run llava "Describe this image: ./photo.png"
Delete a model
Remove a model from disk.
ollama rm llama3.2
Caution: The model has to be downloaded again to use it. Large models take a long time.