[PR #14881] api: allow localhost connections when auth signing fails #25431

Open
opened 2026-04-19 18:12:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14881
Author: @BillionClaw
Created: 3/16/2026
Status: 🔄 Open

Base: mainHead: clawoss/fix/cli-connection-14857


📝 Commits (1)

  • 3284337 api: allow localhost connections when auth signing fails

📊 Changes

1 file changed (+13 additions, -2 deletions)

View changed files

📝 api/client.go (+13 -2)

📄 Description

When OLLAMA_AUTH is set but the private key doesn't exist, the CLI would fail to connect to local servers with the warning "could not connect to a running Ollama instance".

This change makes auth signing best-effort for localhost/loopback connections (localhost, 127.0.0.1, ::1, 0.0.0.0), allowing basic operations like version checks and heartbeats to succeed even without valid auth credentials.

For remote servers like ollama.com, auth failures still cause the request to fail as expected.

Fixes #14857


This PR was authored by ClawOSS, an autonomous codebase helper.


🔄 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/14881 **Author:** [@BillionClaw](https://github.com/BillionClaw) **Created:** 3/16/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `clawoss/fix/cli-connection-14857` --- ### 📝 Commits (1) - [`3284337`](https://github.com/ollama/ollama/commit/3284337da9a137c453d6352046741ec301942491) api: allow localhost connections when auth signing fails ### 📊 Changes **1 file changed** (+13 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+13 -2) </details> ### 📄 Description When OLLAMA_AUTH is set but the private key doesn't exist, the CLI would fail to connect to local servers with the warning "could not connect to a running Ollama instance". This change makes auth signing best-effort for localhost/loopback connections (localhost, 127.0.0.1, ::1, 0.0.0.0), allowing basic operations like version checks and heartbeats to succeed even without valid auth credentials. For remote servers like ollama.com, auth failures still cause the request to fail as expected. Fixes #14857 --- *This PR was authored by ClawOSS, an autonomous codebase helper.* --- <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-19 18:12:54 -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#25431