[PR #12509] [MERGED] openai: refactor to split compat layer and middleware #13850

Closed
opened 2026-04-13 00:38:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12509
Author: @drifkin
Created: 10/5/2025
Status: Merged
Merged: 10/6/2025
Merged by: @drifkin

Base: mainHead: drifkin/oai-compat-refactor


📝 Commits (1)

  • 2c2f4de openai: refactor to split compat layer and middleware

📊 Changes

5 files changed (+1475 additions, -1303 deletions)

View changed files

middleware/openai.go (+424 -0)
middleware/openai_test.go (+928 -0)
📝 openai/openai.go (+31 -434)
📝 openai/openai_test.go (+86 -863)
📝 server/routes.go (+6 -6)

📄 Description

This makes the core openai compat layer independent of the middleware that adapts it to our particular gin routes


🔄 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/12509 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 10/5/2025 **Status:** ✅ Merged **Merged:** 10/6/2025 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/oai-compat-refactor` --- ### 📝 Commits (1) - [`2c2f4de`](https://github.com/ollama/ollama/commit/2c2f4deaa96d3a9f52502c82bc1bffe93ea44565) openai: refactor to split compat layer and middleware ### 📊 Changes **5 files changed** (+1475 additions, -1303 deletions) <details> <summary>View changed files</summary> ➕ `middleware/openai.go` (+424 -0) ➕ `middleware/openai_test.go` (+928 -0) 📝 `openai/openai.go` (+31 -434) 📝 `openai/openai_test.go` (+86 -863) 📝 `server/routes.go` (+6 -6) </details> ### 📄 Description This makes the core openai compat layer independent of the middleware that adapts it to our particular gin routes --- <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 00:38:33 -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#13850