[GH-ISSUE #7661] How does ollam support the input of long text quantity #51399

Closed
opened 2026-04-28 19:50:35 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @smileyboy2019 on GitHub (Nov 14, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7661

The large model supports 128k data input, which is equivalent to supporting hundreds of thousands of words. What is the maximum number of words that the ollama URL can support for input? Can you input hundreds of thousands of words.

Originally created by @smileyboy2019 on GitHub (Nov 14, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7661 The large model supports 128k data input, which is equivalent to supporting hundreds of thousands of words. What is the maximum number of words that the ollama URL can support for input? Can you input hundreds of thousands of words.
GiteaMirror added the question label 2026-04-28 19:50:35 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 14, 2024):

Can you input hundreds of thousands of words.

Yes.

<!-- gh-comment-id:2476315612 --> @rick-github commented on GitHub (Nov 14, 2024): > Can you input hundreds of thousands of words. Yes.
Author
Owner

@jmorganca commented on GitHub (Nov 14, 2024):

Yes it can – however, make sure to set the context window with /set parameter num_ctx 128000 or "options": {"num_ctx": 128000}} in the API

<!-- gh-comment-id:2477570713 --> @jmorganca commented on GitHub (Nov 14, 2024): Yes it can – however, make sure to set the context window with `/set parameter num_ctx 128000` or `"options": {"num_ctx": 128000}}` in the API
Author
Owner

@RealHacker commented on GitHub (Feb 24, 2025):

What if the prompt I send to ollama exceeds the model context length? What does ollama do?

  1. Reject the request with error code.
  2. Accept all the text, but only the text within context window is actually sent to the model.
  3. Cache the text, and repeatedly send segments to model, while preserving the context.

Which is it?

<!-- gh-comment-id:2677960600 --> @RealHacker commented on GitHub (Feb 24, 2025): What if the prompt I send to ollama exceeds the model context length? What does ollama do? 1. Reject the request with error code. 2. Accept all the text, but only the text within context window is actually sent to the model. 3. Cache the text, and repeatedly send segments to model, while preserving the context. Which is it?
Author
Owner

@rick-github commented on GitHub (Feb 24, 2025):

<!-- gh-comment-id:2677964108 --> @rick-github commented on GitHub (Feb 24, 2025): 2.
Author
Owner

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

One more question: is the context length hardcoded 2048 or read from configuration? Or, does it change with the currently loaded model's parameters? If it is not dynamic with models, can I change it with REST API, and can I query it from REST API?

2048 is really limiting. If the context is not dynamic with loaded model, consider this a feature request. :)

<!-- gh-comment-id:2681285468 --> @RealHacker commented on GitHub (Feb 25, 2025): One more question: is the context length hardcoded 2048 or read from configuration? Or, does it change with the currently loaded model's parameters? If it is not dynamic with models, can I change it with REST API, and can I query it from REST API? 2048 is really limiting. If the context is not dynamic with loaded model, consider this a feature request. :)
Author
Owner
<!-- gh-comment-id:2681345658 --> @rick-github commented on GitHub (Feb 25, 2025): https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51399