[PR #13741] [MERGED] Fix create and show commands for experimental models #24912

Closed
opened 2026-04-19 17:53:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13741
Author: @pdevine
Created: 1/16/2026
Status: Merged
Merged: 1/16/2026
Merged by: @pdevine

Base: mainHead: pdevine/x-create


📝 Commits (4)

  • f969b6a x: make ollama create --experimental import from safetensors
  • 91a952f gofumpt the linter
  • c50c4bf gofumpt the linter again
  • 1950ac0 validate the model name

📊 Changes

13 files changed (+2647 additions, -266 deletions)

View changed files

📝 cmd/cmd.go (+89 -9)
📝 server/routes.go (+37 -0)
x/create/client/create.go (+282 -0)
x/create/client/create_test.go (+146 -0)
📝 x/create/client/quantize.go (+12 -5)
📝 x/create/client/quantize_stub.go (+1 -1)
x/create/create.go (+399 -0)
x/create/create_test.go (+752 -0)
📝 x/create/imagegen.go (+48 -39)
x/imagegen/client/create.go (+0 -190)
x/imagegen/quantize.go (+0 -22)
x/server/show.go (+284 -0)
x/server/show_test.go (+597 -0)

📄 Description

This change allows pulling in safetensors models into the new experimental model format, and also fixes the ollama show command to be able to correctly display the model information.

Example create:

% ../ollama/ollama create --experimental pdevine/z-test
importing image generation model
importing image generation model
importing text_encoder/model-00001-of-00003.safetensors (174 tensors)
importing text_encoder/model-00002-of-00003.safetensors (219 tensors)
importing text_encoder/model-00003-of-00003.safetensors (5 tensors)
importing transformer/diffusion_pytorch_model-00001-of-00003.safetensors (214 tensors)
importing transformer/diffusion_pytorch_model-00002-of-00003.safetensors (209 tensors)
importing transformer/diffusion_pytorch_model-00003-of-00003.safetensors (98 tensors)
importing vae/diffusion_pytorch_model.safetensors (244 tensors)
importing config model_index.json
importing config text_encoder/config.json
importing config text_encoder/generation_config.json
importing config transformer/config.json
importing config vae/config.json
importing config scheduler/scheduler_config.json
importing config tokenizer/tokenizer.json
importing config tokenizer/tokenizer_config.json
importing config tokenizer/vocab.json
writing manifest for pdevine/z-test
successfully imported pdevine/z-test with 1172 layers

Example show:

% ../ollama/ollama show pdevine/z-test -v
  Model
    architecture    ZImagePipeline
    parameters      10.3B
    quantization    bfloat16
    requires        0.14.0

  Capabilities
    image

  Tensors
    text_encoder/model.embed_tokens.weight                          BF16    [151936 2560]
    text_encoder/model.layers.0.input_layernorm.weight              BF16    [2560]
    text_encoder/model.layers.0.mlp.down_proj.weight                BF16    [2560 9728]
    text_encoder/model.layers.0.mlp.gate_proj.weight                BF16    [9728 2560]
    text_encoder/model.layers.0.mlp.up_proj.weight                  BF16    [9728 2560]
    text_encoder/model.layers.0.post_attention_layernorm.weight     BF16    [2560]
    text_encoder/model.layers.0.self_attn.k_norm.weight             BF16    [128]
...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13741 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/x-create` --- ### 📝 Commits (4) - [`f969b6a`](https://github.com/ollama/ollama/commit/f969b6a67bf28d994d8ab546788cc3cb03e89e73) x: make `ollama create --experimental` import from safetensors - [`91a952f`](https://github.com/ollama/ollama/commit/91a952f219f7b4fcf93a8e3497fdf9919ced8bae) gofumpt the linter - [`c50c4bf`](https://github.com/ollama/ollama/commit/c50c4bf88662384d5ac025d7d771b6a996fbe4e9) gofumpt the linter again - [`1950ac0`](https://github.com/ollama/ollama/commit/1950ac0f67c5071ad40c99d067bc288ccb38d915) validate the model name ### 📊 Changes **13 files changed** (+2647 additions, -266 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+89 -9) 📝 `server/routes.go` (+37 -0) ➕ `x/create/client/create.go` (+282 -0) ➕ `x/create/client/create_test.go` (+146 -0) 📝 `x/create/client/quantize.go` (+12 -5) 📝 `x/create/client/quantize_stub.go` (+1 -1) ➕ `x/create/create.go` (+399 -0) ➕ `x/create/create_test.go` (+752 -0) 📝 `x/create/imagegen.go` (+48 -39) ➖ `x/imagegen/client/create.go` (+0 -190) ➖ `x/imagegen/quantize.go` (+0 -22) ➕ `x/server/show.go` (+284 -0) ➕ `x/server/show_test.go` (+597 -0) </details> ### 📄 Description This change allows pulling in safetensors models into the new experimental model format, and also fixes the `ollama show` command to be able to correctly display the model information. Example create: ``` % ../ollama/ollama create --experimental pdevine/z-test importing image generation model importing image generation model importing text_encoder/model-00001-of-00003.safetensors (174 tensors) importing text_encoder/model-00002-of-00003.safetensors (219 tensors) importing text_encoder/model-00003-of-00003.safetensors (5 tensors) importing transformer/diffusion_pytorch_model-00001-of-00003.safetensors (214 tensors) importing transformer/diffusion_pytorch_model-00002-of-00003.safetensors (209 tensors) importing transformer/diffusion_pytorch_model-00003-of-00003.safetensors (98 tensors) importing vae/diffusion_pytorch_model.safetensors (244 tensors) importing config model_index.json importing config text_encoder/config.json importing config text_encoder/generation_config.json importing config transformer/config.json importing config vae/config.json importing config scheduler/scheduler_config.json importing config tokenizer/tokenizer.json importing config tokenizer/tokenizer_config.json importing config tokenizer/vocab.json writing manifest for pdevine/z-test successfully imported pdevine/z-test with 1172 layers ``` Example show: ``` % ../ollama/ollama show pdevine/z-test -v Model architecture ZImagePipeline parameters 10.3B quantization bfloat16 requires 0.14.0 Capabilities image Tensors text_encoder/model.embed_tokens.weight BF16 [151936 2560] text_encoder/model.layers.0.input_layernorm.weight BF16 [2560] text_encoder/model.layers.0.mlp.down_proj.weight BF16 [2560 9728] text_encoder/model.layers.0.mlp.gate_proj.weight BF16 [9728 2560] text_encoder/model.layers.0.mlp.up_proj.weight BF16 [9728 2560] text_encoder/model.layers.0.post_attention_layernorm.weight BF16 [2560] text_encoder/model.layers.0.self_attn.k_norm.weight BF16 [128] ... ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 17:53:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#24912