[GH-ISSUE #4676] Ollama create test -f ./Modelfile error ==> Error: command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message" #49452

Closed
opened 2026-04-28 11:52:00 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @farmountain on GitHub (May 28, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4676

What is the issue?

Ollama create test -f ./Modelfile error ==> Error: command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message"

same Modelfile works in version 0.1,33, but the above error occurs in version 0.1.38

0.1.33
image

0.1.38
image

OS: Ubuntu 22.04.2 LTS

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.38

Originally created by @farmountain on GitHub (May 28, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4676 ### What is the issue? Ollama create test -f ./Modelfile error ==> Error: command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message" same Modelfile works in version 0.1,33, but the above error occurs in version 0.1.38 0.1.33 ![image](https://github.com/ollama/ollama/assets/478847/27eff46d-3715-4d4c-9fd6-07608f9acb00) 0.1.38 ![image](https://github.com/ollama/ollama/assets/478847/01430657-ae41-488d-99d9-56fa224acf87) OS: Ubuntu 22.04.2 LTS ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.38
GiteaMirror added the needs more infobug labels 2026-04-28 11:52:00 -05:00
Author
Owner

@DragonAngel commented on GitHub (May 28, 2024):

in my case was a missing space in Modelfile, check if you have any missing space in Modelfile like SYSTEM"""You are instead of SYSTEM """You are

<!-- gh-comment-id:2135200908 --> @DragonAngel commented on GitHub (May 28, 2024): in my case was a missing space in Modelfile, check if you have any missing space in Modelfile like SYSTEM"""You are instead of SYSTEM """You are
Author
Owner

@pdevine commented on GitHub (May 28, 2024):

@farmountain can you post the modelfile?

<!-- gh-comment-id:2136044713 --> @pdevine commented on GitHub (May 28, 2024): @farmountain can you post the modelfile?
Author
Owner

@farmountain commented on GitHub (May 31, 2024):

weird, it works if I paste the prompt into Modelfile 1 by 1...

<!-- gh-comment-id:2141208518 --> @farmountain commented on GitHub (May 31, 2024): weird, it works if I paste the prompt into Modelfile 1 by 1...
Author
Owner

@farmountain commented on GitHub (May 31, 2024):

lets close this for now until I have clearer understand of the error. Thanks

<!-- gh-comment-id:2141209402 --> @farmountain commented on GitHub (May 31, 2024): lets close this for now until I have clearer understand of the error. Thanks
Author
Owner

@ajcookservices commented on GitHub (Jun 4, 2024):

Hi, I have this problem too.

<!-- gh-comment-id:2148323859 --> @ajcookservices commented on GitHub (Jun 4, 2024): Hi, I have this problem too.
Author
Owner

@pdevine commented on GitHub (Jun 4, 2024):

@ajcookservices what version of Ollama?

<!-- gh-comment-id:2148329393 --> @pdevine commented on GitHub (Jun 4, 2024): @ajcookservices what version of Ollama?
Author
Owner

@ZhangChi7 commented on GitHub (Oct 29, 2024):

My situation is that the first line in the generated Modelfile is "failed to get console mode for stdout: The handle is invalid." Deleting this line and then executing the command to create a new model works.

<!-- gh-comment-id:2443959252 --> @ZhangChi7 commented on GitHub (Oct 29, 2024): My situation is that the first line in the generated Modelfile is "failed to get console mode for stdout: The handle is invalid." Deleting this line and then executing the command to create a new model works.
Author
Owner

@pdevine commented on GitHub (Oct 29, 2024):

@ZhangChi7 That sounds like a Windows issue. How did you create the file?

<!-- gh-comment-id:2444931978 --> @pdevine commented on GitHub (Oct 29, 2024): @ZhangChi7 That sounds like a Windows issue. How did you create the file?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#49452