[PR #14827] [MERGED] server: decompress zstd request bodies in cloud passthrough middleware #14861

Closed
opened 2026-04-13 01:04:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14827
Author: @BruceMacD
Created: 3/13/2026
Status: Merged
Merged: 3/13/2026
Merged by: @BruceMacD

Base: mainHead: brucemacd/cloud-proxy-zstd


📝 Commits (2)

  • d736f53 server: decompress zstd request bodies in cloud passthrough middleware
  • 46f97a9 return "request body too large" when req larger than 20mb

📊 Changes

3 files changed (+117 additions, -1 deletions)

View changed files

📝 middleware/openai.go (+4 -1)
📝 server/cloud_proxy.go (+17 -0)
📝 server/cloud_proxy_test.go (+96 -0)

📄 Description

When a zstd-compressed request (e.g. from Codex CLI) hits /v1/responses with a cloud model the request failed.

Fix by decompressing zstd bodies before
model extraction, so cloud models are detected and proxied directly without the writer being wrapped.

To test:

ollama launch codex --model minimax-m2.5:cloud -- exec 'say hi'

🔄 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/14827 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/cloud-proxy-zstd` --- ### 📝 Commits (2) - [`d736f53`](https://github.com/ollama/ollama/commit/d736f539aff5b23aa09e5cdb4f66ba8c5345dec6) server: decompress zstd request bodies in cloud passthrough middleware - [`46f97a9`](https://github.com/ollama/ollama/commit/46f97a934905358d0ceac97aa86ff916bde0994a) return "request body too large" when req larger than 20mb ### 📊 Changes **3 files changed** (+117 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `middleware/openai.go` (+4 -1) 📝 `server/cloud_proxy.go` (+17 -0) 📝 `server/cloud_proxy_test.go` (+96 -0) </details> ### 📄 Description When a zstd-compressed request (e.g. from Codex CLI) hits /v1/responses with a cloud model the request failed. Fix by decompressing zstd bodies before model extraction, so cloud models are detected and proxied directly without the writer being wrapped. To test: ``` ollama launch codex --model minimax-m2.5:cloud -- exec 'say hi' ``` --- <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-04-13 01:04:14 -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#14861