[GH-ISSUE #11807] Allow exact context length configuration for OpenAI‑compatible endpoint in GUI #7834

Open
opened 2026-04-12 20:00:10 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @michael-heinrich on GitHub (Aug 8, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11807

With the introduction of the GUI, the context length for the OpenAI‑compatible endpoint is tied to the context length slider in the GUI. This introduces two related limitations:

The slider only offers a small set of discrete positions, making it impossible to set an arbitrary, precise value.

Why this matters:

With the coarse steps, either my VRAM is not fully utilized, or the model spills significantly into RAM and there is no way to fine-tune the context length for my GPU. This particularly affects the utility of VS Code agent mode because it cannot be configured to use the native ollama endpoint, but requires an OpenAI compatible endpoint.

Proposed solutions:

  1. Provide a way to manually enter an exact num_ctx value in the GUI, in addition to the slider.

  2. Or, allow the slider to move freely between the snaps.

Thanks for considering my proposal.

Originally created by @michael-heinrich on GitHub (Aug 8, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11807 With the introduction of the GUI, the context length for the OpenAI‑compatible endpoint is tied to the context length slider in the GUI. This introduces two related limitations: The slider only offers a small set of discrete positions, making it impossible to set an arbitrary, precise value. Why this matters: With the coarse steps, either my VRAM is not fully utilized, or the model spills significantly into RAM and there is no way to fine-tune the context length for my GPU. This particularly affects the utility of VS Code agent mode because it cannot be configured to use the native ollama endpoint, but requires an OpenAI compatible endpoint. Proposed solutions: 1. Provide a way to manually enter an exact num_ctx value in the GUI, in addition to the slider. 2. Or, allow the slider to move freely between the snaps. Thanks for considering my proposal.
GiteaMirror added the appcontext-lengthfeature request labels 2026-04-12 20:00:10 -05:00
Author
Owner

@sunhy0316 commented on GitHub (Aug 8, 2025):

If I don't use the app and instead use ollama serve, will the environment variable OLLAMA_CONTEXT_LENGTH or the PARAMETER num_ctx in the Modelfile still work?

<!-- gh-comment-id:3167849446 --> @sunhy0316 commented on GitHub (Aug 8, 2025): If I don't use the app and instead use `ollama serve`, will the environment variable `OLLAMA_CONTEXT_LENGTH` or the `PARAMETER num_ctx` in the Modelfile still work?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7834