[GH-ISSUE #946] ollama show --modelfile gives incorrect FROM when multiple tags of base model are downloaded. #62501

Closed
opened 2026-05-03 09:14:26 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @easp on GitHub (Oct 29, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/946

I've pulled two tags for codellama and created two new models, one based on each.

% ollama list 
NAME                               	ID          	SIZE  	MODIFIED       
[...]
codellama:13b                      	9f438cb9cd58	7.4 GB	27 hours ago  	
codellama:13b-16k                  	e86141f13814	7.4 GB	45 hours ago  	
codellama:34b-16k                  	be95e5b84e7f	16 GB 	41 seconds ago	
codellama:34b-instruct-q3_K_M      	f534f618ea64	16 GB 	27 hours ago  	
[...]

Note the file sizes; it's clear that ollama isn't confused about which data file to use for which.

However, if I ollama show --modelfile, the FROM just lists the base model name, not the tag.

% ollama show codellama:13b-16k --modelfile
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this one, replace the FROM line with:
# FROM codellama:13b-16k

FROM library/codellama
TEMPLATE """[INST] <<SYS>>{{ .System }}<</SYS>>

{{ .Prompt }} [/INST]
"""
PARAMETER num_ctx 16384
PARAMETER rope_frequency_base 1e+06
PARAMETER stop "[INST]"
PARAMETER stop "[/INST]"
PARAMETER stop "<<SYS>>"
PARAMETER stop "<</SYS>>"

% ollama show codellama:34b-16k --modelfile
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this one, replace the FROM line with:
# FROM codellama:34b-16k

FROM library/codellama
TEMPLATE """[INST] <<SYS>>{{ .System }}<</SYS>>

{{ .Prompt }} [/INST]
"""
PARAMETER num_ctx 16384
PARAMETER num_gqa 8
PARAMETER rope_frequency_base 1e+06
PARAMETER stop "[INST]"
PARAMETER stop "[/INST]"
PARAMETER stop "<<SYS>>"
PARAMETER stop "<</SYS>>"
Originally created by @easp on GitHub (Oct 29, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/946 I've pulled two tags for codellama and created two new models, one based on each. ``` % ollama list NAME ID SIZE MODIFIED [...] codellama:13b 9f438cb9cd58 7.4 GB 27 hours ago codellama:13b-16k e86141f13814 7.4 GB 45 hours ago codellama:34b-16k be95e5b84e7f 16 GB 41 seconds ago codellama:34b-instruct-q3_K_M f534f618ea64 16 GB 27 hours ago [...] ``` Note the file sizes; it's clear that ollama isn't confused about which data file to use for which. However, if I `ollama show --modelfile`, the FROM just lists the base model name, not the tag. ``` % ollama show codellama:13b-16k --modelfile # Modelfile generated by "ollama show" # To build a new Modelfile based on this one, replace the FROM line with: # FROM codellama:13b-16k FROM library/codellama TEMPLATE """[INST] <<SYS>>{{ .System }}<</SYS>> {{ .Prompt }} [/INST] """ PARAMETER num_ctx 16384 PARAMETER rope_frequency_base 1e+06 PARAMETER stop "[INST]" PARAMETER stop "[/INST]" PARAMETER stop "<<SYS>>" PARAMETER stop "<</SYS>>" % ollama show codellama:34b-16k --modelfile # Modelfile generated by "ollama show" # To build a new Modelfile based on this one, replace the FROM line with: # FROM codellama:34b-16k FROM library/codellama TEMPLATE """[INST] <<SYS>>{{ .System }}<</SYS>> {{ .Prompt }} [/INST] """ PARAMETER num_ctx 16384 PARAMETER num_gqa 8 PARAMETER rope_frequency_base 1e+06 PARAMETER stop "[INST]" PARAMETER stop "[/INST]" PARAMETER stop "<<SYS>>" PARAMETER stop "<</SYS>>" ```
GiteaMirror added the good first issuebug labels 2026-05-03 09:14:28 -05:00
Author
Owner

@technovangelist commented on GitHub (Oct 30, 2023):

oooo, that’s a good one. Thanks so much for submitting this.

<!-- gh-comment-id:1784317747 --> @technovangelist commented on GitHub (Oct 30, 2023): oooo, that’s a good one. Thanks so much for submitting this.
Author
Owner

@aashish2057 commented on GitHub (Nov 3, 2023):

I can try this one

<!-- gh-comment-id:1793231560 --> @aashish2057 commented on GitHub (Nov 3, 2023): I can try this one
Author
Owner

@aashish2057 commented on GitHub (Nov 3, 2023):

Is this bug still happening? Maybe I am confused when I run ollama show llama2 --modelfile the from line has the tag FROM llama2:latest?

<!-- gh-comment-id:1793235868 --> @aashish2057 commented on GitHub (Nov 3, 2023): Is this bug still happening? Maybe I am confused when I run `ollama show llama2 --modelfile` the from line has the tag `FROM llama2:latest`?
Author
Owner

@murthy95 commented on GitHub (Nov 6, 2023):

@technovangelist
Current FROM is set to model.OriginalModel if it exists defaulting to model.ModelPath
In comments it is set to model.ShortName so I think it should be set to model.ShortName everywhere.

<!-- gh-comment-id:1794615876 --> @murthy95 commented on GitHub (Nov 6, 2023): @technovangelist Current FROM is set to model.OriginalModel if it exists defaulting to model.ModelPath In comments it is set to model.ShortName so I think it should be set to model.ShortName everywhere.
Author
Owner

@dansreis commented on GitHub (Nov 13, 2023):

@technovangelist
Could you please take a look and check if we can close this issue?

<!-- gh-comment-id:1808671241 --> @dansreis commented on GitHub (Nov 13, 2023): @technovangelist Could you please take a look and check if we can close this issue?
Author
Owner

@technovangelist commented on GitHub (Dec 4, 2023):

Looks like this was resolved

<!-- gh-comment-id:1839236481 --> @technovangelist commented on GitHub (Dec 4, 2023): Looks like this was resolved
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#62501