Scientific computing teams increasingly want language and coding models close to their simulation data, job scripts, and analysis pipelines—without routing unpublished datasets or facility configurations through external commercial APIs.
Running local inference tools like Ollama on shared high-performance computing (HPC) systems such as NERSC Perlmutter introduces constraints that desktop setups never see:
- No root daemon privileges: Compute nodes prohibit system-wide systemd services; the server binary and model weights must run entirely in user space on ephemeral allocations.
- Filesystem contention: Home directories on networked Lustre or GPFS mounts penalize large weight reads unless model blobs (
OLLAMA_MODELS) are staged onto fast scratch storage. - Port & network isolation: Multi-tenant login and compute nodes require explicit host/port binding scoped to the user’s Slurm allocation.
# Stage weights on high-bandwidth scratch rather than $HOME
export OLLAMA_MODELS="$SCRATCH/ollama/models"
export OLLAMA_HOST="127.0.0.1:11434"
# Launch inference server inside the allocated GPU node
./bin/ollama serve &
SERVER_PID=$!slurm-ollama.sh
I keep a minimal, reproducible setup guide and helper scripts in ycaophysics/Ollama_on_HPC for researchers setting up private local inference on cluster allocations.