Compare commits

...
Author SHA1 Message Date
hermes 99f0e847d9 fix: num_ctx 16384 en el modelo (el 4096 da 400 en Open WebUI)
El primer mensaje con plantilla del sistema (~7k tokens) excedia el
contexto default de 4096 -> 400 exceed_context_size. Tras el import HF
y tras el pull del registry, re-crea el tag con PARAMETER num_ctx 16384
(FROM hereda pesos; verificado con ollama show: num_ctx 16384).
2026-09-12 21:19:18 +02:00
hermes 350d55c434 feat: modelo via HF primero, registry de Ollama como ultimo recurso (#10)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
2026-09-12 21:11:02 +02:00
4 changed files with 104 additions and 100 deletions

No files matched your search

+26 -25
View File
@@ -125,45 +125,46 @@ Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial): # Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @() $ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") } if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false # --- Modelo: HF primero (CDN propio, rapido) y registry de Ollama como ultimo recurso ---
foreach ($Attempt in 1..3) { $Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } $HfUrls = @(
docker exec @ProxyEnv d0a1-hermes-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) ---
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
$Urls = @(
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf', 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf' 'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
) )
$DlOk = $false foreach ($Url in $HfUrls) {
foreach ($Url in $Urls) { Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { $DlOk = $true; break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..." Warn "Mirror no accesible, probando el siguiente..."
} Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($DlOk) { }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...'
docker cp "$Gguf" d0a1-hermes-ollama:/root/.ollama/import.gguf docker cp "$Gguf" d0a1-hermes-ollama:/root/.ollama/import.gguf
docker exec d0a1-hermes-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf' docker exec d0a1-hermes-ollama sh -c 'printf "FROM /root/.ollama/import.gguf\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0) $CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-hermes-ollama rm -f /root/.ollama/import.gguf | Out-Null docker exec d0a1-hermes-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true } $PullOk = $CreateOk
else { Err 'Fallo al importar el modelo desde el GGUF.' } if (-not $CreateOk) { Err 'Fallo al importar el modelo desde el GGUF.' }
} else { } else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).' # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-hermes-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) {
$PullOk = $true
# Contexto ampliado (el default 4096 da 400 en Open WebUI con prompts largos)
docker exec d0a1-hermes-ollama sh -c 'printf "FROM llama3.2:3b\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
}
}
if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
if (-not $env:HTTPS_PROXY) { if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:' Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)' Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps' Write-Host ' .\deploy.ps1 vps'
} }
exit 1 exit 1
}
} }
Ok "Ollama corriendo en http://localhost:${OllamaPort}" Ok "Ollama corriendo en http://localhost:${OllamaPort}"
+26 -25
View File
@@ -125,45 +125,46 @@ Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial): # Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @() $ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") } if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false # --- Modelo: HF primero (CDN propio, rapido) y registry de Ollama como ultimo recurso ---
foreach ($Attempt in 1..3) { $Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } $HfUrls = @(
docker exec @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) ---
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
$Urls = @(
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf', 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf' 'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
) )
$DlOk = $false foreach ($Url in $HfUrls) {
foreach ($Url in $Urls) { Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { $DlOk = $true; break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..." Warn "Mirror no accesible, probando el siguiente..."
} Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($DlOk) { }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...'
docker cp "$Gguf" d0a1-openclaw-ollama:/root/.ollama/import.gguf docker cp "$Gguf" d0a1-openclaw-ollama:/root/.ollama/import.gguf
docker exec d0a1-openclaw-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf' docker exec d0a1-openclaw-ollama sh -c 'printf "FROM /root/.ollama/import.gguf\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0) $CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-openclaw-ollama rm -f /root/.ollama/import.gguf | Out-Null docker exec d0a1-openclaw-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true } $PullOk = $CreateOk
else { Err 'Fallo al importar el modelo desde el GGUF.' } if (-not $CreateOk) { Err 'Fallo al importar el modelo desde el GGUF.' }
} else { } else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).' # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) {
$PullOk = $true
# Contexto ampliado (el default 4096 da 400 en Open WebUI con prompts largos)
docker exec d0a1-openclaw-ollama sh -c 'printf "FROM llama3.2:3b\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
}
}
if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
if (-not $env:HTTPS_PROXY) { if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:' Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)' Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps' Write-Host ' .\deploy.ps1 vps'
} }
exit 1 exit 1
}
} }
Ok "Ollama corriendo en http://localhost:${OllamaPort}" Ok "Ollama corriendo en http://localhost:${OllamaPort}"
+26 -25
View File
@@ -142,45 +142,46 @@ while ($true) {
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial): # Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @() $ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") } if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false # --- Modelo: HF primero (CDN propio, rapido) y registry de Ollama como ultimo recurso ---
foreach ($Attempt in 1..3) { $Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } $HfUrls = @(
docker exec @ProxyEnv d0a1-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) ---
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
$Urls = @(
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf', 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf' 'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
) )
$DlOk = $false foreach ($Url in $HfUrls) {
foreach ($Url in $Urls) { Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { $DlOk = $true; break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..." Warn "Mirror no accesible, probando el siguiente..."
} Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($DlOk) { }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...'
docker cp "$Gguf" d0a1-ollama:/root/.ollama/import.gguf docker cp "$Gguf" d0a1-ollama:/root/.ollama/import.gguf
docker exec d0a1-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf' docker exec d0a1-ollama sh -c 'printf "FROM /root/.ollama/import.gguf\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0) $CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-ollama rm -f /root/.ollama/import.gguf | Out-Null docker exec d0a1-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true } $PullOk = $CreateOk
else { Err 'Fallo al importar el modelo desde el GGUF.' } if (-not $CreateOk) { Err 'Fallo al importar el modelo desde el GGUF.' }
} else { } else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).' # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) {
$PullOk = $true
# Contexto ampliado (el default 4096 da 400 en Open WebUI con prompts largos)
docker exec d0a1-ollama sh -c 'printf "FROM llama3.2:3b\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
}
}
if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
if (-not $env:HTTPS_PROXY) { if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:' Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)' Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps' Write-Host ' .\deploy.ps1 vps'
} }
exit 1 exit 1
}
} }
# --- Done ------------------------------------------------------------------- # --- Done -------------------------------------------------------------------
+26 -25
View File
@@ -178,45 +178,46 @@ while ($true) {
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial): # Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @() $ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") } if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false # --- Modelo: HF primero (CDN propio, rapido) y registry de Ollama como ultimo recurso ---
foreach ($Attempt in 1..3) { $Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } $HfUrls = @(
docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) ---
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
$Urls = @(
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf', 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf' 'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
) )
$DlOk = $false foreach ($Url in $HfUrls) {
foreach ($Url in $Urls) { Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { $DlOk = $true; break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..." Warn "Mirror no accesible, probando el siguiente..."
} Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($DlOk) { }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...'
docker cp "$Gguf" d0a1-wp-ollama:/root/.ollama/import.gguf docker cp "$Gguf" d0a1-wp-ollama:/root/.ollama/import.gguf
docker exec d0a1-wp-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf' docker exec d0a1-wp-ollama sh -c 'printf "FROM /root/.ollama/import.gguf\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0) $CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-wp-ollama rm -f /root/.ollama/import.gguf | Out-Null docker exec d0a1-wp-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true } $PullOk = $CreateOk
else { Err 'Fallo al importar el modelo desde el GGUF.' } if (-not $CreateOk) { Err 'Fallo al importar el modelo desde el GGUF.' }
} else { } else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).' # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) {
$PullOk = $true
# Contexto ampliado (el default 4096 da 400 en Open WebUI con prompts largos)
docker exec d0a1-wp-ollama sh -c 'printf "FROM llama3.2:3b\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
}
}
if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
if (-not $env:HTTPS_PROXY) { if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:' Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)' Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps' Write-Host ' .\deploy.ps1 vps'
} }
exit 1 exit 1
}
} }
# --- Done ------------------------------------------------------------------- # --- Done -------------------------------------------------------------------