Error: no Modelfile or safetensors files found — ollama create was run without -f, so it looked in the current folder for a file named exactly Modelfile and did not find one. Either run the command in the folder that holds the file, point at it with -f, or rename it so the name has no extension.

On Windows the usual culprit is a file saved by Notepad as Modelfile.txt. Explorer hides the extension, so the folder looks right, but Ollama only looks for Modelfile. ollama create tutor -f Modelfile.txt works at once.

The error

PS> Get-ChildItem -Name   (folder mf\txt)
Modelfile.txt
PS> ollama create tutor
gathering model components
Error: no Modelfile or safetensors files found
exit code: 1

An empty folder gives exactly the same message:

PS> ollama create tutor
gathering model components
Error: no Modelfile or safetensors files found

Why it happens

ollama create has two ways to find what to build. With -f it reads the file you name. Without it, it looks in the current folder for a file named Modelfile or for safetensors weights, as the message says. When neither is there it stops with this message, and the only line before it is gathering model components.

Three situations lead here: the terminal is in a different folder from the file (a new terminal often opens in your home folder), the file has an extension (Modelfile.txt in the test), or you meant to import safetensors weights from a folder that does not contain them. The message does not tell the three apart, so list the folder first.

The fix

PS> ollama create tutor -f Modelfile.txt
gathering model components
using existing layer sha256:c5396e06af294bd101b30dce59131a76d2b773e76950acc870eda801d3ab0515
using existing layer sha256:eb4402837c7829a690fa845de4d7f3fd842c2adee476d5341da8a46ea9255175
using existing layer sha256:832dd9e00a68dd83b3c3fb9f5588dad7dcf337a0db50f7d9483f310cd292e92e
creating new layer sha256:03245d6ea33bec1ad1df0cfdcf471447659c624c1b0ae91dfe0ae0773e81e3a9
writing manifest
success
exit code: 0

Naming the file with -f is the most explicit fix and works with any file name or path. The alternative is to rename the file so the default lookup finds it; after Rename-Item Modelfile.txt Modelfile a plain ollama create tutor2 succeeded in the same folder. In a script, always pass -f with a full path, so the command does not depend on the folder it happens to run in.

How it was reproduced

Ollama 0.40.14 on Windows 11, against a separate test server started with ollama serve on 127.0.0.1:15190 with its own models folder, and qwen2.5:0.5b pulled into it. The Modelfile had two lines, FROM qwen2.5:0.5b and a SYSTEM prompt for a maths tutor. The model names tutor and tutor2 are the test's own. The command failed in an empty folder and in a folder holding only Modelfile.txt, then succeeded with -f and again after the rename.

Frequently asked

Why does ollama create say no Modelfile or safetensors files found?
Without -f, ollama create looks in the current folder for a file named exactly Modelfile, or for safetensors weights. Neither was there: the terminal is in another folder or the file has an extension such as .txt.
Does an Ollama Modelfile need a file extension?
No. The default name is Modelfile with no extension. Any other name works too, as long as you pass it with -f, for example ollama create tutor -f Modelfile.txt.
How do I point ollama create at a Modelfile in another folder?
Pass the path with -f, for example ollama create tutor -f C:\models\tutor\Modelfile. A relative FROM path inside the file is then read relative to the Modelfile's own folder.

More decoded errors in the Fixes category. If the Modelfile is found but its FROM line points at a path that does not exist, see 'invalid model name' from a Modelfile FROM path.