From a7ff042c1524e53935e8a9b217383fbd2a1fed24 Mon Sep 17 00:00:00 2001 From: Viktor Antropov Date: Thu, 5 Nov 2026 17:37:30 +0300 Subject: [PATCH] start_llm: service-first (port 11434), then kit, then per-user - works under any account when ollama already alive --- delivery/start_llm.bat | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/delivery/start_llm.bat b/delivery/start_llm.bat index b8bb00c..fb7e5db 100644 --- a/delivery/start_llm.bat +++ b/delivery/start_llm.bat @@ -1,24 +1,32 @@ @echo off -REM Ollama: kit (shared, shift computers) or per-user install (one-user computers) +REM Ollama: check running service first (may run under another account), +REM then kit copy, then per-user install cd /d %~dp0 -set "KIT=%~dp0..\..\kit" -set "OLLEXE=" -set "OLLMODELS=" -if exist "%KIT%\Ollama\ollama.exe" set "OLLEXE=%KIT%\Ollama\ollama.exe" -if exist "%KIT%\Ollama\ollama.exe" set "OLLMODELS=%KIT%\models" -if not defined OLLEXE set "OLLEXE=%LocalAppData%\Programs\Ollama\ollama.exe" -if not defined OLLEXE if exist "%OLLEXE%" set "OLLMODELS=%UserProfile%\.ollama\models" -if not exist "%OLLEXE%" ( - echo Ollama not found: run OllamaSetup.exe from delivery (double-click, Next), - echo then install_ollama_model.bat, then run start_all.bat again - pause - exit /b 1 -) netstat -ano 2>nul | findstr ":11434" | findstr "LISTENING" >nul 2>nul if %errorlevel%==0 goto :llm_ok -set "OLLAMA_MODELS=%OLLMODELS%" -if defined OLLMODELS set "OLLAMA_MODELS=%OLLMODELS%" +set "KIT=%~dp0..\..\kit" +if not exist "%KIT%\Ollama\ollama.exe" goto :try_local +set "OLLAMA_MODELS=%KIT%\models" +start "Ollama (docchecker)" /MIN "%KIT%\Ollama\ollama.exe" serve +timeout /t 6 /nobreak >nul +goto :verify +:try_local +set "OLLEXE=%LocalAppData%\Programs\Ollama\ollama.exe" +if not exist "%OLLEXE%" goto :not_found +set "OLLAMA_MODELS=" start "Ollama (docchecker)" /MIN "%OLLEXE%" serve timeout /t 6 /nobreak >nul +goto :verify +:verify +netstat -ano 2>nul | findstr ":11434" | findstr "LISTENING" >nul 2>nul +if %errorlevel%==0 goto :llm_ok +echo Ollama did not start - see its window, or run: "%OLLEXE%" serve +pause +exit /b 1 +:not_found +echo Ollama not found: run OllamaSetup.exe from delivery (double-click, Next), +echo then install_ollama_model.bat, then run start_all.bat again +pause +exit /b 1 :llm_ok -echo Ollama: работает \ No newline at end of file +echo Ollama: running \ No newline at end of file