{"error":"neither 'from' or 'files' was specified"} from Ollama's /api/create means the body had neither a from nor a files field; in the test it carried a whole Modelfile in a modelfile field instead (a body with only model got the same 400). Ollama 0.40.14 answered that with 400; it took the same model when the Modelfile lines were sent as JSON fields: from, system and parameters.

Move each Modelfile instruction into its own field: FROM becomes "from", SYSTEM becomes "system", and the PARAMETER lines become an object under "parameters".

The error

The body file create-old.json, then the request:

{"model":"fix9-helper","modelfile":"FROM qwen2.5:0.5b\nSYSTEM You answer in one short sentence.\nPARAMETER temperature 0.2","stream":false}
PS> curl.exe -s -i -d "@create-old.json" http://127.0.0.1:15191/api/create
HTTP/1.1 400 Bad Request
Content-Type: application/json
Date: Tue, 10 Nov 2026 03:26:22 GMT
Content-Length: 51

{"error":"neither 'from' or 'files' was specified"}

Why it happens

The body has a model name and a modelfile string, but no from and no files. The error names exactly those two fields, and the Modelfile text inside modelfile did not count as either: its FROM line was in the body and the server still reported that no from was specified.

The command line took the same three lines from a file. With OLLAMA_HOST pointing at the same test server, ollama create fix9-helper2 -f Modelfile printed writing manifest and success, and ollama rm fix9-helper2 printed deleted 'fix9-helper2'. So a Modelfile on disk still works from the terminal; only the JSON body needs separate fields.

The fix

{"model":"fix9-helper","from":"qwen2.5:0.5b","system":"You answer in one short sentence.","parameters":{"temperature":0.2},"stream":false}
PS> curl.exe -s -i -d "@create-new.json" http://127.0.0.1:15191/api/create
HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 10 Nov 2026 03:26:22 GMT
Content-Length: 20

{"status":"success"}

To confirm the fields landed, /api/show on the new model returned, among much else, "system":"You answer in one short sentence." and "parameters":"temperature 0.2". Note that parameters is a JSON object in the create request (a number stays a number) and comes back from /api/show as Modelfile-style text. The test model was then removed with curl.exe -s -i -X DELETE -d "@del.json" http://127.0.0.1:15191/api/delete (body {"model":"fix9-helper"}), which answered HTTP/1.1 200 OK, and /api/tags no longer listed it.

How it was reproduced

Ollama 0.40.14 (ollama --version) on Windows 11, run as a separate ollama serve on 127.0.0.1:15191 with its own models folder and qwen2.5:0.5b as the base model. Both create requests went through curl.exe from Windows PowerShell 5.1 with ASCII body files, one second apart, against the same server; fix9-helper is this test's own model name.

Frequently asked

How do I create an Ollama model with the API?
POST to /api/create with model, from, and optionally system and parameters as JSON fields, for example {"model":"fix9-helper","from":"qwen2.5:0.5b","system":"You answer in one short sentence.","parameters":{"temperature":0.2}}. Ollama 0.40.14 answered status success.
Why does /api/create say neither 'from' or 'files' was specified?
The body has no from field and no files field. A modelfile string with a FROM line inside it was refused with this 400 by Ollama 0.40.14.
Can I still send a Modelfile to the Ollama API?
Not as a modelfile string in the test: Ollama 0.40.14 refused it. Split the Modelfile into the from, system and parameters fields, or use ollama create -f Modelfile on the command line.

More decoded errors in the Fixes category. For a Modelfile on disk that the command line refuses, see 'command must be one of'.