[GH-ISSUE #3557] ollama create does not support the use of labels and fails #2197

Closed
opened 2026-04-12 12:26:40 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @alexconst on GitHub (Apr 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3557

What is the issue?

When running ollama create mymodel -f Modelfile ollama will fail if the FROM directive includes a label.
Example FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M

Depending if the path is absolute or relative it will print a different error:
Either

transferring model data 
pulling model 
pulling manifest 
Error: pull model manifest: 400

or

transferring model data 
pulling model 
pulling manifest 
Error: pull model manifest: file does not exist

If the label component in the filepath is removed then it works fine.

What did you expect to see?

For ollama to import the model specified in the Modelfile

Steps to reproduce

Create a Modelfile like

FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M
TEMPLATE """{{- if .System }}
<|system|>
{{ .System }}
</s>
{{- end }}
<|user|>
{{ .Prompt }}
</s>
<|assistant|>
"""
PARAMETER stop <|system|>
PARAMETER stop <|user|>
PARAMETER stop <|assistant|>
PARAMETER stop </s>

or

FROM /models/zephyr-7B-beta-GGUF/zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M
TEMPLATE """{{- if .System }}
<|system|>
{{ .System }}
</s>
{{- end }}
<|user|>
{{ .Prompt }}
</s>
<|assistant|>
"""
PARAMETER stop <|system|>
PARAMETER stop <|user|>
PARAMETER stop <|assistant|>
PARAMETER stop </s>

Are there any recent changes that introduced the issue?

No response

OS

Linux

Architecture

amd64

Platform

Docker

Ollama version

0.1.30

GPU

No response

GPU info

No response

CPU

No response

Other software

No response

Originally created by @alexconst on GitHub (Apr 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3557 ### What is the issue? When running `ollama create mymodel -f Modelfile` ollama will fail if the `FROM` directive includes a label. Example `FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M` Depending if the path is absolute or relative it will print a different error: Either ``` transferring model data pulling model pulling manifest Error: pull model manifest: 400 ``` or ``` transferring model data pulling model pulling manifest Error: pull model manifest: file does not exist ``` If the label component in the filepath is removed then it works fine. ### What did you expect to see? For ollama to import the model specified in the `Modelfile` ### Steps to reproduce Create a Modelfile like ``` FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M TEMPLATE """{{- if .System }} <|system|> {{ .System }} </s> {{- end }} <|user|> {{ .Prompt }} </s> <|assistant|> """ PARAMETER stop <|system|> PARAMETER stop <|user|> PARAMETER stop <|assistant|> PARAMETER stop </s> ``` or ``` FROM /models/zephyr-7B-beta-GGUF/zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M TEMPLATE """{{- if .System }} <|system|> {{ .System }} </s> {{- end }} <|user|> {{ .Prompt }} </s> <|assistant|> """ PARAMETER stop <|system|> PARAMETER stop <|user|> PARAMETER stop <|assistant|> PARAMETER stop </s> ``` ### Are there any recent changes that introduced the issue? _No response_ ### OS Linux ### Architecture amd64 ### Platform Docker ### Ollama version 0.1.30 ### GPU _No response_ ### GPU info _No response_ ### CPU _No response_ ### Other software _No response_
GiteaMirror added the bug label 2026-04-12 12:26:40 -05:00
Author
Owner

@KungFuFurniture commented on GitHub (Apr 22, 2024):

I am also having this issue. Any ideas?

<!-- gh-comment-id:2069911862 --> @KungFuFurniture commented on GitHub (Apr 22, 2024): I am also having this issue. Any ideas?
Author
Owner

@Isaac-maker commented on GitHub (Apr 26, 2024):

FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M

In my case it worked by removing the ". " in Linux.

FROM /zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M

On Windows I still have the 400 problem.

<!-- gh-comment-id:2078533809 --> @Isaac-maker commented on GitHub (Apr 26, 2024): FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M In my case it worked by removing the ". " in Linux. `FROM /zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M` On Windows I still have the 400 problem.
Author
Owner

@DNOSer commented on GitHub (May 9, 2024):

FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M

In my case it worked by removing the ". " in Linux.

FROM /zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M

On Windows I still have the 400 problem.

it didnt work for me where did you save the model? in the .ollama folder ?

edit : it finaly worked with the absolute path withought the dot but with the extension...
/HOME...../dolphin-2.2.1-mistral-7b.Q5_K_M.gguf

<!-- gh-comment-id:2103466006 --> @DNOSer commented on GitHub (May 9, 2024): > FROM ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M > > In my case it worked by removing the ". " in Linux. > > `FROM /zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M` > > On Windows I still have the 400 problem. it didnt work for me where did you save the model? in the .ollama folder ? edit : it finaly worked with the absolute path withought the dot but with the extension... /HOME...../dolphin-2.2.1-mistral-7b.Q5_K_M.gguf
Author
Owner

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

Hey guys, sorry about the slow response. The FROM line can take 3 different forms of input:

  1. a model name;
  2. a path to a GGUF file; or
  3. a path to a directory containing safetensor files

For the model names just use ollama ls to get a list of models which are available to reference. For the GGUF file you just need to put in an absolute or relative path to the file. e.g. ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M would mean there would need to be a file called ./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M in the directory where you're calling ollama create.

If you want to create a model w/ that tag, you can make the FROM line:

FROM ./zephyr-7b-beta.Q5_K_M.gguf

and then when called create use: ollama create zephyr-7b-beta:Q5_K_M. When you want to run that model, just type ollama run zephyr-7b-beta:Q5_K_M. I'm sorry this is confusing; I am working on some new documentation for importing models which should (hopefully) give some better examples.

I'll go ahead and close the issue, but feel free to keep commenting.

<!-- gh-comment-id:2111373981 --> @pdevine commented on GitHub (May 15, 2024): Hey guys, sorry about the slow response. The `FROM` line can take 3 different forms of input: 1. a model name; 2. a path to a GGUF file; or 3. a path to a directory containing safetensor files For the model names just use `ollama ls` to get a list of models which are available to reference. For the GGUF file you just need to put in an absolute or relative path to the file. e.g. `./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M` would mean there would need to be a file called `./zephyr-7b-beta.Q5_K_M.gguf:7b-beta.Q5_K_M` in the directory where you're calling `ollama create`. If you want to _create_ a model w/ that tag, you can make the FROM line: `FROM ./zephyr-7b-beta.Q5_K_M.gguf` and then when called create use: `ollama create zephyr-7b-beta:Q5_K_M`. When you want to run that model, just type `ollama run zephyr-7b-beta:Q5_K_M`. I'm sorry this is confusing; I am working on some new documentation for importing models which should (hopefully) give some better examples. I'll go ahead and close the issue, but feel free to keep commenting.
Author
Owner

@alexconst commented on GitHub (May 18, 2024):

@pdevine
Thanks for the clarification.

I haven't tested it yet but I guess you mean
ollama create zephyr-7b-beta:Q5_K_M -f /path/to/my/zephyr-7B-beta-GGUF/Modelfile

IMO having a LABEL directive in the Modelfile would make things clean, explicit and less error prone.

<!-- gh-comment-id:2118978975 --> @alexconst commented on GitHub (May 18, 2024): @pdevine Thanks for the clarification. I haven't tested it yet but I guess you mean `ollama create zephyr-7b-beta:Q5_K_M -f /path/to/my/zephyr-7B-beta-GGUF/Modelfile` IMO having a `LABEL` directive in the `Modelfile` would make things clean, explicit and less error prone.
Author
Owner

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

@alexconst what would the LABEL do in that case? I was thinking of adding LABEL to be able to tag additional metadata to the model which could be surfaced in the registry similar to how Docker works.

<!-- gh-comment-id:2119019364 --> @pdevine commented on GitHub (May 18, 2024): @alexconst what would the `LABEL` do in that case? I was thinking of adding `LABEL` to be able to tag additional metadata to the model which could be surfaced in the registry similar to how Docker works.
Author
Owner

@alexconst commented on GitHub (May 18, 2024):

@pdevine my idea was to allow for a Modelfile with the syntax:

FROM ./zephyr-7b-beta.Q5_K_M.gguf
LABEL 7b-beta.Q5_K_M
TEMPLATE """
...
"""
PARAMETER ...

Then you create the model ollama create zephyr -f Modelfile and it would get labeled accordingly. And ollama list would output zephyr:7b-beta-Q5_K_M 42c3337ace61 5.1 GB
This would go in line with what's visible on https://ollama.com/library/zephyr/tags

I was thinking of adding LABEL to be able to tag additional metadata to the model which could be surfaced in the registry similar to how Docker works.

Maybe we can have both?

Instead of LABEL call it TAGS? And have the Modelfile would look like

FROM ./zephyr-7b-beta.Q5_K_M.gguf
LABEL 7b-beta.Q5_K_M
TAGS foo bar

Or even all in one

FROM ./zephyr-7b-beta.Q5_K_M.gguf
TAGS 7b-beta.Q5_K_M foo bar

And in this case ollama create would do multiple tags. And ollama list would output:

zephyr:7b-beta-Q5_K_M     42c3337ace61     5.1 GB
zephyr:foo                42c3337ace61     5.1 GB
zephyr:bar                42c3337ace61     5.1 GB

Just a thought.

<!-- gh-comment-id:2119025167 --> @alexconst commented on GitHub (May 18, 2024): @pdevine my idea was to allow for a `Modelfile` with the syntax: ``` FROM ./zephyr-7b-beta.Q5_K_M.gguf LABEL 7b-beta.Q5_K_M TEMPLATE """ ... """ PARAMETER ... ``` Then you create the model `ollama create zephyr -f Modelfile` and it would get labeled accordingly. And `ollama list` would output `zephyr:7b-beta-Q5_K_M 42c3337ace61 5.1 GB` This would go in line with what's visible on https://ollama.com/library/zephyr/tags > I was thinking of adding LABEL to be able to tag additional metadata to the model which could be surfaced in the registry similar to how Docker works. Maybe we can have both? Instead of `LABEL` call it `TAGS`? And have the `Modelfile` would look like ``` FROM ./zephyr-7b-beta.Q5_K_M.gguf LABEL 7b-beta.Q5_K_M TAGS foo bar ``` Or even all in one ``` FROM ./zephyr-7b-beta.Q5_K_M.gguf TAGS 7b-beta.Q5_K_M foo bar ``` And in this case `ollama create` would do multiple tags. And `ollama list` would output: ``` zephyr:7b-beta-Q5_K_M 42c3337ace61 5.1 GB zephyr:foo 42c3337ace61 5.1 GB zephyr:bar 42c3337ace61 5.1 GB ``` Just a thought.
Author
Owner

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

@alexconst I think that would be confusing though given you can kinda already do that.

% ollama create zephyr:7b-beta-Q5_K_M # (you don't need to even specify the Modelfile if there is a file called `Modelfile`)
...
% ollama cp zephyr:7b-beta-Q5_K_M zephyr:foo

One nice quality of life thing though would be to allow you to do:

% ollama cp zephyr:7b-beta-Q5_K_M zephyr:foo zephyr:bar

I don't think that will work right now.

<!-- gh-comment-id:2119028908 --> @pdevine commented on GitHub (May 18, 2024): @alexconst I think that would be confusing though given you can kinda already do that. ``` % ollama create zephyr:7b-beta-Q5_K_M # (you don't need to even specify the Modelfile if there is a file called `Modelfile`) ... % ollama cp zephyr:7b-beta-Q5_K_M zephyr:foo ``` One nice quality of life thing though would be to allow you to do: ``` % ollama cp zephyr:7b-beta-Q5_K_M zephyr:foo zephyr:bar ``` I don't think that will work right now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2197