Skip to content

Fix local model scanner to handle ollama cloud models - #5220

Merged
Imagineer99 merged 4 commits into
unslothai:mainfrom
Anish9901:fix_model_scan
Apr 30, 2026
Merged

Imagineer99 merged 4 commits into
unslothai:mainfrom
Anish9901:fix_model_scan

Conversation

@Anish9901

Copy link
Copy Markdown
Contributor

Fixes #5219

Ollama clouds models do have layers but it's set to None which breaks for layer in manifest.get("layers", []).

Before After
Screenshot 1 Screenshot 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the iteration logic for manifest layers in studio/backend/routes/models.py. By using (manifest.get("layers") or []), the code now safely handles cases where the "layers" key might be present but explicitly set to null, preventing potential iteration errors. No review comments were provided for this change, and I have no further feedback to provide.

@Imagineer99 Imagineer99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and fix works as expected.

@Imagineer99
Imagineer99 merged commit 11c04ed into unslothai:main Apr 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Unsloth Studio fails to scan local Ollama models

2 participants