@echo off
setlocal enabledelayedexpansion
title Arminius AI Benchmark
color 0A
cd /d "%~dp0"

echo:
echo   ================================================================
echo   Arminius AI Benchmark - Pure Vulkan Rendering Pipeline
echo   ================================================================
echo:
echo   No CUDA. No ML frameworks. Just your GPU.
echo:

if not exist "arminius.exe" goto noexe
if not exist "model\index.json" goto needmodel
goto menu

:noexe
echo   ERROR: arminius.exe not found in this directory.
echo   Make sure you extracted the full zip file.
pause
exit /b 1

:needmodel
echo   Model not found. Downloading Gemma 3 4B vindex format...
echo   This is a one-time download (~4 GB). Please wait...
echo:
if not exist "model" mkdir model
arminius.exe --download-model --vindex model
if errorlevel 1 goto modelfail
echo:
echo   Model downloaded successfully.
echo:
goto menu

:modelfail
echo:
echo   ERROR: Model download failed. Check your internet connection.
pause
exit /b 1

:menu
echo:
echo   Choose mode:
echo:
echo     [1] Benchmark (score your GPU, upload to leaderboard)
echo     [2] Chat (interactive conversation with the model)
echo     [3] Exit
echo:
set /p "choice=  Your choice (1/2/3): "

if "!choice!"=="3" exit /b 0
if "!choice!"=="2" goto chat

echo:
set /p "tag=  Enter your 3-letter tag (e.g. your initials): "
if "!tag!"=="" set "tag=AAA"

echo:
echo   Running benchmark on your GPU...
echo   This takes about 30-60 seconds.
echo:

arminius.exe --benchmark --vindex model --tag !tag!

echo:
echo   Done! Your browser should open with your result.
echo:
pause
exit /b 0

:chat
echo:
echo   Starting chat mode...
echo:
arminius.exe --chat --vindex model --inspect
pause
exit /b 0
