[GH-ISSUE #11724] Allow setting of context length on models that cannot be run #7762

Closed
opened 2026-04-12 19:55:01 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Expro on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11724

As of now, you can only set context length by first running model, then doing /set and /save. There are models that cannot be run (embedders, rerankers), effectively forcing them to run only with default context length.

It would be great to have an option to set context length without needing to run model first.

Originally created by @Expro on GitHub (Aug 6, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11724 As of now, you can only set context length by first running model, then doing /set and /save. There are models that cannot be run (embedders, rerankers), effectively forcing them to run only with default context length. It would be great to have an option to set context length without needing to run model first.
GiteaMirror added the feature request label 2026-04-12 19:55:01 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 6, 2025):

Use a Modelfile to set num_ctx.

<!-- gh-comment-id:3158372263 --> @rick-github commented on GitHub (Aug 6, 2025): Use a Modelfile to set [`num_ctx`](https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7762