-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-ollama.bat
50 lines (39 loc) · 1.41 KB
/
install-ollama.bat
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
@echo off
echo 🚀 Starting Ollama installation with CORS enabled...
:: Check for admin privileges
net session >nul 2>&1
if %errorLevel% == 0 (
echo ✓ Running with administrator privileges
) else (
echo ❌ Please run as administrator!
echo Right-click this file and select "Run as administrator"
pause
exit /b 1
)
:: Download Ollama installer
echo 📥 Downloading Ollama...
curl -L -o "%TEMP%\OllamaSetup.exe" "https://ollama.com/download/OllamaSetup.exe"
:: Install Ollama silently
echo 💿 Installing Ollama...
"%TEMP%\OllamaSetup.exe" /S
:: Wait for installation
timeout /t 5 /nobreak
:: Kill any running Ollama processes
echo 🔄 Configuring Ollama...
taskkill /F /IM "ollama app.exe" 2>nul
taskkill /F /IM "ollama.exe" 2>nul
:: Set CORS environment variable permanently
setx OLLAMA_ORIGINS "*" /M
:: Wait for environment variable to propagate
timeout /t 2 /nobreak
:: Start Ollama with new settings
echo ✨ Starting Ollama with CORS enabled...
start "" "%LOCALAPPDATA%\Programs\Ollama\ollama.exe" serve
:: Wait for Ollama to start
timeout /t 5 /nobreak
:: Pull the model
echo 📥 Downloading llama3 model...
"%LOCALAPPDATA%\Programs\Ollama\ollama.exe" pull llama3:latest
echo ✅ Installation complete! Ollama is running with CORS enabled and llama3 model is installed.
echo You can now close this window and use Ollama with your application.
pause