GGUF
Chinese
English
spark-x2.5
llama.cpp
speculative-decoding
t4
cuda
colab
edge-deployment
conversational
Instructions to use gasschina/Spark-X2.5-4B-build-cpp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use gasschina/Spark-X2.5-4B-build-cpp with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0 # Run inference directly in the terminal: llama cli -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0 # Run inference directly in the terminal: llama cli -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Use Docker
docker model run hf.co/gasschina/Spark-X2.5-4B-build-cpp:Q8_0
- LM Studio
- Jan
- Ollama
How to use gasschina/Spark-X2.5-4B-build-cpp with Ollama:
ollama run hf.co/gasschina/Spark-X2.5-4B-build-cpp:Q8_0
- Unsloth Desktop
- Pi
How to use gasschina/Spark-X2.5-4B-build-cpp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "gasschina/Spark-X2.5-4B-build-cpp:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use gasschina/Spark-X2.5-4B-build-cpp with Docker Model Runner:
docker model run hf.co/gasschina/Spark-X2.5-4B-build-cpp:Q8_0
- Lemonade
How to use gasschina/Spark-X2.5-4B-build-cpp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Run and chat with the model
lemonade run user.Spark-X2.5-4B-build-cpp-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use gasschina/Spark-X2.5-4B-build-cpp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use gasschina/Spark-X2.5-4B-build-cpp with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf gasschina/Spark-X2.5-4B-build-cpp:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "gasschina/Spark-X2.5-4B-build-cpp:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload scripts/spark_api.sh with huggingface_hub
Browse files- scripts/spark_api.sh +3 -3
scripts/spark_api.sh
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
# · 鉴权: 默认自动生成 API Key 存 Drive 并打印;API_KEY=off 可关闭
|
| 15 |
#
|
| 16 |
# 用法:
|
| 17 |
-
# bash spark_api.sh start # 起服务(默认
|
| 18 |
# 关闭投机解码: SPEC_TYPE=none CTX=500000 bash spark_api.sh start
|
| 19 |
# 开启思考模式: THINKING=on bash spark_api.sh start(⚠️ 非流式请求可能超网关 120s 超时→504)
|
| 20 |
# bash spark_api.sh stop
|
|
@@ -26,9 +26,9 @@ set -euo pipefail
|
|
| 26 |
|
| 27 |
BASE_DIR="${BASE_DIR:-/content/drive/MyDrive/spark-t4}"
|
| 28 |
MODEL_DIR="${MODEL_DIR:-/content/spark-t4-models}"
|
| 29 |
-
QUANT="${QUANT:-
|
| 30 |
CTX="${CTX:-262144}" # 256k 默认(配合默认投机解码);关草稿后可设 524288/500000(需KVQ)
|
| 31 |
-
PORT="${PORT:-
|
| 32 |
NGL="${NGL:-999}"
|
| 33 |
KVQ="${KVQ:-}" # KV cache 量化: q8_0 / q4_0,压显存换长上下文
|
| 34 |
API_KEY="${API_KEY:-auto}" # auto=首次生成并存Drive; off=不鉴权
|
|
|
|
| 14 |
# · 鉴权: 默认自动生成 API Key 存 Drive 并打印;API_KEY=off 可关闭
|
| 15 |
#
|
| 16 |
# 用法:
|
| 17 |
+
# bash spark_api.sh start # 起服务(默认 Q8_0+1.7B草稿投机解码 @ CTX=262144, 思考默认关)
|
| 18 |
# 关闭投机解码: SPEC_TYPE=none CTX=500000 bash spark_api.sh start
|
| 19 |
# 开启思考模式: THINKING=on bash spark_api.sh start(⚠️ 非流式请求可能超网关 120s 超时→504)
|
| 20 |
# bash spark_api.sh stop
|
|
|
|
| 26 |
|
| 27 |
BASE_DIR="${BASE_DIR:-/content/drive/MyDrive/spark-t4}"
|
| 28 |
MODEL_DIR="${MODEL_DIR:-/content/spark-t4-models}"
|
| 29 |
+
QUANT="${QUANT:-Q8_0}" # 默认 Q8_0(质量最佳+草稿接受率0.89≈52tok/s); 4bit省显存: QUANT=Q4_K_M
|
| 30 |
CTX="${CTX:-262144}" # 256k 默认(配合默认投机解码);关草稿后可设 524288/500000(需KVQ)
|
| 31 |
+
PORT="${PORT:-8100}" # 8100 默认(Colab 的 8080 被占用); 本机另跑时 PORT=8080 覆盖
|
| 32 |
NGL="${NGL:-999}"
|
| 33 |
KVQ="${KVQ:-}" # KV cache 量化: q8_0 / q4_0,压显存换长上下文
|
| 34 |
API_KEY="${API_KEY:-auto}" # auto=首次生成并存Drive; off=不鉴权
|