ollama - 💡(How to fix) Fix Ollama doesn't validate model architecture when importing safetensors [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15949Fetched 2026-05-04 04:58:23
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Error Message

converting model Error: unsupported architecture "MistralForCausalLM"

Code Example

converting model
Error: unsupported architecture "MistralForCausalLM"

---
RAW_BUFFERClick to expand / collapse

What is the issue?

This issue is part of #15925 batch of issues I reported.

There's another bug related to model import from safetensors:

converting model
Error: unsupported architecture "MistralForCausalLM"

That's after copying 77 GB worth of safetensors files to blobs.

I don't know about you but I'd first read the config.json, then read architecture key's value, and if it's unsupported I'd stop before importing anything instead of leaving orphaned files.

Relevant log output

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.22.1

extent analysis

TL;DR

The issue can likely be resolved by adding support for the "MistralForCausalLM" architecture in the model import process or by checking the architecture before initiating the import.

Guidance

  • Verify the list of supported architectures in the config.json file to confirm that "MistralForCausalLM" is not supported.
  • Check if there are any existing issues or pull requests related to adding support for the "MistralForCausalLM" architecture.
  • Consider implementing a check for unsupported architectures before starting the model import process to prevent orphaned files.
  • Review the model import code to understand how it handles unsupported architectures and see if there's a way to add support for "MistralForCausalLM".

Notes

The solution may require modifications to the model import code or the addition of new architecture support, which could involve significant changes.

Recommendation

Apply workaround: Implement a check for unsupported architectures before starting the model import process to prevent orphaned files, as this is a more immediate and less invasive solution than adding support for a new architecture.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Ollama doesn't validate model architecture when importing safetensors [1 participants]