Feedback

Chat Icon

Local AI Engineering with Ollama

Run, understand, customize, fine-tune, and build agentic apps on your own hardware

Building, Running, and Sharing Custom Models for Ollama (Modelfile)
57%

Step 1: Put the Model under Your Own Name

The only required instruction is FROM. It names the base model your new model is built on. Create a file called Modelfile with two lines:

cat < $HOME/commitwriter/Modelfile
# commitwriter - turns a code change into a commit message
FROM granite4.1:3b
EOF

The # line is a comment. Ollama ignores it. The FROM line points at a model you already have on disk.

Now build it. The create command takes the name you want, and the -f flag points at your file:

ollama create commitwriter -f Modelfile

Local AI Engineering with Ollama

Run, understand, customize, fine-tune, and build agentic apps on your own hardware

Enroll now to unlock all content and receive all future updates for free.