Here is a comprehensive Ollama cheat sheet containing most often used commands and explanations:
curl -fsSL https://ollama.com/install.sh | sh
Download Ollama for Windows
curl -fsSL https://ollama.com/install.sh | sh
Use the official image available at ollama/ollama on Docker Hub.
Start Ollama:
ollama serve
Run a specific model:
ollama run <model_name>
List available models:
ollama list
Pull a model:
ollama pull <model_name>
Create a model:
ollama create <model_name> -f <model_file>
Remove a model:
ollama rm <model_name>
Copy a model:
ollama cp <source_model> <new_model>
Use multimodal input by wrapping multiline text in triple quotes (""") and specifying image paths directly in the prompt.
Generate a response:
curl http://localhost:11434/api/generate -d '{"model": "<model_name>", "prompt": "<prompt>"}'
Chat with a model:
curl http://localhost:11434/api/chat -d '{"model": "<model_name>", "messages": [{"role": "user", "content": "<message>"}]}'
Start Ollama:
ollama serve
Run a model:
ollama run <model_name>
- ai_review: Code review & suggestions
- ai_commit: Commit message generator
- ai_readme: README generator
- ai_pr: PR review generator
- Lobe Chat: Modern LLM chat framework
- LangChain: Java LangChain implementation
- AI Vtuber: Virtual YouTuber with Ollama
- VS Code AI Completion: Code completion plugin
GPU Support:
podman run --rm --device nvidia.com/gpu=all --security-opt=label=disable ubuntu nvidia-smi -L
OpenShift:
oc new-project darmstadt-workshop
oc apply -f deployments/ollama.yaml
Debugging:
oc run mycurl --image=curlimages/curl -it -- sh
- Streamlit: Build Ollama web apps
- Podman: Container management
- CDI Spec Generator: GPU support tool