Ollama Utilities (Optional)¶
The bash/ directory contains helper scripts for Ollama users on macOS and Linux.
Ollama Environment Setup (macOS)¶
Sets Ollama performance environment variables at boot and launches the Ollama app:
Setup:
- Edit
bash/ollama-env-mac/ollama.environment.plist(no changes needed for defaults) - Copy to LaunchAgents:
cp bash/ollama-env-mac/ollama.environment.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/ollama.environment.plist
VRAM Cleaner¶
Automatically unloads idle Ollama models from VRAM to free GPU memory. Useful when running multiple models or when GPU memory is limited.
macOS (LaunchAgent, runs every 60 seconds):
- Edit
bash/ollama-freeup-vram/com.ollama.vramcleaner.plist: - Replace
/PATH_TO_REPOSITORYwith the actual path to this repository - Replace
/PATH_TO_USER_HOMEwith your home directory - Install:
cp bash/ollama-freeup-vram/com.ollama.vramcleaner.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.ollama.vramcleaner.plist
Linux (systemd):
- Edit
bash/ollama-freeup-vram/ollama-vram-cleaner.service: - Replace
/PATH_TO_REPOSITORYwith the actual repository path - Install:
sudo cp bash/ollama-freeup-vram/ollama-vram-cleaner.service /etc/systemd/system/
sudo cp bash/ollama-freeup-vram/ollama-vram-cleaner.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now ollama-vram-cleaner.timer
The timer runs the one-shot service once per minute, avoiding a continuous restart loop.
See bash/ollama-freeup-vram/README.md and bash/ollama-env-mac/README.md for more details.