A hands-on guide and accompanying scripts for running Ollama (local LLM inference) on Stanford’s Yen, Sherlock, and Marlowe clusters.
Based on the blog post Running Ollama on Stanford Computing Clusters by the GSB DARC Team.
This repository contains:
ollama.sh: helper function to launch and manage the Ollama server.test.py: example Python script to verify your Ollama server.tutorial.ipynb: example notebook that connects to your Ollama server.requirements.txt: libraries needed to run the full tutorial. To set up a virtual environment in Jupyter Notebooks, please see the Python environments guidejoke_example.png: AI generated joke image to go with tutorial.
Follow the steps below to get up and running.
- Access to Stanford HPC clusters (Yen, Sherlock, or Marlowe)
Clone this code repo:
cd </your/project/path>
git clone https://github.com/gsbdarc/ollama_helper.git
cd ollama_helper/usr/bin/python3 -m venv my_env
source my_env/bin/activate
pip install -r requirements.txt
python -m ipykernel install --user --name=<kernel-name>