liveBook · Manning

Modelfile

A Modelfile is Ollama’s declarative configuration file for specifying a model’s base, prompts, parameters, and other settings.

How 2 Manning books explain it

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
Packages a base model, prompts, and parameters as a reusable named Ollama model.
How deep it goes
Defines required and optional instructions, then walks through creating and running custom models, including registration of exported GGUF models.
Examples
Uses a study buddy, a pirate tutor, a code reviewer, and an exported fine-tuned model as examples.
What you can do after
Apply it via Ollama to create, run, and test a named custom model.

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 how Ollama deploys a converted custom model for local inference.
How deep it goes
Defines the FROM, TEMPLATE, and PARAMETER directives and their roles without detailing their implementation.
Examples
Uses a StarCoder2 code-generation model with a 4096-token context, an instruction template, and stop sequences.
What you can do after
Configure a converted GGUF model for Ollama by specifying its template and generation parameters.

Read how Domain-Specific Small Language Models explains Modelfile →

What to know first

Related concepts

Questions about Modelfile

What is Modelfile?

A Modelfile is Ollama’s declarative configuration file for specifying a model’s base, prompts, parameters, and other settings.

Which Manning books explain Modelfile?

Build Applications with Local AI Models on a Mac and Domain-Specific Small Language Models.

What should I know before learning Modelfile?

Manning books that teach Modelfile usually introduce sensitive information first.

What is Modelfile a kind of?

Modelfile is a kind of configuration file. A configuration file is a file containing settings that software reads to determine how an application, system, or component operates.

What are the parts of Modelfile?

Modelfile includes FROM instruction.

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.