32 lines
1.1 KiB
Batchfile
32 lines
1.1 KiB
Batchfile
@echo off
|
|
REM Ollama: check running service first (may run under another account),
|
|
REM then kit copy, then per-user install
|
|
cd /d %~dp0
|
|
netstat -ano 2>nul | findstr ":11434" | findstr "LISTENING" >nul 2>nul
|
|
if %errorlevel%==0 goto :llm_ok
|
|
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: running |