[PR #843] [MERGED] basic request validation #36230

Closed
opened 2026-04-22 20:55:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/843
Author: @mxyng
Created: 10/18/2023
Status: Merged
Merged: 10/19/2023
Merged by: @mxyng

Base: mainHead: mxyng/request-validation


📝 Commits (6)

📊 Changes

4 files changed (+109 additions, -30 deletions)

View changed files

📝 examples/golang-simplegenerate/main.go (+3 -3)
📝 format/time_test.go (+1 -1)
📝 server/images.go (+1 -1)
📝 server/routes.go (+104 -25)

📄 Description

  • API returns {"error": "EOF"} when request is empty
  • Most handlers pass request fields without checking if they're empty produces bad errors
  • created_at on an empty generate request isn't set so it incorrectly shows 0001-01-01T00:00:00Z
  • Create's workDir isn't used after [GH-ISSUE #1423] Allow Response Templating (#759)

Note: there's an inconsistency in naming the key for model names. Some requests (Generate, Embedding) use model while others (Pull, Push, Create) use name


🔄 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/843 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 10/18/2023 **Status:** ✅ Merged **Merged:** 10/19/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/request-validation` --- ### 📝 Commits (6) - [`a19d476`](https://github.com/ollama/ollama/commit/a19d47642e49814c3fba634cd50a4898ce1a5a57) models: rm workDir from CreateModel - [`689842b`](https://github.com/ollama/ollama/commit/689842b9ff7ddc8c92ad42b576090dcde36f17cf) request: bad request when model missing fields - [`7e547c6`](https://github.com/ollama/ollama/commit/7e547c6833ea7807304bb7d9896935574ae6aca7) s/message/error/ - [`2ad8a07`](https://github.com/ollama/ollama/commit/2ad8a074acf0f9f9fe17aedb4425637580dad019) generate: set created_at - [`e1c5be2`](https://github.com/ollama/ollama/commit/e1c5be24e78308e5a4394f00e19ef7eedf619845) check json eof - [`2ce1793`](https://github.com/ollama/ollama/commit/2ce1793a1d403a748e7173b7fa17955910959515) go fmt ### 📊 Changes **4 files changed** (+109 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `examples/golang-simplegenerate/main.go` (+3 -3) 📝 `format/time_test.go` (+1 -1) 📝 `server/images.go` (+1 -1) 📝 `server/routes.go` (+104 -25) </details> ### 📄 Description - API returns `{"error": "EOF"}` when request is empty - Most handlers pass request fields without checking if they're empty produces bad errors - `created_at` on an empty generate request isn't set so it incorrectly shows `0001-01-01T00:00:00Z` - Create's `workDir` isn't used after #759 Note: there's an inconsistency in naming the key for model names. Some requests (Generate, Embedding) use `model` while others (Pull, Push, Create) use `name` --- <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-22 20:55:35 -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#36230