Skip to content

Instantly share code, notes, and snippets.

@soham2008xyz
Last active September 6, 2024 13:09
Show Gist options
  • Save soham2008xyz/8dc2df0d87329aea3d6479503ae07641 to your computer and use it in GitHub Desktop.
Save soham2008xyz/8dc2df0d87329aea3d6479503ae07641 to your computer and use it in GitHub Desktop.
Ollama aliases for zsh
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.ollama</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
<string>Background</string>
<string>LoginWindow</string>
<string>StandardIO</string>
<string>System</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/opt/ollama/bin/ollama</string>
<string>serve</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>OLLAMA_HOST</key>
<string>0.0.0.0</string>
<key>OLLAMA_ORIGINS</key>
<string>*</string>
<key>OLLAMA_MODELS</key>
<string>/Volumes/T7/AppData/Ollama/</string>
</dict>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/opt/homebrew/var/log/ollama.log</string>
<key>StandardOutPath</key>
<string>/opt/homebrew/var/log/ollama.log</string>
<key>WorkingDirectory</key>
<string>/opt/homebrew/var</string>
</dict>
</plist>
#!/usr/bin/env zsh
alias ollama-update='for model in $(ollama ls | grep : | sort | cut -f1); do echo "Updating $model..." && ollama pull $model; done'
alias ollama-start='launchctl load ~/Library/LaunchAgents/homebrew.mxcl.ollama.plist'
alias ollama-stop='launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.ollama.plist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment