[PR #15957] cmd: validate safetensors architecture before uploading blob #77667

Open
opened 2026-05-05 10:20:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15957
Author: @vvvu
Created: 5/4/2026
Status: 🔄 Open

Base: mainHead: fix/safetensors-arch-validation


📝 Commits (2)

  • 2613a57 convert: add ValidateArchitecture for early model compatibility check
  • 41ac2b9 cmd: validate safetensors architecture before uploading blobs

📊 Changes

4 files changed (+187 additions, -48 deletions)

View changed files

📝 cmd/cmd.go (+22 -0)
📝 cmd/cmd_test.go (+34 -0)
📝 convert/convert.go (+72 -48)
📝 convert/convert_test.go (+59 -0)

📄 Description

Summary

Fix a issue where ollama create uploaded safetensors blobs before rejecting unsupported architectures.

This PR reuses converter-side architecture validation and moves the check earlier into the client create path, so unsupported models fail fast before any blob upload.

Problem

Issue: #15949

Previously, unsupported safetensors models could fail only after their blobs had already been uploaded into blobs, wasting time and disk space.

Changes

This PR:

  • adds reusable architecture validation in convert
  • validates config.json before upload in ollama create
  • adds regression coverage for unsupported architectures

Testing

  • go test ./cmd -run 'TestCreateHandler'
  • go test ./convert/...
  • go test ./server -run 'TestCreate'

🔄 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/15957 **Author:** [@vvvu](https://github.com/vvvu) **Created:** 5/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/safetensors-arch-validation` --- ### 📝 Commits (2) - [`2613a57`](https://github.com/ollama/ollama/commit/2613a57ac925995f94071eb72f70bb9120bc5e04) convert: add ValidateArchitecture for early model compatibility check - [`41ac2b9`](https://github.com/ollama/ollama/commit/41ac2b9729e4304d2ad83dbc2241bf12196bc01b) cmd: validate safetensors architecture before uploading blobs ### 📊 Changes **4 files changed** (+187 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+22 -0) 📝 `cmd/cmd_test.go` (+34 -0) 📝 `convert/convert.go` (+72 -48) 📝 `convert/convert_test.go` (+59 -0) </details> ### 📄 Description ## Summary Fix a issue where `ollama create` uploaded safetensors blobs before rejecting unsupported architectures. This PR reuses converter-side architecture validation and moves the check earlier into the client create path, so unsupported models fail fast before any blob upload. ## Problem Issue: #15949 Previously, unsupported safetensors models could fail only after their blobs had already been uploaded into `blobs`, wasting time and disk space. ## Changes This PR: - adds reusable architecture validation in `convert` - validates `config.json` before upload in `ollama create` - adds regression coverage for unsupported architectures ## Testing - `go test ./cmd -run 'TestCreateHandler'` - `go test ./convert/...` - `go test ./server -run 'TestCreate'` --- <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-05-05 10:20:34 -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#77667