[PR #11851] api: Increase max response size from 512 KB to 5 MB #13634

Closed
opened 2026-04-13 00:31:41 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11851

State: closed
Merged: No


The second argument to bufio.Scanner's Buffer() is the maximum size that will ever be allocated (set to 512 KB), silently dropping larger responses from Ollama.

When sending large requests to /api/generate (MB-range), MB-sized contexts are returned and the whole response is silently dropped, causing users to complain.

This change keeps the default buffer size at 512 KB, but raises the maximum buffer size to 5 MB.

This fixes https://github.com/ollama/ollama/issues/11811 - or at least bumps the size by a factor of ten.

**Original Pull Request:** https://github.com/ollama/ollama/pull/11851 **State:** closed **Merged:** No --- The second argument to bufio.Scanner's Buffer() is the maximum size that will ever be allocated (set to 512 KB), silently dropping larger responses from Ollama. When sending large requests to /api/generate (MB-range), MB-sized contexts are returned and the whole response is silently dropped, causing users to complain. This change keeps the default buffer size at 512 KB, but raises the maximum buffer size to 5 MB. This fixes https://github.com/ollama/ollama/issues/11811 - or at least bumps the size by a factor of ten.
GiteaMirror added the pull-request label 2026-04-13 00:31:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#13634