Mac tip: create a custom Ollama model with a Modelfile

MacBook Pro lifestyle podcast scene from Apple Newsroom
Ready, click the button in the top right corner to generate summary
AI thinking...

Ollama can bake a custom assistant from a short text file. That file is a Modelfile. You pick a base model with FROM, set a SYSTEM message, add PARAMETER lines for temperature or num_ctx, then run ollama create. After that, ollama run opens the new name like any other local model.

This tip assumes Ollama is already on the Mac and at least one base model is pulled. Fresh install steps live in our Ollama on Apple silicon guide. If you only need the raw OpenAI-style HTTP port for other apps, see the earlier Ollama OpenAI-compatible API note. Here the goal is a named custom model you can reuse.

Write the Modelfile

Create a plain text file. Name it Modelfile with no extension, or use any path and pass it later with -f. Official docs show a basic blueprint like this:

FROM llama3.2
PARAMETER temperature 1
PARAMETER num_ctx 4096
SYSTEM You are Mario from super mario bros, acting as an assistant.

FROM is required. It names a model already in your local library, for example llama3.2 after a pull. SYSTEM sets the assistant behavior that lands in the prompt template. PARAMETER lines pin runtime knobs. Docs list temperature (default 0.8) and num_ctx (default 2048) among the valid keys. Raise temperature for freer answers. Raise num_ctx when you need a wider context window.

Comments start with #. Instruction names are not case sensitive. Keep SYSTEM short and specific so the model stays on task.

macOS 27 Write with Siri from Apple Newsroom

ollama create and run

In Terminal, change to the folder that holds the Modelfile. Create the custom model:

ollama create my-assistant -f Modelfile

Replace my-assistant with any short name you want. The -f flag points at the Modelfile path. When the create step finishes, start a chat:

ollama run my-assistant

You should see the SYSTEM behavior on the first replies. Exit the session the usual way for your Ollama CLI. The custom name also appears in ollama list with the base models.

For a browser chat layer on top of the same Ollama server, the Open WebUI with Ollama tip covers Docker and the Python serve path. For a desktop app that exposes its own local API, use the LM Studio OpenAI-compatible API walkthrough instead.

MacBook Pro Liquid Retina XDR display from Apple Newsroom

Check the baked-in Modelfile

To inspect what Ollama stored for a model, use show with the modelfile flag:

ollama show --modelfile my-assistant

Official docs also demonstrate ollama show --modelfile llama3.2 on a stock model. The printed output may expand FROM to a local blob path and include TEMPLATE plus stop PARAMETER lines. That is normal. To build a new Modelfile from it, copy the useful SYSTEM and PARAMETER bits, then set FROM back to a library name or tag rather than a blob path.

Tweak temperature or the SYSTEM line in your text file, run ollama create again with the same name, and the custom model updates. No need to invent new CLI labels beyond what the Modelfile reference documents.

Photo: Apple

Source: Ollama Modelfile Reference (docs.ollama.com/modelfile); Apple Newsroom (MacBook Pro lifestyle podcast, macOS 27 Write with Siri, MacBook Pro Liquid Retina XDR display)

Previous Article iPhone fix: Personal Hotspot not working on iOS 27