Instructions to use tchbcb/nqwen27 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 tchbcb/nqwen27 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 tchbcb/nqwen27:IQ2_XS # Run inference directly in the terminal: llama cli -hf tchbcb/nqwen27:IQ2_XS
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tchbcb/nqwen27:IQ2_XS # Run inference directly in the terminal: llama cli -hf tchbcb/nqwen27:IQ2_XS
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf tchbcb/nqwen27:IQ2_XS # Run inference directly in the terminal: ./build/bin/llama cli -hf tchbcb/nqwen27:IQ2_XS
Use Docker
docker model run hf.co/tchbcb/nqwen27:IQ2_XS
- Llama new
- LM Studio
- Jan
- Ollama
How to use tchbcb/nqwen27 with Ollama:
ollama run hf.co/tchbcb/nqwen27:IQ2_XS
- Unsloth Desktop
- Pi
How to use tchbcb/nqwen27 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tchbcb/nqwen27:IQ2_XS
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": "tchbcb/nqwen27:IQ2_XS" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use tchbcb/nqwen27 with Docker Model Runner:
docker model run hf.co/tchbcb/nqwen27:IQ2_XS
- Lemonade
How to use tchbcb/nqwen27 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tchbcb/nqwen27:IQ2_XS
Run and chat with the model
lemonade run user.nqwen27-IQ2_XS
List all available models
lemonade list
- Hermes Agent
How to use tchbcb/nqwen27 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tchbcb/nqwen27:IQ2_XS
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 tchbcb/nqwen27:IQ2_XS
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use tchbcb/nqwen27 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tchbcb/nqwen27:IQ2_XS
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 "tchbcb/nqwen27:IQ2_XS" \ --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"
perf: 2xT4 bench results (layer optimal, MTP n/a in quant) + SPEC_FLAGS passthrough (README.md)
Browse files
README.md
CHANGED
|
@@ -80,6 +80,7 @@ print(r.choices[0].message.content)
|
|
| 80 |
| `PORT` | `8080` | 本机服务端口 |
|
| 81 |
| `CTX` | `131072` | 上下文长度(128k;最大可至模型原生 262144,但 T4 显存有限) |
|
| 82 |
| `P1_CTK`/`P1_CTV` 等 | `q8_0`/`q4_0` | KV cache 量化预设链,见下方 FAQ |
|
|
|
|
| 83 |
| `WORK` | `/root/nqwen27` | 部署目录 |
|
| 84 |
| `SKIP_PREBUILT` | `0` | 置 1 跳过预编译尝试,直接源码编译 |
|
| 85 |
|
|
@@ -95,6 +96,39 @@ llama.cpp 的 KV cache 是显存大头,`start_server.sh` 用 **KV cache 量化
|
|
| 95 |
|
| 96 |
启动时先试 P1,检测到 OOM 自动换 P2、P3,成功的档位会打印在日志里。KV q8_0 接近无损,q4_0 有轻微精度损失但完全可用。
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
## 安全提示
|
| 99 |
|
| 100 |
仓库内脚本**不包含任何真实密钥**(aitun key / HF token 均通过环境变量传入)。公网服务请务必保留 `API_KEY` 鉴权,必要时把默认的 `1234` 改成强 key。
|
|
|
|
| 80 |
| `PORT` | `8080` | 本机服务端口 |
|
| 81 |
| `CTX` | `131072` | 上下文长度(128k;最大可至模型原生 262144,但 T4 显存有限) |
|
| 82 |
| `P1_CTK`/`P1_CTV` 等 | `q8_0`/`q4_0` | KV cache 量化预设链,见下方 FAQ |
|
| 83 |
+
| `SPEC_FLAGS` | 空 | llama-server 额外参数透传(投机解码实验等),见下方性能章节 |
|
| 84 |
| `WORK` | `/root/nqwen27` | 部署目录 |
|
| 85 |
| `SKIP_PREBUILT` | `0` | 置 1 跳过预编译尝试,直接源码编译 |
|
| 86 |
|
|
|
|
| 96 |
|
| 97 |
启动时先试 P1,检测到 OOM 自动换 P2、P3,成功的档位会打印在日志里。KV q8_0 接近无损,q4_0 有轻微精度损失但完全可用。
|
| 98 |
|
| 99 |
+
## 性能基准与提速说明(2×T4 实测)
|
| 100 |
+
|
| 101 |
+
用 `llama-bench`(p1024/tg128,b11175)实测五种方案后的结论——**当前默认配置(`-sm layer` + 默认 ubatch 512)就是 2×T4 上的最优解**:
|
| 102 |
+
|
| 103 |
+
| 方案 | prefill tok/s | decode tok/s | 结论 |
|
| 104 |
+
|---|---|---|---|
|
| 105 |
+
| **`-sm layer`(当前默认)** | **313** | **11.5** | 双卡层切分接力,T4 无 NVLink 下最快 |
|
| 106 |
+
| `-sm none`(单卡全放) | 223 | 8.0 | 两卡合计带宽 > 单卡,即使有接力开销 |
|
| 107 |
+
| `-sm tensor`(张量并行) | 181 | 5.0 | 逐层 PCIe 同步开销远超收益 |
|
| 108 |
+
| `-sm row` | — | — | 本量化 + FA 组合下启动失败 |
|
| 109 |
+
| `-ub 2048` | 224 | 10.9 | 大 ubatch 反而降速,保持默认 512 |
|
| 110 |
+
|
| 111 |
+
实测解码约 **11-13 tok/s、prefill 约 275-310 tok/s**,即 27B 模型 @ 2bpw 在 2×T4(2018 年数据中心卡,无 NVLink)上的硬件极限水平。
|
| 112 |
+
|
| 113 |
+
**关于 MTP**:b11175 引擎支持 `--spec-type draft-mtp`,但 **GSQ-RCO 量化版 GGUF 不含 MTP 层**(启动时报 `context type MTP requested but model doesn't contain MTP layers`),因此无法开启;需要换带 MTP 头的权重才行。
|
| 114 |
+
|
| 115 |
+
**投机解码实验**(已实测,默认不开启):
|
| 116 |
+
|
| 117 |
+
- `ngram-simple`(免草稿模型):普通文本 +5% 以内,重复文本 ±0,不值得;
|
| 118 |
+
- `draft-simple` + [unsloth/Qwen3.5-2B-GGUF](https://huggingface.co/unsloth/Qwen3.5-2B-GGUF) 草稿:普通对话 **8.8 tok/s(变慢 20%)**,高度重复文本 12.2 tok/s(+12%),仅对重复型生成(批量模板、代码补全)有微弱收益。
|
| 119 |
+
|
| 120 |
+
如需在重复型工作负载上试验:
|
| 121 |
+
|
| 122 |
+
```bash
|
| 123 |
+
# 草稿模型已可自动下载(约1.3GB),或手动放入 $WORK/draft/
|
| 124 |
+
SPEC_FLAGS="--spec-type draft-simple -md /root/nqwen27/draft/Qwen3.5-2B-Q4_K_M.gguf -ngld 99 -devd CUDA0 -ctkd q4_0 -ctvd q4_0" \
|
| 125 |
+
bash start_server.sh
|
| 126 |
+
# 或免草稿的 ngram 模式
|
| 127 |
+
SPEC_FLAGS="--spec-type ngram-simple" bash start_server.sh
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
启动失败会自动沿 P1→P2→P3 降档兜底;去掉 `SPEC_FLAGS` 重跑即恢复默认配置。
|
| 131 |
+
|
| 132 |
## 安全提示
|
| 133 |
|
| 134 |
仓库内脚本**不包含任何真实密钥**(aitun key / HF token 均通过环境变量传入)。公网服务请务必保留 `API_KEY` 鉴权,必要时把默认的 `1234` 改成强 key。
|