feat: Set ollama model options such as context length based on API call #5091

Closed
opened 2025-11-11 16:12:05 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @ErroneousBosch on GitHub (May 7, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

While Ollama defaults to a 2048 context length on many things, custom models can have higher, and some stock models ship with larger contexts such as qwen3 (which has a 40960 context window).

Desired Solution you'd like

Rather than having to set these manually, it would be better to have OpenWebUI configure this and other model-specific options options via an API call to /api/show. This is described in their documentation: https://www.postman.com/postman-student-programs/ollama-api/documentation/suc47x8/ollama-rest-api

It does have some idiosyncrasies in that these keys are prefixed with the model name, but that is surmountable.

Alternatives Considered

No response

Additional Context

No response

Originally created by @ErroneousBosch on GitHub (May 7, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description While Ollama defaults to a 2048 context length on many things, custom models can have higher, and some stock models ship with larger contexts such as qwen3 (which has a 40960 context window). ### Desired Solution you'd like Rather than having to set these manually, it would be better to have OpenWebUI configure this and other model-specific options options via an API call to `/api/show`. This is described in their documentation: https://www.postman.com/postman-student-programs/ollama-api/documentation/suc47x8/ollama-rest-api It does have some idiosyncrasies in that these keys are prefixed with the model name, but that is surmountable. ### Alternatives Considered _No response_ ### Additional Context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5091