fix(ollama-local): support custom host URL for remote Ollama servers (closes #578)

Add a shared resolveOllamaLocalHost() helper and wire it through the
executor, models/validate/test routes, so users can point ollama-local
at a remote Ollama instance instead of being locked to localhost:11434.

Also expose the host as an "Ollama Host URL" field in AddApiKeyModal
(empty = default localhost:11434), making the option reachable from the
dashboard without hand-editing db.json.

Co-authored-by: anuragg-saxenaa <anuragg.saxenaa@gmail.com>
Made-with: Cursor
This commit is contained in:
anuragg-saxenaa
2026-04-22 10:42:34 +07:00
committed by decolua
parent 94ab0d715d
commit 4638cf0e81
6 changed files with 77 additions and 31 deletions

View File

@@ -339,3 +339,10 @@ export const PROVIDERS = {
noAuth: true
},
};
export const OLLAMA_LOCAL_DEFAULT_HOST = "http://localhost:11434";
export function resolveOllamaLocalHost(credentials) {
const raw = credentials?.providerSpecificData?.baseUrl?.trim();
return (raw || OLLAMA_LOCAL_DEFAULT_HOST).replace(/\/$/, "");
}