feat: Separate Local and Networked Ollama providers

- Add distinct 'Local Ollama' and 'Networked Ollama' options in dropdown
- Local uses localhost, Networked uses remote endpoints with load balancing
- Color-coded: Yellow for Local, Blue for Networked
- Icons:  Local,  Networked
- Backend supports OLLAMA_LOCAL_URL and OLLAMA_NETWORK_URLS env vars
- Updated installer to generate new env var format
- Legacy 'ollama' provider still works for backward compatibility
This commit is contained in:
2025-11-28 14:34:18 -05:00
parent 523eba9613
commit 707232ff83
3 changed files with 188 additions and 87 deletions

View File

@@ -425,24 +425,24 @@ if (-not (Test-Path $configDir)) {
New-Item -ItemType Directory -Path $configDir -Force | Out-Null
}
# Build OLLAMA_ENDPOINTS string
$ollamaEndpoints = @()
# Build OLLAMA_LOCAL_URL and OLLAMA_NETWORK_URLS strings
$ollamaLocalUrl = ""
$ollamaNetworkUrls = @()
if ($config.local.enabled) {
$ollamaEndpoints += $config.local.url
$ollamaLocalUrl = $config.local.url
}
foreach ($ep in $config.networked.endpoints) {
if ($ep.enabled) {
if ($ep.prefer_high_speed -and $ep.alt_url) {
$ollamaEndpoints += $ep.alt_url
$ollamaNetworkUrls += $ep.alt_url
} else {
$ollamaEndpoints += $ep.url
$ollamaNetworkUrls += $ep.url
}
}
}
$ollamaEndpointsStr = $ollamaEndpoints -join ","
if ([string]::IsNullOrEmpty($ollamaEndpointsStr)) {
$ollamaEndpointsStr = "http://localhost:11434"
}
$ollamaNetworkUrlsStr = $ollamaNetworkUrls -join ","
# Generate .env file
Write-Step "Generating .env file..."
@@ -454,8 +454,11 @@ $envLines = @(
"# Generated by installer on $timestamp",
"# ======================================================================",
"",
"# Ollama Endpoints (comma-separated for load balancing)",
"OLLAMA_ENDPOINTS=$ollamaEndpointsStr",
"# Local Ollama (on this machine)",
"OLLAMA_LOCAL_URL=$ollamaLocalUrl",
"",
"# Networked Ollama (comma-separated for load balancing)",
"OLLAMA_NETWORK_URLS=$ollamaNetworkUrlsStr",
"",
"# Load Balancing Strategy: round-robin, failover, random",
"LOAD_BALANCE_STRATEGY=$($config.load_balancing)",