-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·61 lines (54 loc) · 1.57 KB
/
setup.sh
File metadata and controls
executable file
·61 lines (54 loc) · 1.57 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
#!/bin/bash
# Setup Script - Run this ONCE to clone and build llama.cpp
# Usage: ./setup.sh
# Takes ~5 minutes depending on your CPU
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Minimal Coding Assistant Setup ==="
echo ""
# Check for required tools
echo "[1/4] Checking dependencies..."
for cmd in git cmake gcc g++; do
if ! command -v $cmd &> /dev/null; then
echo "ERROR: $cmd not found. Please install: sudo apt install build-essential cmake"
exit 1
fi
done
echo "✓ Dependencies OK"
# Clone llama.cpp
echo ""
echo "[2/4] Cloning llama.cpp..."
if [ -d "llama.cpp" ]; then
echo "✓ llama.cpp already exists"
else
git clone https://github.com/ggerganov/llama.cpp.git
echo "✓ llama.cpp cloned"
fi
# Build llama.cpp
echo ""
echo "[3/4] Building llama.cpp (this may take a few minutes)..."
cd llama.cpp
rm -rf build &> /dev/null || true
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j$(nproc)
cd ..
echo "✓ llama.cpp built successfully"
# Make scripts executable
echo ""
echo "[4/4] Making scripts executable..."
chmod +x *.sh
echo "✓ Scripts are executable"
echo ""
echo "=== Setup Complete ==="
echo ""
echo "Next steps:"
echo " 1. Download a model: ./download-model.sh qwen2.5-coder-7b"
echo " 2. Start chatting: ./chat.sh"
echo " 3. Or start server: ./server.sh"
echo ""
echo "To switch models:"
echo " - Download: ./download-model.sh <model-id>"
echo " - Edit: config.sh (change ACTIVE_MODEL)"
echo " - Available: ./download-model.sh (list all)"
echo ""