Ollama Modelfile – explained simply
A Modelfile is a small text file that you use in Ollama to create your own model variant with fixed settings.
Also: Modelfile, ollama create
A Modelfile works like a recipe: the FROM line specifies the base model, which can be a model name, a Safetensors folder, or a GGUF file. With PARAMETER, you set values like temperature or num_ctx (context length), and with SYSTEM, a fixed system prompt. TEMPLATE defines how the conversation history and input are passed to the model, and MESSAGE adds example dialogues.
The file is saved under the name Modelfile. With ollama create myname -f ./Modelfile, you create a new model from it, which you then start with ollama run myname. If the Modelfile is based on an existing Ollama model, the weights are not copied; only the configuration is new. With a GGUF file or a Safetensors folder, Ollama imports the weights into its model folder; this uses additional storage space.
What does that mean for you? With a Modelfile, for example, you can build an assistant that always replies in German and gets more context.