#!/usr/bin/env bash # Fetch the llama.cpp binaries and embedding model, then install dependencies. # Both artifacts are gitignored, so a fresh clone needs this once. set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" llama_build="${LLAMA_BUILD:-b10483}" model_url="https://huggingface.co/Qwen/Qwen3-Embedding-0.6B-GGUF/resolve/main/Qwen3-Embedding-0.6B-Q8_0.gguf" model_path="$here/models/Qwen3-Embedding-0.6B-Q8_0.gguf" # The model the index used before, kept so eval/model-comparison.md stays # reproducible without a by-hand download. prev_model_url="https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.f16.gguf" prev_model_path="$here/models/nomic-embed-text-v1.5.f16.gguf" mkdir -p "$here/vendor" "$here/models" if [ ! -x "$here/vendor/llama-$llama_build/llama-server" ]; then echo "fetching llama.cpp $llama_build" url="https://github.com/ggml-org/llama.cpp/releases/download/$llama_build/llama-$llama_build-bin-ubuntu-x64.tar.gz" curl -fsSL "$url" -o "$here/vendor/llama.tar.gz" tar xzf "$here/vendor/llama.tar.gz" -C "$here/vendor" rm -f "$here/vendor/llama.tar.gz" fi if [ ! -f "$model_path" ]; then echo "fetching Qwen3-Embedding-0.6B Q8_0 (639 MB)" curl -fsSL "$model_url" -o "$model_path.part" mv "$model_path.part" "$model_path" fi if [ ! -f "$prev_model_path" ]; then echo "fetching nomic-embed-text-v1.5 (274 MB)" curl -fsSL "$prev_model_url" -o "$prev_model_path.part" mv "$prev_model_path.part" "$prev_model_path" fi echo "installing dependencies" uv sync --directory "$here" --quiet echo "ready. next: $here/bin/code-index index"