Download opencode/serve-model.sh from dragonlimited/dragon-harness: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/dragonlimited/dragon-harness/resolve/main/opencode/serve-model.sh
- Command line
-
hf download hf://dragonlimited/dragon-harness/opencode/serve-model.sh
-
curl -L -o serve-model.sh https://huggingface.co/dragonlimited/dragon-harness/resolve/main/opencode/serve-model.sh
1.07 kB
| # Serve Dragon Finance 7B locally for OpenCode. | |
| # | |
| # ./serve-model.sh /path/to/Dragon-Finance-7B-Q4_K_M.gguf | |
| # | |
| # Then check it is up: | |
| # curl -s http://127.0.0.1:8080/v1/models | head | |
| set -euo pipefail | |
| MODEL="${1:-}" | |
| PORT="${DRAGON_PORT:-8080}" | |
| CTX="${DRAGON_CTX:-32768}" | |
| ALIAS="dragon-finance-7b" | |
| if [[ -z "$MODEL" ]]; then | |
| echo "usage: $0 /path/to/model.gguf" >&2 | |
| echo " optional: DRAGON_PORT (default 8080), DRAGON_CTX (default 32768)" >&2 | |
| exit 1 | |
| fi | |
| if [[ ! -f "$MODEL" ]]; then echo "no such file: $MODEL" >&2; exit 1; fi | |
| command -v llama-server >/dev/null || { | |
| echo "llama-server not found. Install llama.cpp first." >&2; exit 1; } | |
| echo "serving $MODEL on 127.0.0.1:$PORT (ctx $CTX, alias $ALIAS)" | |
| echo " -ngl 999 all layers on GPU, falls back automatically" | |
| echo " -ctk/-ctv q8_0 quantised KV cache - this is what makes 32k fit in 8 GB" | |
| exec llama-server \ | |
| -m "$MODEL" \ | |
| --host 127.0.0.1 --port "$PORT" \ | |
| -c "$CTX" \ | |
| -fa on \ | |
| -ctk q8_0 -ctv q8_0 \ | |
| -ngl 999 \ | |
| --jinja \ | |
| --alias "$ALIAS" \ | |
| --metrics | |