[GH-ISSUE #7063] Support setting num_ctx in openai api via extra query parameter #66542

Open
opened 2026-05-04 07:19:48 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @fzyzcjy on GitHub (Oct 1, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7063

Hi thanks for the package! It would be great if num_ctx can be set in openai api. It seems openai api allows extra query parameter, and other packages like vllm can make use of it to support custom args.

Originally created by @fzyzcjy on GitHub (Oct 1, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7063 Hi thanks for the package! It would be great if num_ctx can be set in openai api. It seems openai api allows extra query parameter, and other packages like vllm can make use of it to support custom args.
GiteaMirror added the feature requestapi labels 2026-05-04 07:20:31 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 1, 2024):

https://github.com/ollama/ollama/pull/6504

<!-- gh-comment-id:2386325381 --> @rick-github commented on GitHub (Oct 1, 2024): https://github.com/ollama/ollama/pull/6504
Author
Owner

@TomLucidor commented on GitHub (Nov 21, 2024):

Need something similar to this (when model supports extra large context window) but for ollama serve parameter as well so that is won't be stuck at 2048. https://github.com/ollama/ollama/issues/6286

Weirdly enough the issue of context and generation sizes are complex

<!-- gh-comment-id:2490023153 --> @TomLucidor commented on GitHub (Nov 21, 2024): Need something similar to this (when model supports extra large context window) but for `ollama serve` parameter as well so that is won't be stuck at 2048. https://github.com/ollama/ollama/issues/6286 Weirdly enough the issue of context and generation sizes are complex - Flexible context window https://github.com/ollama/ollama/issues/1005 https://github.com/ollama/ollama/issues/1964 - Stop generation once limit is reached https://github.com/ollama/ollama/issues/3355 - RAM-based (or VRAM-based) context size adjustments https://github.com/ollama/ollama/issues/7629
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#66542