Create a Custom Model in Ollama

From the Ollama cheat sheet ยท Modelfile ยท verified Jul 2026

Create a Custom Model

Define a Modelfile with a base model, system prompt, and parameters, then build it.

bash
# Modelfile
FROM llama3.2
SYSTEM "You are a helpful coding assistant."
PARAMETER temperature 0.7
PARAMETER num_ctx 4096

# Build the model
ollama create my-coder -f ./Modelfile
๐Ÿ’ก FROM is the only required instruction โ€” everything else is optional
โšก Use PARAMETER to tune behavior: temperature, num_ctx, top_p, repeat_penalty
๐Ÿ“Œ MESSAGE pre-seeds the conversation to set the model's behavior through examples
๐ŸŸข View any model's Modelfile with "ollama show --modelfile <model>"
modelfilecustomcreate

More Ollama tasks

Back to the full Ollama cheat sheet