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

Closed
opened 2026-05-05 08:21:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11851
Author: @msiebuhr
Created: 8/11/2025
Status: Closed

Base: mainHead: increase-client-buffer-size


📝 Commits (1)

  • 0c877a2 api: Increase max response size from 512 KB to 5 MB

📊 Changes

2 files changed (+33 additions, -2 deletions)

View changed files

📝 api/client.go (+5 -2)
📝 api/client_test.go (+28 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/11851 **Author:** [@msiebuhr](https://github.com/msiebuhr) **Created:** 8/11/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `increase-client-buffer-size` --- ### 📝 Commits (1) - [`0c877a2`](https://github.com/ollama/ollama/commit/0c877a2bd011a40d1f6ca23cb1d1df723039c236) api: Increase max response size from 512 KB to 5 MB ### 📊 Changes **2 files changed** (+33 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+5 -2) 📝 `api/client_test.go` (+28 -0) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 08:21:12 -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#75928