[PR #12307] [MERGED] engine: add remote proxy #45026

Closed
opened 2026-04-25 00:43:10 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12307
Author: @pdevine
Created: 9/16/2025
Status: Merged
Merged: 9/17/2025
Merged by: @pdevine

Base: mainHead: pdevine/remotes


📝 Commits (10+)

📊 Changes

12 files changed (+949 additions, -101 deletions)

View changed files

📝 api/client.go (+24 -1)
📝 api/types.go (+102 -23)
📝 auth/auth.go (+13 -0)
📝 cmd/cmd.go (+144 -11)
📝 cmd/cmd_test.go (+6 -2)
📝 envconfig/config.go (+12 -0)
📝 server/create.go (+132 -20)
📝 server/create_test.go (+151 -0)
📝 server/images.go (+35 -13)
📝 server/routes.go (+247 -30)
📝 server/routes_create_test.go (+74 -0)
📝 server/routes_test.go (+9 -1)

📄 Description

This change adds a remote model proxying for the Ollama engine allowing a local Ollama instance to forward generation and chat requests to an upstream Ollama host (i.e. it lets you use Ollama's turbo mode as if you were using a local model). This should make it possible to use various 3rd party integrations with Ollama Turbo (such as Continue, Cline, Zed, and Github Copilot)

Changes to various parts of Ollama:

CLI

  • New commands:
    • signin for displaying signin information for ollama.com
    • signout for signing out of ollama.com
  • ls changes the way remote models are listed
  • run will display when you are connecting to a remote model
  • show will display information about the remote model
  • improved error handling for unauthenticated requests which will prompt the user to signin

Auth

  • New code for getting the correct public key for linux users so they can signin correctly

API client changes

  • DELETE /api/user/keys/{encodedKey} for signing out from ollama.com
  • POST /api/me for getting user information

Environment variables

  • OLLAMA_REMOTES defines the set of trusted upstream hosts (default ollama.com)

Request Routing

  • Models can now have a RemoteURL and RemoteModel which will point to an upstream ollama API
  • POST /api/generate and POST /api/chat will now determine if a model is remote and proxy the request (note that this change does not include POST /api/embed)
  • Various changes for POST /api/show and GET /api/tags to support remote models
  • Support in POST /api/create for creating a remote model definition (note that this change does not include support for modifying these changes in a Modelfile)

🔄 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/12307 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 9/16/2025 **Status:** ✅ Merged **Merged:** 9/17/2025 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/remotes` --- ### 📝 Commits (10+) - [`da9e422`](https://github.com/ollama/ollama/commit/da9e4224712c74d1a29994535991884c4fd2bf88) engine: add remote proxy - [`291b31f`](https://github.com/ollama/ollama/commit/291b31f8239761ecb526eb4f63cd0f4f8ef94eee) fix broken create test - [`0b2ac45`](https://github.com/ollama/ollama/commit/0b2ac45f3d87c3ed120d7d9ab230869fdf98e0ca) fix unit tests - [`350b95e`](https://github.com/ollama/ollama/commit/350b95ed3604af5482e20270806095bcfa827444) attempt to fix pesky unittest failure - [`87b943f`](https://github.com/ollama/ollama/commit/87b943f40aecfb5080c28336d4f2ed40b607f983) initialize keypair for test - [`0d90f63`](https://github.com/ollama/ollama/commit/0d90f639805223e71b63391815a7e982e7ebadb4) gofumpt the code - [`b511876`](https://github.com/ollama/ollama/commit/b51187658f82723d294de8613803bd2f00ac37fb) comments - [`3fccf00`](https://github.com/ollama/ollama/commit/3fccf00f72785a8c64138f67b8e4080cf20050c3) add more unit tests - [`91c6342`](https://github.com/ollama/ollama/commit/91c63420e8578836e5cec73dd0aeaab6f3595035) comments - [`b8d06f0`](https://github.com/ollama/ollama/commit/b8d06f074ffccaf2714b97d3e5866bd7d835785e) change connect string ### 📊 Changes **12 files changed** (+949 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+24 -1) 📝 `api/types.go` (+102 -23) 📝 `auth/auth.go` (+13 -0) 📝 `cmd/cmd.go` (+144 -11) 📝 `cmd/cmd_test.go` (+6 -2) 📝 `envconfig/config.go` (+12 -0) 📝 `server/create.go` (+132 -20) 📝 `server/create_test.go` (+151 -0) 📝 `server/images.go` (+35 -13) 📝 `server/routes.go` (+247 -30) 📝 `server/routes_create_test.go` (+74 -0) 📝 `server/routes_test.go` (+9 -1) </details> ### 📄 Description This change adds a remote model proxying for the Ollama engine allowing a local Ollama instance to forward generation and chat requests to an upstream Ollama host (i.e. it lets you use Ollama's turbo mode as if you were using a local model). This should make it possible to use various 3rd party integrations with Ollama Turbo (such as Continue, Cline, Zed, and Github Copilot) Changes to various parts of Ollama: # CLI * New commands: * `signin` for displaying signin information for ollama.com * `signout` for signing out of ollama.com * `ls` changes the way remote models are listed * `run` will display when you are connecting to a remote model * `show` will display information about the remote model * improved error handling for unauthenticated requests which will prompt the user to signin # Auth * New code for getting the correct public key for linux users so they can signin correctly # API client changes * DELETE `/api/user/keys/{encodedKey}` for signing out from ollama.com * POST `/api/me` for getting user information # Environment variables * `OLLAMA_REMOTES` defines the set of trusted upstream hosts (default `ollama.com`) # Request Routing * Models can now have a RemoteURL and RemoteModel which will point to an upstream ollama API * POST `/api/generate` and POST `/api/chat` will now determine if a model is remote and proxy the request (note that this change does not include POST `/api/embed`) * Various changes for POST `/api/show` and GET `/api/tags` to support remote models * Support in POST `/api/create` for creating a remote model definition (note that this change does not include support for modifying these changes in a Modelfile) --- <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 00:43:10 -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#45026