Compare commits

...
Author SHA1 Message Date
hermes a9960f3854 fix: down/rm ANTES de detectar puertos
El down corria despues de Find-FreePort: los contenedores del deploy
previo seguian levantados al medir puertos -> elegia 3001/11435 y el
up re-creaba instancias desplazadas. Orden corregido: down primero
(volumenes preservados) y Find-FreePort ve el estado real.
2026-09-12 21:22:42 +02:00
hermes ebc420656a fix: progreso del download GGUF y 1 solo mensaje de modelo (#12)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
2026-09-12 21:21:23 +02:00
hermes e39fabd31c fix: num_ctx 16384 en el modelo (el 4096 da 400 en Open WebUI) (#11)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
2026-09-12 21:19:29 +02:00
4 changed files with 50 additions and 25 deletions

No files matched your search

+12 -6
View File
@@ -80,6 +80,9 @@ if ($TotalRamGb -lt 3.5) {
} }
Ok "RAM: $TotalRamGb GB" Ok "RAM: $TotalRamGb GB"
# --- Tumbar deploy previo (antes de detectar puertos) -----------------------
cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1'
# --- Auto-detect Ollama port ------------------------------------------------ # --- Auto-detect Ollama port ------------------------------------------------
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
@@ -96,7 +99,6 @@ Write-Host ''
# --- 1. Arrancar Ollama (Docker) ------------------------------------------- # --- 1. Arrancar Ollama (Docker) -------------------------------------------
Warn '[1/3] Arrancando Ollama (IA local)...' Warn '[1/3] Arrancando Ollama (IA local)...'
cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1'
$running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-hermes-ollama' $running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-hermes-ollama'
if (-not $running) { if (-not $running) {
docker run -d --name d0a1-hermes-ollama ` docker run -d --name d0a1-hermes-ollama `
@@ -131,17 +133,17 @@ $HfUrls = @(
'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'
) )
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
foreach ($Url in $HfUrls) { foreach ($Url in $HfUrls) {
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...' curl.exe -# -L --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) { break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..."
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
} }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...' 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
@@ -151,7 +153,11 @@ if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
# Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas) # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...' Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-hermes-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-hermes-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true } 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) { if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).' Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
+12 -6
View File
@@ -80,6 +80,9 @@ if ($TotalRamGb -lt 3.5) {
} }
Ok "RAM: $TotalRamGb GB" Ok "RAM: $TotalRamGb GB"
# --- Tumbar deploy previo (antes de detectar puertos) -----------------------
cmd /c docker rm -f d0a1-openclaw-ollama '>' NUL '2>&1'
# --- Auto-detect Ollama port ------------------------------------------------ # --- Auto-detect Ollama port ------------------------------------------------
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
@@ -96,7 +99,6 @@ Write-Host ''
# --- 1. Arrancar Ollama (Docker) ------------------------------------------- # --- 1. Arrancar Ollama (Docker) -------------------------------------------
Warn '[1/3] Arrancando Ollama (IA local)...' Warn '[1/3] Arrancando Ollama (IA local)...'
cmd /c docker rm -f d0a1-openclaw-ollama '>' NUL '2>&1'
$running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-openclaw-ollama' $running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-openclaw-ollama'
if (-not $running) { if (-not $running) {
docker run -d --name d0a1-openclaw-ollama ` docker run -d --name d0a1-openclaw-ollama `
@@ -131,17 +133,17 @@ $HfUrls = @(
'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'
) )
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
foreach ($Url in $HfUrls) { foreach ($Url in $HfUrls) {
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...' curl.exe -# -L --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) { break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..."
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
} }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...' 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
@@ -151,7 +153,11 @@ if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
# Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas) # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...' Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true } 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) { if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).' Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
+14 -8
View File
@@ -86,6 +86,11 @@ if ($TotalRamGb -lt 3.5) {
} }
Ok "RAM: $TotalRamGb GB" Ok "RAM: $TotalRamGb GB"
# --- Tumbar deploy previo (antes de detectar puertos) ----------------------
# Mantiene los volumenes (el modelo ya descargado no se re-descarga) y libera
# los puertos para que Find-FreePort vea el estado REAL tras el down.
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
# --- Auto-detect ports ---------------------------------------------------- # --- Auto-detect ports ----------------------------------------------------
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
$WebUiPort = Find-FreePort 3000 $WebUiPort = Find-FreePort 3000
@@ -116,9 +121,6 @@ if ($WebUiPort -ne 3000) { Warn "Puerto 3000 ocupado, usando $WebUiPort" }
Write-Host '' Write-Host ''
# --- Deploy ---------------------------------------------------------------- # --- Deploy ----------------------------------------------------------------
# Si hay un deploy previo del pack, tumbarlo primero (mantiene los volumenes:
# el modelo ya descargado no se re-descarga) para que los nuevos puertos apliquen.
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
Warn 'Descargando contenedores (2-3 min la primera vez)...' Warn 'Descargando contenedores (2-3 min la primera vez)...'
$env:OLLAMA_PORT = "$OllamaPort" $env:OLLAMA_PORT = "$OllamaPort"
$env:WEBUI_PORT = "$WebUiPort" $env:WEBUI_PORT = "$WebUiPort"
@@ -148,17 +150,17 @@ $HfUrls = @(
'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'
) )
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
foreach ($Url in $HfUrls) { foreach ($Url in $HfUrls) {
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...' curl.exe -# -L --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) { break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..."
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
} }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...' 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
@@ -168,7 +170,11 @@ if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
# Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas) # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...' Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true } 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) { if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).' Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'
+12 -5
View File
@@ -120,6 +120,9 @@ if (-not (Test-Path $EnvFile)) {
} }
# --- Auto-detect ports ---------------------------------------------------- # --- Auto-detect ports ----------------------------------------------------
# --- Tumbar deploy previo (antes de detectar puertos) ----------------------
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
$WpPort = Find-FreePort 8080 $WpPort = Find-FreePort 8080
$WebUiPort = Find-FreePort 3000 $WebUiPort = Find-FreePort 3000
@@ -184,17 +187,17 @@ $HfUrls = @(
'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'
) )
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
foreach ($Url in $HfUrls) { foreach ($Url in $HfUrls) {
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...' curl.exe -# -L --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) { break } if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
Warn "Mirror no accesible, probando el siguiente..."
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
} }
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
Info 'Importando modelo en Ollama...' 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
@@ -204,7 +207,11 @@ if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
# Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas) # Ultimo recurso: pull directo (1 intento, ya sin esperar 3 rondas)
Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...' Warn 'HuggingFace no accesible. Probando el registry de Ollama (ultimo recurso)...'
docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true } 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) { if (-not $PullOk) {
Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).' Err 'No se pudo descargar el modelo (ni HuggingFace ni registry).'