Skip to content

Instantly share code, notes, and snippets.

@jleechan2015
Created August 3, 2025 20:56
Show Gist options
  • Select an option

  • Save jleechan2015/e247644acd1bd4b8372f42f2dcd35231 to your computer and use it in GitHub Desktop.

Select an option

Save jleechan2015/e247644acd1bd4b8372f42f2dcd35231 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
set -x
echo "--- Starting Robust Setup Script from Gist ---"
# STEP 1: Install Ollama
echo "--- Installing Ollama ---"
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
sleep 5
echo "--- Ollama Service Started ---"
# STEP 2: Configure Persistent Storage
echo "--- Configuring Storage ---"
if [ ! -L /root/.ollama ]; then
echo "Moving .ollama to persistent storage at /datastore/ollama"
mv /root/.ollama /datastore/ollama
ln -s /datastore/ollama /root/.ollama
else
echo ".ollama is already linked. Skipping."
fi
# STEP 3: Install Python Packages
echo "--- Installing Python Packages ---"
pip install litellm
echo "--- LiteLLM installed ---"
# STEP 4: Ensure litellm is in the PATH
echo "--- Verifying command path ---"
if ! command -v litellm &> /dev/null
then
echo "litellm command not found, adding ~/.local/bin to PATH."
export PATH="$PATH:/root/.local/bin"
fi
# STEP 5: Pull the Model
echo "--- Pulling Qwen3 Coder Model ---"
ollama pull qwen3-coder:30b
echo "--- Model Pull Complete ---"
# STEP 6: Start the Proxy
echo "--- Starting LiteLLM Proxy ---"
/root/.local/bin/litellm --model ollama/qwen3-coder:30b --host 0.0.0.0 --port 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment