Skip to content

Instantly share code, notes, and snippets.

@michaelgold
Created April 6, 2026 13:44
Show Gist options
  • Select an option

  • Save michaelgold/009895246b54694e20408e89d42cd817 to your computer and use it in GitHub Desktop.

Select an option

Save michaelgold/009895246b54694e20408e89d42cd817 to your computer and use it in GitHub Desktop.
Ostris AI Toolkit Volume Init for Runpod
#!/usr/bin/env bash
set -e
echo "Runpod init starting..."
# Create persistent dirs
mkdir -p /mnt/{datasets,models,output,configs,hf,cache}
link_dir () {
TARGET=$1
LINK=$2
if [ -L "$LINK" ]; then
rm "$LINK"
elif [ -e "$LINK" ]; then
rm -rf "$LINK"
fi
ln -s "$TARGET" "$LINK"
}
# Link ai-toolkit dirs
link_dir /mnt/datasets /app/ai-toolkit/datasets
link_dir /mnt/models /app/ai-toolkit/models
link_dir /mnt/output /app/ai-toolkit/output
link_dir /mnt/configs /app/ai-toolkit/configs
# Cache persistence (huge speed win)
link_dir /mnt/hf /root/.cache/huggingface
link_dir /mnt/cache /root/.cache
echo "Symlinks ready"
ls -lah /app/ai-toolkit
echo "Starting ai-toolkit..."
exec /start.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment