From bf995b162e679ec25dc53c2891fc69188acd94cd Mon Sep 17 00:00:00 2001 From: Shahovalov MIkhail Date: Mon, 13 Apr 2026 09:53:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83?= =?UTF-8?q?=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20Opencode=20=D0=B8=20=D1=81?= =?UTF-8?q?=D1=86=D0=B5=D0=BD=D0=B0=D1=80=D0=B8=D1=8F=20=D0=BD=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .opencode.json | 1 + scripts/setup-ollama-agents.ps1 | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .opencode.json create mode 100644 scripts/setup-ollama-agents.ps1 diff --git a/.opencode.json b/.opencode.json new file mode 100644 index 0000000..7a9541e --- /dev/null +++ b/.opencode.json @@ -0,0 +1 @@ +{ "$schema": "https://opencode.ai/config.json", "model": "ollama/qwen3.5-agent" } diff --git a/scripts/setup-ollama-agents.ps1 b/scripts/setup-ollama-agents.ps1 new file mode 100644 index 0000000..67bf16d --- /dev/null +++ b/scripts/setup-ollama-agents.ps1 @@ -0,0 +1,37 @@ + +# setup-ollama-agents.ps1 + +param( + [int]$QwenCtx = 32768, + [int]$GemmaCtx = 16384 +) + +function Create-OllamaModel { + param( + [string]$Base, + [string]$Name, + [int]$NumCtx, + [string]$ModelfilePath + ) + + Write-Host "=== Создаём $Name (num_ctx=$NumCtx) ===" -ForegroundColor Cyan + + "FROM $Base`nPARAMETER num_ctx $NumCtx" | Out-File -Encoding utf8 $ModelfilePath + + ollama create $Name -f $ModelfilePath + + if ($LASTEXITCODE -eq 0) { + Write-Host "OK: $Name создан" -ForegroundColor Green + } else { + Write-Host "FAIL: $Name не создан" -ForegroundColor Red + } + + Remove-Item $ModelfilePath -ErrorAction SilentlyContinue +} + +Create-OllamaModel -Base "qwen3.5" -Name "qwen3.5-agent" -NumCtx $QwenCtx -ModelfilePath "Modelfile.qwen" +Create-OllamaModel -Base "gemma4" -Name "gemma4-agent" -NumCtx $GemmaCtx -ModelfilePath "Modelfile.gemma" + +Write-Host "" +Write-Host "Проверка:" -ForegroundColor Yellow +ollama list | Select-String "agent" \ No newline at end of file