Tools

Ollama Modelfile generator

Build an Ollama Modelfile — base model, system prompt, sampling parameters, stop sequences — plus the ollama create command.

Runs in your browserAI developer tools181.1K
Free

Result

The result will appear here.

A Modelfile is how Ollama turns a downloaded model into your own named variant: a fixed system prompt, a longer context window, a lower temperature for code review, extra stop sequences for a model whose template leaks. The format is small but strict about a few things — FROM is required, several stop sequences need one PARAMETER line each, and multi-line text must sit inside triple quotes. This generator writes the file to the reference in ollama/ollama's docs and prints the command that builds it, so you can go from idea to ollama run in two steps.

How it works

  • Parameters left on Model default are not written, so the base model's own settings apply instead of a value you never chose.
  • The system prompt and an optional TEMPLATE are wrapped in triple quotes; input containing three double quotes in a row is refused because it would end the block early.
  • The first two lines are Modelfile comments holding the exact ollama create and ollama run commands for the name you chose.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.

What it costs

This tool is free, with no sign-in and no points.

Common questions

Why does my model forget things after a few thousand tokens?
Because num_ctx, not the model's advertised context length, decides how much Ollama keeps. Left unset, Ollama picks a default from your GPU memory — 4k tokens below 24 GiB of VRAM, 32k up to 48 GiB, 256k above — according to its context-length docs, while the Modelfile reference table still shows the older 2048. Set num_ctx explicitly — 16384 or 32768 for code work — and remember that a larger window uses more memory for the KV cache, so a model that fitted on your GPU may start spilling to the CPU.
Do I need to write a TEMPLATE?
Usually not. Models pulled from the Ollama library already carry the right chat template, and FROM inherits it. Write one only when you import a raw GGUF or safetensors model that has none. Run ollama show --modelfile on a library model to see the template it uses, in Go template syntax with .System, .Prompt and .Response.
How do I apply the file?
Save the output as a file named Modelfile, run ollama create with the name you chose and -f Modelfile, then ollama run that name. Re-running create with the same name replaces the variant; the base model's weights are shared rather than copied, so a variant costs almost no disk space.

The open-source behind it

This tool is a self-contained implementation. ollama/ollama (MIT) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.

ollama/ollama

Also known as

  • ollama modelfile
  • modelfile generator
  • ollama create
  • ollama system prompt
  • ollama num_ctx
  • ollama parameters