[PR #11436] fix: initialize Options map in GetModel to prevent nil panic #13540

Open
opened 2026-04-13 00:29:48 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11436

State: open
Merged: No


Initialize the Options map when creating a new Model struct to prevent "assignment to entry in nil map" panics. This fixes a panic that occurs when models don't have params layers in their manifest.

I encountered this when doing:

❯ ollama run devstral
>>> /set parameter stop <|endoftext|>
Set parameter 'stop' to '<|endoftext|>'
>>> /set parameter num_ctx 131072
Set parameter 'num_ctx' to '131072'
>>> /show info
error: couldn't get model
Error: something went wrong, please see the ollama server logs for details

Closes #6890

**Original Pull Request:** https://github.com/ollama/ollama/pull/11436 **State:** open **Merged:** No --- Initialize the Options map when creating a new Model struct to prevent "assignment to entry in nil map" panics. This fixes a panic that occurs when models don't have params layers in their manifest. I encountered this when doing: ```console ❯ ollama run devstral >>> /set parameter stop <|endoftext|> Set parameter 'stop' to '<|endoftext|>' >>> /set parameter num_ctx 131072 Set parameter 'num_ctx' to '131072' >>> /show info error: couldn't get model Error: something went wrong, please see the ollama server logs for details ``` Closes #6890
GiteaMirror added the pull-request label 2026-04-13 00:29:48 -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#13540