@echo off
setlocal
cd /d "%~dp0"
title ComputePool AI Model Setup
echo.
echo Preparing ComputePool local AI model...
echo This may take several minutes on the first run.
echo.
where ollama >nul 2>nul
if errorlevel 1 (
  where winget >nul 2>nul
  if errorlevel 1 (
    echo Windows winget is not available.
    echo Please install Ollama from https://ollama.com/download/windows
    echo Then run this file again.
    echo.
    pause
    exit /b 1
  )
  echo Installing Ollama...
  winget install --id Ollama.Ollama -e --accept-source-agreements --accept-package-agreements
  if errorlevel 1 (
    echo.
    echo Ollama installation failed. Please install it manually:
    echo https://ollama.com/download/windows
    pause
    exit /b 1
  )
)
echo.
echo Downloading default model: qwen2.5:3b
ollama pull qwen2.5:3b
if errorlevel 1 (
  echo.
  echo Model download failed. Please check your network and run this file again.
  pause
  exit /b 1
)
echo.
echo ComputePool local AI model is ready.
pause
