Repository navigation
Expand file tree
/
Copy pathSTART-HERE.bat
More file actions
75 lines (68 loc) · 2.95 KB
/
Copy pathSTART-HERE.bat
File metadata and controls
75 lines (68 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@echo off
rem colibri: one-step setup and start for Windows. Double-click this file.
rem
rem First run: finds your hardware, recommends a model that fits, gets the
rem engine (prebuilt, or built with MSYS2 when it is installed), downloads the
rem model (safe to interrupt: run this file again to continue), then opens the
rem dashboard in your browser.
rem Later runs: start colibri straight away.
rem
rem Options are passed through to `coli setup`, for example:
rem START-HERE.bat --model qwen3-coder-30b --dir D:\colibri-models
rem START-HERE.bat --reconfigure choose another model
rem START-HERE.bat --no-gpu CPU only
rem Stop: close this window, or press Ctrl+C in it.
setlocal
title colibri
cd /d "%~dp0"
set "COLI_LAUNCHER="
if exist "%~dp0c\coli" set "COLI_LAUNCHER=%~dp0c\coli"
if not defined COLI_LAUNCHER if exist "%~dp0coli" set "COLI_LAUNCHER=%~dp0coli"
if not defined COLI_LAUNCHER (
echo This file belongs at the top of the colibri folder, next to the c folder.
goto :hold_fail
)
rem A Python 3.10 or newer. The py launcher first: it stays right when several
rem versions are installed. `python` alone can be the Microsoft Store alias,
rem which prints nothing useful, so every candidate is tried with a version check.
set "COLI_PY_EXE="
set "COLI_PY_ARG="
py -3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)" >nul 2>&1 && (set "COLI_PY_EXE=py" & set "COLI_PY_ARG=-3")
if not defined COLI_PY_EXE python -c "import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)" >nul 2>&1 && set "COLI_PY_EXE=python"
if not defined COLI_PY_EXE call :find_user_python
if not defined COLI_PY_EXE goto :no_python
:run
"%COLI_PY_EXE%" %COLI_PY_ARG% "%COLI_LAUNCHER%" setup %*
set "COLI_RC=%ERRORLEVEL%"
if "%COLI_RC%"=="0" exit /b 0
echo.
echo colibri stopped (code %COLI_RC%). Read the message above; running START-HERE.bat
echo again continues where it stopped.
goto :hold_fail
:find_user_python
for %%V in (314 313 312 311 310) do (
if not defined COLI_PY_EXE if exist "%LOCALAPPDATA%\Programs\Python\Python%%V\python.exe" set "COLI_PY_EXE=%LOCALAPPDATA%\Programs\Python\Python%%V\python.exe"
)
exit /b 0
:no_python
echo colibri needs Python 3.10 or newer, and it was not found.
echo The engine itself is plain C; Python runs the setup, the launcher and the API.
echo.
where winget >nul 2>&1
if errorlevel 1 goto :manual_python
choice /c YN /m "Install Python 3.12 now with winget, for your user only"
if errorlevel 2 goto :manual_python
winget install -e --id Python.Python.3.12 --scope user --accept-source-agreements --accept-package-agreements
call :find_user_python
if defined COLI_PY_EXE goto :run
echo.
echo Python was installed, but this window cannot see it yet. Close it and
echo double-click START-HERE.bat again.
goto :hold_fail
:manual_python
echo Install it from https://www.python.org/downloads/ and tick
echo "Add python.exe to PATH" in the installer, then double-click START-HERE.bat again.
:hold_fail
echo.
pause
exit /b 1