[BUG] Ollama create method is only creating a single model based on the _from parameter, but not the derivate model like the cli #263

Closed
opened 2026-02-15 16:29:20 -05:00 by yindo · 1 comment
Owner

Originally created by @PouyaT on GitHub (Apr 16, 2025).

System & Packages:

  • Windows 11
  • ollama version is 0.6.5
  • ollama-python version: 0.4.7

My Issue:

MODEL_NAME = "Mario"
BASE_MODEL = "gemma3:27b"
SYSTEM_MESSAGE = """
You are Mario
"""
ollama.create(model=GBA_MODEL_NAME, from_=BASE_MODEL, system=SYSTEM_MESSAGE)

This outputs a single model, which is just the base model, and I need to run ollama.create() twice to get the derivative model Mario.

Output after one run:

ollama list
NAME          ID              SIZE     MODIFIED
gemma3:27b    a418f5838eaf    17 GB    About a minute ago

Output after my second run:

ollama list
NAME            ID              SIZE     MODIFIED
Mario:latest    7e504478a845    17 GB    3 seconds ago
gemma3:27b      a418f5838eaf    17 GB    3 minutes ago

Expected Outcome:

With a Modelfile:

FROM gemma3:27b

SYSTEM """
You are Mario
"""

This is not true with the cli, after running the cli command once I get both models as an output from ollama list:
ollama create Mario -f ./Modelfile

Output:

ollama list
NAME            ID              SIZE     MODIFIED
Mario:latest    ed95e4fd17c8    17 GB    52 seconds ago
gemma3:27b      a418f5838eaf    17 GB    52 seconds ago
Originally created by @PouyaT on GitHub (Apr 16, 2025). ### System & Packages: - Windows 11 - `ollama version is 0.6.5` - ollama-python version: 0.4.7 ## My Issue: ``` MODEL_NAME = "Mario" BASE_MODEL = "gemma3:27b" SYSTEM_MESSAGE = """ You are Mario """ ollama.create(model=GBA_MODEL_NAME, from_=BASE_MODEL, system=SYSTEM_MESSAGE) ``` This outputs a single model, which is just the base model, and I need to run `ollama.create()` twice to get the derivative model `Mario`. Output after one run: ``` ollama list NAME ID SIZE MODIFIED gemma3:27b a418f5838eaf 17 GB About a minute ago ``` Output after my second run: ``` ollama list NAME ID SIZE MODIFIED Mario:latest 7e504478a845 17 GB 3 seconds ago gemma3:27b a418f5838eaf 17 GB 3 minutes ago ``` ### Expected Outcome: With a `Modelfile`: ``` FROM gemma3:27b SYSTEM """ You are Mario """ ``` This is not true with the cli, after running the cli command once I get both models as an output from `ollama list`: `ollama create Mario -f ./Modelfile` Output: ``` ollama list NAME ID SIZE MODIFIED Mario:latest ed95e4fd17c8 17 GB 52 seconds ago gemma3:27b a418f5838eaf 17 GB 52 seconds ago ```
yindo closed this issue 2026-02-15 16:29:20 -05:00
Author
Owner

@mxyng commented on GitHub (May 6, 2025):

This appears to be a bug in the Ollama server. With stream=False, which is the default for ollama-python but not the CLI or API, create returns after pulling the parent model but before creating the new one.

@mxyng commented on GitHub (May 6, 2025): This appears to be a bug in the Ollama server. With `stream=False`, which is the default for ollama-python but not the CLI or API, `create` returns after pulling the parent model but before creating the new one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#263