Agent skill
ollama-service-persistence
Create, update, and validate a persistent Windows service for Ollama (auto-start on boot), including setting OLLAMA_MODELS and managing the service lifecycle. Use when Ollama must be always-on or models must live in a custom directory.
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/ollama-service-persistence
SKILL.md
Ollama Service Persistence (Windows)
Use this skill to install or update a Windows Service that runs ollama serve with a fixed OLLAMA_MODELS path.
Quick start (admin PowerShell)
- Install/update persistence (try Task Scheduler first; Startup fallback if tasks are blocked) and point models to the repo store:
powershell
.\skills\operations\ollama-service-persistence\scripts\ollama_service_manager.ps1 -Action Install -Mode Task -TaskScope Auto -ModelsDir "C:\Users\usuario\Business\CLI_A1_GHR\CLI-main\models" -OllamaHost "127.0.0.1:11435"
Startup fallback (no Task Scheduler needed):
powershell
.\skills\operations\ollama-service-persistence\scripts\ollama_service_manager.ps1 -Action Install -Mode Startup -ModelsDir "C:\Users\usuario\Business\CLI_A1_GHR\CLI-main\models" -OllamaHost "127.0.0.1:11435"
- Check status:
powershell
.\skills\operations\ollama-service-persistence\scripts\ollama_service_manager.ps1 -Action Status -Mode Task
Startup status:
powershell
.\skills\operations\ollama-service-persistence\scripts\ollama_service_manager.ps1 -Action Status -Mode Startup
- Verify models:
powershell
ollama list
Notes
- Requires admin privileges (service create/config + system env var).
- The script writes/updates
scripts\ollama_service.ps1in the repo root and uses it as the service runner. - If
sc.exereturns 1053, use-Mode Task(Task Scheduler).ollama.exeis not a native Windows service. -TaskScope Autotries SYSTEM at boot, then falls back to USER at logon if SYSTEM is denied.- If Task Scheduler is blocked, use
-Mode Startupto drop a user logon launcher in the Startup folder. - If
sc.exereturns “Access denied,” run the command in an elevated PowerShell session. - Manual fallback:
ollama serveis non-persistent and must be started after reboot.
Removal
powershell
.\skills\operations\ollama-service-persistence\scripts\ollama_service_manager.ps1 -Action Remove
Didn't find tool you were looking for?