[PR #15084] bench: add support for OpenAI API benchmarks #46258

Open
opened 2026-04-25 01:45:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15084
Author: @dhiltgen
Created: 3/27/2026
Status: 🔄 Open

Base: mainHead: bench


📝 Commits (2)

  • de320ae bench: add support for OpenAI API benchmarks
  • 30cd6c8 improve prompt size accuracy, and report context size

📊 Changes

3 files changed (+417 additions, -29 deletions)

View changed files

📝 cmd/bench/bench.go (+373 -28)
📝 middleware/openai.go (+2 -0)
📝 openai/openai.go (+42 -1)

📄 Description

Favor Timings in the API if available. If not, only TTFT and generate are exposed. Also adds support to adjust context size.

go run ./cmd/bench -model gemma3:1b
go run ./cmd/bench -model gemma3:1b -openai http://localhost:11434/v1

Optional -api-key if needed for the endpoint.


🔄 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/15084 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 3/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `bench` --- ### 📝 Commits (2) - [`de320ae`](https://github.com/ollama/ollama/commit/de320aee38c96cc9da217df44603030d32495b2d) bench: add support for OpenAI API benchmarks - [`30cd6c8`](https://github.com/ollama/ollama/commit/30cd6c84c0dd0009bb7b4be062d498abf02e92be) improve prompt size accuracy, and report context size ### 📊 Changes **3 files changed** (+417 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `cmd/bench/bench.go` (+373 -28) 📝 `middleware/openai.go` (+2 -0) 📝 `openai/openai.go` (+42 -1) </details> ### 📄 Description Favor Timings in the API if available. If not, only TTFT and generate are exposed. Also adds support to adjust context size. ``` go run ./cmd/bench -model gemma3:1b go run ./cmd/bench -model gemma3:1b -openai http://localhost:11434/v1 ``` Optional `-api-key` if needed for the endpoint. --- <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-25 01:45:02 -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#46258