feat: modelo por defecto qwen3:4b (llama3.2 3B enredaba con las tools)

'hola' -> ask_user con preguntas absurdas: llama3.2 3B no sabe
manejar las builtin tools agentic de Open WebUI. Qwen3 4B si
(tool-calling nativo solido, mejor en espanol, Apache-2.0).
- GGUF oficial no-gated: Qwen/Qwen3-4B-GGUF Q4_K_M (2.5 GB) +
  mirror unsloth
- num_ctx 16384 igual; threshold de validacion 2.4 GB
- llama3.2:3b queda como alternativa ligera
This commit is contained in:
hermes committed 2026-09-12 22:05:21 +02:00
1 parent 51258f6889
commit 143fdfcafd
11 files changed
+59 -59

No files matched your search

+12 -12
View File
@@ -166,27 +166,27 @@ $ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
# --- Modelo ya presente? (volumen persistente: no re-descargar) ------------
$ModelList = docker exec d0a1-ollama ollama list 2>$null
if ("$ModelList" -match 'llama3.2:3b') {
Info 'Modelo llama3.2:3b ya descargado (volumen intacto). Omitiendo descarga.'
if ("$ModelList" -match 'qwen3:4b') {
Info 'Modelo qwen3:4b ya descargado (volumen intacto). Omitiendo descarga.'
} else {
# --- Modelo: HF primero (CDN propio, rapido) y registry de Ollama como ultimo recurso ---
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf'
$Gguf = Join-Path $ScriptDir 'qwen3-4b-q4.gguf'
$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/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
'https://huggingface.co/Qwen/Qwen3-4B-GGUF/resolve/main/Qwen3-4B-Q4_K_M.gguf',
'https://huggingface.co/unsloth/Qwen3-4B-GGUF/resolve/main/Qwen3-4B-Q4_K_M.gguf'
)
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
Info 'Descargando modelo de IA (qwen3:4b, ~2.5 GB)...'
foreach ($Url in $HfUrls) {
curl.exe -# -L --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 2400000000) { break }
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 2400000000) {
Info 'Importando modelo en Ollama...'
docker cp "$Gguf" d0a1-ollama:/root/.ollama/import.gguf
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'
docker exec d0a1-ollama sh -c 'printf "FROM /root/.ollama/import.gguf\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create qwen3:4b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
@@ -195,11 +195,11 @@ if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
} else {
# 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
docker exec @ProxyEnv d0a1-ollama ollama pull qwen3:4b
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'
docker exec d0a1-ollama sh -c 'printf "FROM qwen3:4b\\nPARAMETER num_ctx 16384\\n" > /tmp/mf && ollama create qwen3:4b -f /tmp/mf'
}
}
if (-not $PullOk) {
@@ -224,7 +224,7 @@ if ($Mode -eq 'local') {
}
Write-Host ''
Write-Host " ${Bold}Modelos alternativos:${NC}"
Write-Host ' docker exec d0a1-ollama ollama pull qwen3:4b # Mejor en espanol + razonamiento (4 GB RAM)'
Write-Host ' docker exec d0a1-ollama ollama pull llama3.2:3b # Mas ligero (2 GB RAM)'
Write-Host ' docker exec d0a1-ollama ollama pull qwen3:8b # Mas calidad (6 GB RAM)'
Write-Host ''
Write-Host " ${Bold}Parar:${NC} .\deploy.ps1 stop"