Compare commits

..
Author SHA1 Message Date
hermes cf6ba1d32b fix: limite de RAM 6G para ollama
Sin cap, ollama crece sin freno (visto en docker stats: 3.94 GB y
subiendo). Cap 6G suficiente para llama3.2:3b Q4 + ctx 16k:
- compose (openwebui, wordpress): deploy.resources.limits.memory 6G
- docker run (hermes, openclaw): --memory 6g
2026-09-12 21:32:01 +02:00
4 changed files with 4 additions and 72 deletions

No files matched your search

+1 -16
View File
@@ -83,19 +83,6 @@ Ok "RAM: $TotalRamGb GB"
# --- Tumbar deploy previo (antes de detectar puertos) ----------------------- # --- Tumbar deploy previo (antes de detectar puertos) -----------------------
cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1' cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1'
# --- GPU NVIDIA? (si hay, Ollama la usa y va 5-10x mas rapido) ---------------
$HasGpu = $false
if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) {
$GpuInfo = & nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>$null
if ($LASTEXITCODE -eq 0 -and $GpuInfo) {
$HasGpu = $true
$GpuName = ($GpuInfo -split ',')[0].Trim()
Info "GPU NVIDIA detectada: $GpuName (aceleracion activada)"
}
}
if (-not $HasGpu) {
Warn 'Sin GPU NVIDIA: modo CPU (~10-20 tokens/s). Con una GPU NVIDIA va 5-10x mas rapido.'
}
# --- Auto-detect Ollama port ------------------------------------------------ # --- Auto-detect Ollama port ------------------------------------------------
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
@@ -114,9 +101,7 @@ Write-Host ''
Warn '[1/3] Arrancando Ollama (IA local)...' Warn '[1/3] Arrancando Ollama (IA local)...'
$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) {
$GpuArgs = @() docker run -d --name d0a1-hermes-ollama --memory 6g `
if ($HasGpu) { $GpuArgs = @('--gpus', 'all') }
docker run -d --name d0a1-hermes-ollama --memory 6g @GpuArgs `
-p "${OllamaPort}:11434" ` -p "${OllamaPort}:11434" `
-v d0a1_hermes_ollama:/root/.ollama ` -v d0a1_hermes_ollama:/root/.ollama `
-e OLLAMA_HOST=0.0.0.0 ` -e OLLAMA_HOST=0.0.0.0 `
+1 -16
View File
@@ -83,19 +83,6 @@ Ok "RAM: $TotalRamGb GB"
# --- Tumbar deploy previo (antes de detectar puertos) ----------------------- # --- Tumbar deploy previo (antes de detectar puertos) -----------------------
cmd /c docker rm -f d0a1-openclaw-ollama '>' NUL '2>&1' cmd /c docker rm -f d0a1-openclaw-ollama '>' NUL '2>&1'
# --- GPU NVIDIA? (si hay, Ollama la usa y va 5-10x mas rapido) ---------------
$HasGpu = $false
if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) {
$GpuInfo = & nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>$null
if ($LASTEXITCODE -eq 0 -and $GpuInfo) {
$HasGpu = $true
$GpuName = ($GpuInfo -split ',')[0].Trim()
Info "GPU NVIDIA detectada: $GpuName (aceleracion activada)"
}
}
if (-not $HasGpu) {
Warn 'Sin GPU NVIDIA: modo CPU (~10-20 tokens/s). Con una GPU NVIDIA va 5-10x mas rapido.'
}
# --- Auto-detect Ollama port ------------------------------------------------ # --- Auto-detect Ollama port ------------------------------------------------
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
@@ -114,9 +101,7 @@ Write-Host ''
Warn '[1/3] Arrancando Ollama (IA local)...' Warn '[1/3] Arrancando Ollama (IA local)...'
$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) {
$GpuArgs = @() docker run -d --name d0a1-openclaw-ollama --memory 6g `
if ($HasGpu) { $GpuArgs = @('--gpus', 'all') }
docker run -d --name d0a1-openclaw-ollama --memory 6g @GpuArgs `
-p "${OllamaPort}:11434" ` -p "${OllamaPort}:11434" `
-v d0a1_openclaw_ollama:/root/.ollama ` -v d0a1_openclaw_ollama:/root/.ollama `
-e OLLAMA_HOST=0.0.0.0 ` -e OLLAMA_HOST=0.0.0.0 `
+1 -20
View File
@@ -91,19 +91,6 @@ Ok "RAM: $TotalRamGb GB"
# los puertos para que Find-FreePort vea el estado REAL tras el down. # los puertos para que Find-FreePort vea el estado REAL tras el down.
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1' cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
# --- GPU NVIDIA? (si hay, Ollama la usa y va 5-10x mas rapido) ---------------
$HasGpu = $false
if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) {
$GpuInfo = & nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>$null
if ($LASTEXITCODE -eq 0 -and $GpuInfo) {
$HasGpu = $true
$GpuName = ($GpuInfo -split ',')[0].Trim()
Info "GPU NVIDIA detectada: $GpuName (aceleracion activada)"
}
}
if (-not $HasGpu) {
Warn 'Sin GPU NVIDIA: modo CPU (~10-20 tokens/s). Con una GPU NVIDIA va 5-10x mas rapido.'
}
# --- Auto-detect ports ---------------------------------------------------- # --- Auto-detect ports ----------------------------------------------------
$OllamaPort = Find-FreePort 11434 $OllamaPort = Find-FreePort 11434
$WebUiPort = Find-FreePort 3000 $WebUiPort = Find-FreePort 3000
@@ -137,13 +124,7 @@ Write-Host ''
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"
$ComposeArgs = @('-f', $ComposeFile) docker compose -f $ComposeFile up -d
if ($HasGpu) {
$OverrideFile = Join-Path $ScriptDir 'docker-compose.gpu.yml'
Set-Content -Path $OverrideFile -Value "services:`r`n ollama:`r`n gpus: all`r`n"
$ComposeArgs += @('-f', $OverrideFile)
}
docker compose @ComposeArgs up -d
if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE)."; exit 1 } if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE)."; exit 1 }
# --- Pull model ------------------------------------------------------------- # --- Pull model -------------------------------------------------------------
+1 -20
View File
@@ -119,19 +119,6 @@ if (-not (Test-Path $EnvFile)) {
Info "Contrasenas generadas en $EnvFile" Info "Contrasenas generadas en $EnvFile"
} }
# --- GPU NVIDIA? (si hay, Ollama la usa y va 5-10x mas rapido) ---------------
$HasGpu = $false
if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) {
$GpuInfo = & nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>$null
if ($LASTEXITCODE -eq 0 -and $GpuInfo) {
$HasGpu = $true
$GpuName = ($GpuInfo -split ',')[0].Trim()
Info "GPU NVIDIA detectada: $GpuName (aceleracion activada)"
}
}
if (-not $HasGpu) {
Warn 'Sin GPU NVIDIA: modo CPU (~10-20 tokens/s). Con una GPU NVIDIA va 5-10x mas rapido.'
}
# --- Auto-detect ports ---------------------------------------------------- # --- Auto-detect ports ----------------------------------------------------
# --- Tumbar deploy previo (antes de detectar puertos) ---------------------- # --- Tumbar deploy previo (antes de detectar puertos) ----------------------
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1' cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
@@ -174,13 +161,7 @@ cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
$env:OLLAMA_PORT = "$OllamaPort" $env:OLLAMA_PORT = "$OllamaPort"
$env:WP_PORT = "$WpPort" $env:WP_PORT = "$WpPort"
$env:WEBUI_PORT = "$WebUiPort" $env:WEBUI_PORT = "$WebUiPort"
$ComposeArgs = @('-f', $ComposeFile) docker compose -f $ComposeFile up -d
if ($HasGpu) {
$OverrideFile = Join-Path $ScriptDir 'docker-compose.gpu.yml'
Set-Content -Path $OverrideFile -Value "services:`r`n ollama:`r`n gpus: all`r`n"
$ComposeArgs += @('-f', $OverrideFile)
}
docker compose @ComposeArgs up -d
if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE)."; exit 1 } if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE)."; exit 1 }
# --- Pull model ------------------------------------------------------------- # --- Pull model -------------------------------------------------------------