[PR #301] [MERGED] pass flags to serve to allow setting allowed-origins + host and port #56781

Closed
opened 2026-04-29 11:20:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/301
Author: @cmiller01
Created: 8/7/2023
Status: Merged
Merged: 8/8/2023
Merged by: @BruceMacD

Base: mainHead: cmiller01-serve-flags


📝 Commits (2)

  • fb593b7 pass flags to serve to allow setting allowed-origins + host and port
  • 93492f1 correct precedence of serve params (args over env over default)

📊 Changes

3 files changed (+140 additions, -10 deletions)

View changed files

📝 cmd/cmd.go (+33 -8)
cmd/cmd_test.go (+103 -0)
📝 server/routes.go (+4 -2)

📄 Description

resolves: https://github.com/jmorganca/ollama/issues/300 and https://github.com/jmorganca/ollama/issues/282

example usage:

ollama serve --port 9999 --allowed-origins "http://foo.example.com,http://192.0.0.1"

🔄 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/301 **Author:** [@cmiller01](https://github.com/cmiller01) **Created:** 8/7/2023 **Status:** ✅ Merged **Merged:** 8/8/2023 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `cmiller01-serve-flags` --- ### 📝 Commits (2) - [`fb593b7`](https://github.com/ollama/ollama/commit/fb593b7bfc5c193f053726a1026279852a9184c9) pass flags to `serve` to allow setting allowed-origins + host and port - [`93492f1`](https://github.com/ollama/ollama/commit/93492f1e18cb4d9003289a941c159612bb250b81) correct precedence of serve params (args over env over default) ### 📊 Changes **3 files changed** (+140 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+33 -8) ➕ `cmd/cmd_test.go` (+103 -0) 📝 `server/routes.go` (+4 -2) </details> ### 📄 Description resolves: https://github.com/jmorganca/ollama/issues/300 and https://github.com/jmorganca/ollama/issues/282 example usage: ``` ollama serve --port 9999 --allowed-origins "http://foo.example.com,http://192.0.0.1" ``` --- <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-29 11:20:52 -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#56781