Instructions to use chenhaodev/stcc-checker-0.6b-GGUF 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 chenhaodev/stcc-checker-0.6b-GGUF 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 chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
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 chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
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 chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use chenhaodev/stcc-checker-0.6b-GGUF with Ollama:
ollama run hf.co/chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
- Unsloth Studio
How to use chenhaodev/stcc-checker-0.6b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for chenhaodev/stcc-checker-0.6b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for chenhaodev/stcc-checker-0.6b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for chenhaodev/stcc-checker-0.6b-GGUF to start chatting
- Pi
How to use chenhaodev/stcc-checker-0.6b-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use chenhaodev/stcc-checker-0.6b-GGUF with Docker Model Runner:
docker model run hf.co/chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
- Lemonade
How to use chenhaodev/stcc-checker-0.6b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.stcc-checker-0.6b-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use chenhaodev/stcc-checker-0.6b-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
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 chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use chenhaodev/stcc-checker-0.6b-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M
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 "chenhaodev/stcc-checker-0.6b-GGUF:Q4_K_M" \ --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"
stcc-checker-0.6b-GGUF — 电话分诊判据核对器
给一段问诊记录和一条判据,回答 yes / no / unknown。只输出一个词。
它不选协议、不定档位、不生成处置措辞、不做 tool call。分级由配套的确定性规则引擎
(stcc-mcp,225 份 STCC 协议 / 849 分支 / 4,168 条判据)算出。
本仓发布核对器权重,引擎在 GitHub。
🔴 读这一段,否则模型会"返回空字符串"
通过
ollama pull hf.co/...使用时,请求必须带顶层"think": false。{"model": "...", "prompt": "...", "stream": false, + "think": false, "options": {"temperature": 0, "num_predict": 8}}原因:
ollama pull hf.co/<repo>不会使用本仓的Modelfile—— Ollama 从 GGUF 元数据 自动生成模板,而 Qwen3 的默认模板带 thinking。不传这个参数,模型返回空字符串, 且不报任何错(done_reason仍是stop,HTTP 200),看起来完全像模型坏了。 加大num_predict无效 —— 那不是截断。不想每次都带这个参数,就用本仓的
Modelfile自己建一次(模板与训练逐字节一致):hf download chenhaodev/stcc-checker-0.6b-GGUF \ Qwen3-0.6B.Q8_0.gguf Modelfile.Q8_0 --local-dir stcc cd stcc && ollama create stcc-checker -f Modelfile.Q8_0之后
ollama run stcc-checker/ API 调用都无需再传think。
⚠️ 不是急诊分诊系统,不做诊断,不能替代医生。L1–L5 是处置阶梯 (叫救护车 / 立即急诊 / 今天就医 / 近两日门诊 / 居家观察)。紧急情况直接拨 120。
用法
ollama pull hf.co/chenhaodev/stcc-checker-0.6b-GGUF:Q8_0
输入格式(逐字节按这个拼,模板见随仓的 Modelfile.Q8_0):
叙述:{一段问诊记录}
判据:{一条判据}
→ 输出 yes / no / unknown 之一。
import json, urllib.request
MODEL = "hf.co/chenhaodev/stcc-checker-0.6b-GGUF:Q8_0"
def check(text, criterion, model=MODEL):
body = json.dumps({"model": model, "stream": False,
"prompt": f"叙述:{text}\n判据:{criterion}",
"think": False, # ← 必须。见下方警告
"options": {"temperature": 0, "num_predict": 8}}).encode()
req = urllib.request.Request("http://127.0.0.1:11434/api/generate", data=body,
headers={"Content-Type": "application/json"})
return json.loads(urllib.request.urlopen(req).read())["response"].strip()
check("我发烧到39度,浑身酸痛", "发热") # → 'yes'
check("我不发烧,就是有点咳嗽", "发热") # → 'no'
check("我肚子疼了两天", "发热") # → 'unknown'
🔴
"think": False那一行不能删 —— 删了会静默返回空字符串。原因见页首红框。
配套引擎(完整链路)
pip install stcc-mcp # 或从源码:github.com/devhc123/stcc-mcp
stcc-mcp doctor # 自检:索引 / Ollama / 模型
stcc-mcp triage --protocol Fever_Adult.md "$(cat 记录.txt)"
档位/分支/处置由纯标准库的确定性引擎算出(P(no)≥τ 阈值逻辑也在那一层,见 --no-threshold)。
仓库:https://github.com/devhc123/stcc-mcp (Apache-2.0)
本仓权重也可独立使用——就是上面那个三分类函数。
unknown 为什么是第一等状态
STCC 的分支语义是「本支任一条件为是 ⇒ 命中;全部为否 ⇒ 转下一支」。
"没提到" ≠ "说了没有":前者必须触发追问,后者才能转分支。
把 unknown 压成 no 等于凭空伪造阴性,会让引擎走到错误的分支。
实测
| split | n | acc | false_no🔴 |
no_recall |
|---|---|---|---|---|
| test_unseen(协议完全没见过) | 3,224 | 0.9529 | 0.0024 | 0.9784 |
| test_seen · new_record(协议见过、记录没见过) | 1,251 | 0.9528 | 0.0000 | 0.9286 |
| test_seen · seen_record(记录也见过) | 487 | 0.9692 | 0.0000 | 0.9861 |
| Q4_K_M · test_unseen | 3,224 | 0.9498 | 0.0035 | 0.9770 |
false_no(该成立却判成no)是硬门,因为假no会把真值分支从引擎的安全收敛里排除掉。 少判no只造成过分诊,是成本旋钮。test_seen故意拆两轨报:28% 的记录文本在训练集出现过(配的是别的判据)。 合并会被记忆抬高——实测记忆增益仅 +1.64pt。可泛化读数是new_record那行。- 解析失败 0、截断 0。延迟中位 ~250ms(Mac / Ollama)。
- 量化:Q8→Q4 掉 0.3pt;硬门优先推荐 Q8。
端到端(合成分诊问询记录池):分支忠实度 0.95、1.25s/条、¥0; 对照 deepseek-v4-flash 当 checker 0.97 / 32.0s / ~¥0.03。
判 no 的门槛是一个旋钮,不是模型的固有属性
argmax 在改写版判据上不在 Pareto 前沿:三分类里 no 会在 P(no)<0.5 时靠三方竞争胜出,
而那些正是最不确定的样本。用 P(no) ≥ τ 代替 argmax(否则在 yes/unknown 里取大者):
| τ | acc | false_no🔴 |
no_recall |
|---|---|---|---|
| 0.63(默认,dev 上按 false_no≤0.0036 选) | 0.9426 | 0.0000 | 0.9027 |
| 0.50 | 0.9457 | 0.0000 | 0.9189 |
| 0.40 | 0.9495 | 0.0024 | 0.9378 |
| 0.30 | 0.9498 | 0.0084 | 0.9432 |
| 0.10 | 0.9516 | 0.0120 | 0.9635 |
⚠️ 这一档只在改写版判据(发布分布)上成立——原文判据上 argmax 已在前沿。
它是分布偏移带来的校准偏移,不是通用调参。
⚠️ 校准集只有 495 条正例(false_no 分辨率 0.0020),定不出更细的点,且系统性偏保守。
所以没有硬钉"最优值",而是把整条曲线一起发布,按自己的代价矩阵挑点。
已知边界(先读这段再决定用不用)
- 输入必须是「已按协议问过一轮」的记录,不是原始自述。
短主诉
unknown率 94%;真实富对话(IMCS-21,748 字 / 40 轮)仍有 88%。 原因是 STCC 前置分支筛的是急症红旗(噎着、发紫、无反应), 而自然产生的语料按定义不含这些情形、医生也不会去问——这是选择效应,换更富的语料无效。 - 一次真实问诊不会把一支的判据全问完,于是档位停在该支上界。 这是安全收敛在正确工作,但上界松紧完全由问诊完备性决定。
- 分级本身是 silver:分支级参照由强模型定稿 + 人工复核,终局结论仍缺一个真人护士 gold。
- 不要对模型做输入路由:判别类模型应对所有输入都调用;能力边界由编排层判断。 模型没有"我不判"的出口——那是一条合法沉默路径,而沉默型漏报在评测中不可观测。
训练
Qwen3-0.6B + Unsloth LoRA(r=128 / α=128 / lr=2e-4 / 3 epoch / bf16,A40 ≈ $0.75)。
train_on_responses_only,metric_for_best_model 取非对称指标(漏判方向)。
Chat template 三处(train / eval / Modelfile)逐字节一致;
response_part 用差值导出——Qwen3-0.6B 在 enable_thinking=False 下自带一个空 think 块,
照常规写成 <|im_start|>assistant\n 会把它算进训练目标,且不报任何错。
判据文本为逐条独立改写版(5,214/5,214),不含 STCC 原文表达; 纯阈值与单个医学术语(「咳嗽」「体温>100.4°F」)按事实保留。 改写过三道闸:数值/否定/长度/雷同的形式校验、oracle 回放与原版逐位一致、下游指标不掉。
完整复盘(含四次被自己的数据否掉的判断、一次不采纳的重训、以及那条阈值曲线的推导)见项目报告(未公开)。
- Downloads last month
- 130
4-bit
8-bit