Cortex.0 / scripts /serve_llamacpp.sh
Frankenstein-Labs's picture
initial commit
c429240
Raw History Blame Contribute Delete
809 Bytes
#!/usr/bin/env bash
# Serve Cortex.0 with llama.cpp on an OpenAI-compatible endpoint.
#
# Usage: ./scripts/serve_llamacpp.sh [model.gguf] [port]
set -euo pipefail
MODEL="${1:-Cortex.0-Q8_0.gguf}"
PORT="${2:-8080}"
if ! command -v llama-server >/dev/null 2>&1; then
echo "llama-server not found. Build llama.cpp: https://github.com/ggml-org/llama.cpp" >&2
exit 1
fi
if [ ! -f "$MODEL" ]; then
echo "Model file '$MODEL' not found." >&2
echo "Download it: hf download Frankenstein-Labs/Cortex.0 Cortex.0-Q8_0.gguf" >&2
exit 1
fi
# --jinja makes llama.cpp apply the model's own chat template, which is what
# carries the tool-call protocol Flint was trained with.
exec llama-server \
--model "$MODEL" \
--port "$PORT" \
--ctx-size 32768 \
--n-gpu-layers 999 \
--jinja \
--host 127.0.0.1