Modelfile
A Modelfile is Ollama’s declarative configuration file for specifying a model’s base, prompts, parameters, and other settings.
Build Applications with Local AI Models on a Mac
A Modelfile is Ollama's declarative file format for specifying the base model, prompts, parameters, and other settings of a custom model.
- How it is used
- Bundles a base model, system prompt, and parameters into a reusable Ollama model that can be run by name.
- How deep it goes
- Works through required and optional instructions, then shows creation and running commands; defers prompt-template customization as advanced.
- Examples
- Uses study-assistant, pirate-tutor, and code-reviewer configurations, plus Ollama commands to create and run named models.
- What you can do after
- Build it from scratch with a plain-text Modelfile, then create and run the named model using Ollama.
Read how Build Applications with Local AI Models on a Mac explains Modelfile →
Domain-Specific Small Language Models
An Ollama configuration file that specifies how to package and serve a converted model, including template and generation parameters.
- How it is used
- Defines the packaging and serving settings for a converted Ollama model.
- How deep it goes
- Defines the core commands and parameters, but stops short of full syntax coverage or broader model conversion details.
- Examples
- Uses a StarCoder2 GGUF conversion, a sample Modelfile, and ollama create/run commands.
- What you can do after
- Operate a converted model locally by packaging it with templates, stop tokens, and generation parameters.
Read how Domain-Specific Small Language Models explains Modelfile →
Related concepts
- custom modelproduces · A custom model is a machine-learning model trained, adapted, or configured for a particular domain, task, or set of requirements.
- GGUFconfigures · GGUF is a binary file format for storing machine-learning model tensors and associated metadata, designed to support efficient model loading and inference.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

