-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
Β·158 lines (129 loc) Β· 7.06 KB
/
install.sh
File metadata and controls
executable file
Β·158 lines (129 loc) Β· 7.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/env bash
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Squish β One-Command Installer
#
# Usage (recommended):
# curl -fsSL https://raw.githubusercontent.com/wesleyscholl/squish/main/install.sh | bash
#
# Or clone and run locally:
# git clone https://github.com/wesleyscholl/squish.git
# bash squish/install.sh
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
set -euo pipefail
GREEN="\033[32m"
CYAN="\033[36m"
RED="\033[31m"
YELLOW="\033[33m"
BOLD="\033[1m"
DIM="\033[2m"
RESET="\033[0m"
# ββ Banner ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cat <<'BANNER'
ββββββββ βββββββ βββ βββββββββββββββββ βββ
ββββββββββββββββββββ βββββββββββββββββ βββ
βββββββββββ ββββββ ββββββββββββββββββββββ
βββββββββββββ ββββββ ββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββ βββ
ββββββββ βββββββ βββββββ ββββββββββββββ βββ
Local LLM inference Β· 54Γ faster cold load Β· No cloud Β· No API key
Apple Silicon native Β· Linux x86_64/arm64 Β· OpenAI + Ollama drop-in compatible
BANNER
# ββ Platform check ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
OS="$(uname -s)"
ARCH="$(uname -m)"
if [[ "$OS" == "Darwin" ]]; then
if [[ "$ARCH" != "arm64" ]]; then
echo -e "${YELLOW} β x86_64 Mac detected β MLX requires Apple Silicon (M1βM5).${RESET}"
echo " Install will continue but inference will fall back to CPU."
fi
BACKEND="macos"
elif [[ "$OS" == "Linux" ]]; then
BACKEND="linux"
echo -e "${CYAN} βΈ Linux detected β will install torch/bitsandbytes backend.${RESET}"
else
echo -e "${RED} β Unsupported OS: ${OS}. Squish supports macOS and Linux.${RESET}"
exit 1
fi
echo -e "${CYAN} βΈ Platform : ${OS} / ${ARCH}${RESET}"
# ββ Python ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PYTHON=""
for py in python3.12 python3.11 python3.10 python3; do
if command -v "$py" &>/dev/null; then
VER="$("$py" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
MAJOR="${VER%%.*}"
MINOR="${VER##*.}"
if [[ "$MAJOR" -ge 3 && "$MINOR" -ge 10 ]]; then
PYTHON="$py"
break
fi
fi
done
if [[ -z "$PYTHON" ]]; then
echo -e "${RED} β Python 3.10+ required but not found.${RESET}"
echo " Install with: brew install python@3.12"
echo " Then re-run this script."
exit 1
fi
PYTHON_VERSION="$("$PYTHON" --version 2>&1)"
echo -e "${CYAN} βΈ Python : ${PYTHON_VERSION}${RESET}"
# ββ Install squish from PyPI (or editable if inside a checkout) βββββββββββββββ
echo ""
echo -e "${CYAN} βΈ Installing squish β¦${RESET}"
# Detect if we're running from inside a git checkout of squish
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" 2>/dev/null && pwd || pwd)"
if [[ -f "$SCRIPT_DIR/pyproject.toml" ]] && grep -q 'name = "squish"' "$SCRIPT_DIR/pyproject.toml" 2>/dev/null; then
echo -e "${DIM} (local checkout detected β installing in editable mode)${RESET}"
"$PYTHON" -m pip install --quiet -e "$SCRIPT_DIR[${BACKEND}]"
else
"$PYTHON" -m pip install --quiet --upgrade "squish[${BACKEND}]"
fi
echo -e "${GREEN} β squish installed${RESET}"
# ββ Verify install ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo ""
echo -e "${CYAN} βΈ Verifying β¦${RESET}"
if "$PYTHON" -m squish.cli --help &>/dev/null; then
echo -e "${GREEN} β squish CLI is working${RESET}"
else
echo -e "${YELLOW} β CLI check failed β try: ${PYTHON} -m squish.cli --help${RESET}"
fi
# Check that squish binary is on PATH
if command -v squish &>/dev/null; then
echo -e "${GREEN} β 'squish' command found on PATH$(command -v squish | xargs printf ': %s')${RESET}"
else
# Suggest adding pip's local bin to PATH if needed
LOCAL_BIN="$("$PYTHON" -m site --user-base)/bin"
echo -e "${YELLOW} β 'squish' not found on PATH.${RESET}"
echo -e "${DIM} Add to PATH: export PATH=\"${LOCAL_BIN}:\$PATH\"${RESET}"
SHELL_RC="$HOME/.zshrc"
[[ "${SHELL:-}" == *"bash"* ]] && SHELL_RC="$HOME/.bashrc"
if ! grep -q "$LOCAL_BIN" "$SHELL_RC" 2>/dev/null; then
echo "export PATH=\"${LOCAL_BIN}:\$PATH\"" >> "$SHELL_RC"
echo -e "${CYAN} Added to ${SHELL_RC} β restart your shell or run: source ${SHELL_RC}${RESET}"
fi
fi
# Run squish doctor
echo ""
echo -e "${CYAN} βΈ Running squish doctor β¦${RESET}"
"$PYTHON" -m squish.cli doctor 2>/dev/null || true
# ββ Print next steps ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cat <<DONE
${BOLD}${GREEN}β Squish installed successfully!${RESET}
${BOLD}Next steps β run these 3 commands:${RESET}
${CYAN}squish catalog${RESET} ${DIM}# Browse available models${RESET}
${CYAN}squish pull qwen3:8b${RESET} ${DIM}# Download + compress (once, ~5 min for 8B)${RESET}
${CYAN}squish run qwen3:8b${RESET} ${DIM}# Start server + open web UI${RESET}
${BOLD}Then open:${RESET}
${CYAN}http://localhost:11435/chat${RESET} ${DIM}# Web chat UI${RESET}
${BOLD}Or chat in the terminal:${RESET}
${CYAN}squish chat qwen3:8b${RESET}
${BOLD}OpenAI drop-in:${RESET}
${DIM}export OPENAI_BASE_URL=http://localhost:11435/v1${RESET}
${DIM}export OPENAI_API_KEY=squish${RESET}
${BOLD}Ollama drop-in:${RESET}
${DIM}export OLLAMA_HOST=http://localhost:11435${RESET}
${BOLD}All models (29 available):${RESET}
${CYAN}squish catalog${RESET} ${DIM}# qwen3, gemma3, deepseek-r1, llama3, phi4, mistral β¦${RESET}
${BOLD}Get help:${RESET}
${DIM}squish --help${RESET}
${DIM}https://github.com/wesleyscholl/squish${RESET}
DONE