An assistant's tone and response style often need to stay consistent across separate conversations. A custom Ollama model stores those instructions with a base model so callers can reuse the behavior by name.
A Modelfile combines an existing model with a system message and generation settings. These customizations reuse the base weights; they do not train or fine-tune the model.
Ollama must already be running, with enough memory for the base model and its context. A local custom name stays available for later CLI or API requests, and creating it does not publish it to a registry.
Steps to create a custom Ollama model:
- Check that qwen2.5:0.5b is installed on the Ollama server.
$ ollama list NAME ID SIZE MODIFIED qwen2.5:0.5b 6467b5fd1dd4 397 MB 42 seconds ago
If the base model is absent, it needs to be downloaded before continuing. A connection error means the CLI cannot reach the server.
Related: How to pull an Ollama model
Related: How to start the Ollama server - Save the custom assistant settings in a file named Modelfile.
- Modelfile
FROM qwen2.5:0.5b SYSTEM You are a support assistant. Answer in one short sentence using plain English. PARAMETER temperature 0
FROM selects the installed base model, SYSTEM supplies its standing instruction, and temperature 0 reduces sampling variation. A system message guides responses but does not guarantee that every answer follows it.
- Build example/support-assistant from the Modelfile.
If this name already exists, creating it again replaces its saved configuration. A different unused name preserves the previous custom model.
$ ollama create example/support-assistant -f Modelfile
The -f value points to the Modelfile; a file outside the current directory needs its path. A completed build ends with success.
- Inspect the custom model's saved system message.
$ ollama show example/support-assistant --system You are a support assistant. Answer in one short sentence using plain English.
- Confirm that the custom model stores the temperature setting.
$ ollama show example/support-assistant --parameters temperature 0
- Run the custom model with an arithmetic question.
$ ollama run example/support-assistant "What is 17 plus 25? Answer in one short sentence." The sum of 17 and 25 is 42.
The answer should give 42; wording can vary even with a low temperature.
- Test the same custom name with a different question.
$ ollama run example/support-assistant "What is the capital of Canada?" The capital of Canada is Ottawa.
A reply naming Ottawa shows that the saved model can answer another prompt. The custom name remains installed for subsequent requests.