#!/bin/sh # synrag installer — https://ai.synlabs.pro # curl -fsSL https://ai.synlabs.pro/install.sh | sh # Installs the synrag binary into $SYNRAG_PREFIX/bin (default ~/.local/bin) and the models into ~/.synrag/models, # verifying SHA-256 checksums. No root needed. Options (environment): # SYNRAG_PREFIX=/opt/synrag install location of the binary (bin/ is appended) # SYNRAG_NO_MODELS=1 binary only (BM25 search; no Synapse / reranker) # SYNRAG_VERSION=1.16.0 version to install set -eu VERSION="${SYNRAG_VERSION:-1.16.0}" BASE="https://ai.synlabs.pro/download" PREFIX="${SYNRAG_PREFIX:-$HOME/.local}" MODELS="${SYNRAG_MODELS:-$HOME/.synrag/models}" say() { printf '\033[1;36m==>\033[0m %s\n' "$*"; } die() { printf '\033[1;31merror:\033[0m %s\n' "$*" >&2; exit 1; } case "$(uname -s)-$(uname -m)" in Linux-x86_64|Linux-amd64) ;; Darwin-*) die "macOS builds are coming soon. Meanwhile run synrag in a Linux VM or container." ;; *) die "unsupported platform $(uname -s) $(uname -m): synrag $VERSION is built for Linux x86-64 (Windows: use WSL2)" ;; esac if command -v curl >/dev/null 2>&1; then fetch() { curl -fSL --progress-bar -o "$2" "$1"; } elif command -v wget >/dev/null 2>&1; then fetch() { wget -q --show-progress -O "$2" "$1"; } else die "curl or wget is required"; fi command -v sha256sum >/dev/null 2>&1 || die "sha256sum is required" TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT say "synrag $VERSION — downloading checksums" fetch "$BASE/SHA256SUMS" "$TMP/SHA256SUMS" get() { # remote-name local-path say "downloading $1" fetch "$BASE/$1" "$TMP/$1" ( cd "$TMP" && grep " $1\$" SHA256SUMS | sha256sum -c --quiet - ) || die "checksum mismatch for $1" mkdir -p "$(dirname "$2")" mv "$TMP/$1" "$2" } BIN="$PREFIX/bin/synrag" get "synrag-$VERSION-linux-x86_64" "$BIN" chmod 755 "$BIN" "$BIN" license >/dev/null 2>&1 || die "the binary does not run on this system (needs glibc 2.30+: Ubuntu 20.04+, Debian 11+, RHEL 9)" if [ "${SYNRAG_NO_MODELS:-0}" != "1" ]; then get "synapse-v2.synm" "$MODELS/synapse.synm" get "rerank-v1.synr" "$MODELS/rerank.synr" fi say "installed: $BIN" case ":$PATH:" in *":$PREFIX/bin:"*) ;; *) printf '\n add to your shell profile: export PATH="%s/bin:$PATH"\n' "$PREFIX" ;; esac cat <