Skip to content

Install pasture

Get started installs pasture with one command. This page covers what pasture install sets up on macOS and Linux, how pasture finds or downloads Ollama, and how to uninstall pasture.

The install command

The install command, install.sh, downloads the pasture binary for this machine from Cinchapi's package repository at packages.cinchapi.com, checks it against the release's SHA-256 checksums, puts it in ~/.local/bin, and runs pasture install. A binary whose checksum does not match is never installed. The command installs the latest release. PASTURE_VERSION=0.1.0 picks another release, and PASTURE_INSTALL_DIR picks another folder.

When that folder is not on the PATH, install.sh adds a line that puts it there to the startup file of your shell: ~/.zshrc for zsh, and for bash ~/.bash_profile on macOS or ~/.bashrc on Linux. It adds the line once, and says so. For another shell, or with PASTURE_NO_MODIFY_PATH=1, it changes no file and prints the line to add.

Run pasture as a service

pasture install sets up a service that runs pasture serve and starts it again if it stops, then starts it now. pasture starts ollama serve itself, so no other Ollama server may run on Ollama's port.

The first pasture install checks what the first sweep would do. When it would move more than three models away, it lists them and asks before it goes on. When no one can answer, as when the install script has no terminal, it lists the models and goes on.

macOS

On macOS, the service is a launchd job that starts at login. pasture install refuses to run while brew services runs pasture, since two copies would compete for the same port. When you installed pasture with Homebrew, the launchd job runs it through Homebrew's opt link, so it keeps working after brew upgrade.

Keep the Ollama app closed and out of your login items. The app would start a second server on the same port. When the app holds the port, pasture install fails and names it. On Homebrew, brew install --cask ollama-app gives you the ollama command without opening the app.

Linux

On Linux, the service is a systemd user unit, pasture.service. It runs as you, so the service and the pasture commands you run share one config. pasture install also turns on lingering for your user, so pasture starts at boot and keeps running when nobody is logged in, as on a server. Turning on lingering can ask for your password. When it fails, pasture runs while you are logged in, and pasture install prints the command that turns lingering on.

Ollama's Linux installer sets up its own service, ollama.service, which runs ollama serve on Ollama's port as the ollama user. pasture install refuses to run while that service runs or starts at boot. Stop and disable it:

sudo systemctl disable --now ollama

That service keeps its models in /usr/share/ollama/.ollama/models, inside the ollama user's home folder, which some systems close to other users. To keep the models, give your user that folder and point pasture at it:

sudo chown -R "$USER": /usr/share/ollama
pasture env OLLAMA_MODELS=/usr/share/ollama/.ollama/models

Ollama's installer also adds the ollama user to the render and video groups, which an AMD GPU needs. pasture runs Ollama as you, so add yourself to those groups. Then restart the computer, so that pasture's service starts with them:

sudo usermod -a -G render,video "$USER"

pasture install reaches your service manager through your login session, such as one from ssh or the desktop, and not through su or sudo. On a system without systemd, such as most containers, run pasture serve under the system's own service manager.

Ollama

pasture uses the ollama command you already have: ollama_path in the config, then PATH, then where Homebrew and Ollama's installer put it. When it finds none, pasture install downloads Ollama, with a progress line, and pasture serve does the same at start and logs the progress. pasture add runs the same command, so it works with a downloaded Ollama too.

  • pasture downloads the one Ollama version it was tested with, now v0.40.13, from Ollama's GitHub releases, into ~/.local/share/pasture/ollama/<version>. It needs no sudo and changes no system folder.
  • pasture install links the ollama command into the folder that holds pasture, such as ~/.local/bin, so scripts and tools that run ollama find it too. After an upgrade, it moves the link to the new version. It never replaces an ollama command that it did not link, and says where its own is instead.
  • On macOS it downloads the command-line build, ollama-darwin.tgz, never the app, which would start a second server on Ollama's port.
  • On Linux it picks the archives that Ollama's own installer picks: the one for the CPU, with NVIDIA's CUDA libraries, then the ROCm archive for an AMD GPU, or the JetPack archive on an NVIDIA Jetson. It installs no service, no user, and no GPU driver. These archives are 1 to 1.5 GB each.
  • It checks each archive against the release's sha256sum.txt before it unpacks it, and checks first that the disk has four times the archive's size free. It unpacks into a temporary folder and moves the result into place only when every archive is whole, so a failed or interrupted download leaves no half-installed Ollama.
  • When the system refuses to run the downloaded command, as on a server whose home folders sit on a disk mounted noexec, pasture names the folder and says to set ollama_path to an ollama command elsewhere.
  • On Linux with an AMD GPU, Ollama uses the GPU only when you belong to the render and video groups. pasture install and the log say so when you do not. Join them with sudo usermod -aG render,video "$USER", then restart the machine. When you joined them after pasture started, the log says to restart the machine, since pasture and Ollama keep the groups they started with.

Ollama is under the MIT license. pasture downloads it from Ollama's own releases and does not ship it. A pasture release that bundled Ollama would have to include Ollama's MIT notice, and the notices of the libraries in Ollama's archives.

Uninstall pasture

pasture uninstall removes only the launchd job or the systemd unit. Your models, settings, and archive stay where they are. On Linux, lingering stays on, and loginctl disable-linger turns it off.