[GH-ISSUE #9228] add max context window to /api/tags #31775

Closed
opened 2026-04-22 12:32:41 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @trebor on GitHub (Feb 19, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9228

currently, there is no way to programmatically identify the maximum context window of a model other than to look it up in the world manually. it would be great to add something like max_context_tokens to the ** /api/tags** payload.

when paired with #9229 we could improve context window behavior and understanding.

Originally created by @trebor on GitHub (Feb 19, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9228 currently, there is no way to programmatically identify the maximum context window of a model other than to look it up in the world manually. it would be great to add something like **max_context_tokens** to the ** /api/tags** payload. when paired with #9229 we could improve context window behavior and understanding.
GiteaMirror added the feature request label 2026-04-22 12:32:41 -05:00
Author
Owner

@trebor commented on GitHub (Feb 25, 2025):

turns out max context window can be found in /api/show. it'd be nice if the show info could be grabbed all in one go, but at least it is avaible progrmattically. sorry noise here.

<!-- gh-comment-id:2683483045 --> @trebor commented on GitHub (Feb 25, 2025): turns out max context window can be found in **/api/show**. it'd be nice if the show info could be grabbed all in one go, but at least it is avaible progrmattically. sorry noise here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#31775