Text Generation
Transformers
Safetensors
GGUF
English
Chinese
qwen3_5
image-text-to-text
fastbrain
clef
llama-cpp
sglang
systemone
decision-model
image-text-to-typed-output
decision-index
tool-calling
function-calling
intent-classification
structured-decision
conversational
Eval Results
Instructions to use TypeScript/FastBrain-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TypeScript/FastBrain-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TypeScript/FastBrain-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("TypeScript/FastBrain-9B") model = AutoModelForMultimodalLM.from_pretrained("TypeScript/FastBrain-9B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TypeScript/FastBrain-9B 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 TypeScript/FastBrain-9B:Q4_K_M # Run inference directly in the terminal: llama cli -hf TypeScript/FastBrain-9B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf TypeScript/FastBrain-9B:Q4_K_M # Run inference directly in the terminal: llama cli -hf TypeScript/FastBrain-9B:Q4_K_M
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 TypeScript/FastBrain-9B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf TypeScript/FastBrain-9B:Q4_K_M
Use Docker
docker model run hf.co/TypeScript/FastBrain-9B:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use TypeScript/FastBrain-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TypeScript/FastBrain-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TypeScript/FastBrain-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TypeScript/FastBrain-9B:Q4_K_M
- SGLang
How to use TypeScript/FastBrain-9B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TypeScript/FastBrain-9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TypeScript/FastBrain-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "TypeScript/FastBrain-9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TypeScript/FastBrain-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use TypeScript/FastBrain-9B with Ollama:
ollama run hf.co/TypeScript/FastBrain-9B:Q4_K_M
- Unsloth Desktop
- Pi
How to use TypeScript/FastBrain-9B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf TypeScript/FastBrain-9B:Q4_K_M
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": "TypeScript/FastBrain-9B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use TypeScript/FastBrain-9B with Docker Model Runner:
docker model run hf.co/TypeScript/FastBrain-9B:Q4_K_M
- Lemonade
How to use TypeScript/FastBrain-9B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TypeScript/FastBrain-9B:Q4_K_M
Run and chat with the model
lemonade run user.FastBrain-9B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use TypeScript/FastBrain-9B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf TypeScript/FastBrain-9B: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 TypeScript/FastBrain-9B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use TypeScript/FastBrain-9B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf TypeScript/FastBrain-9B: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 "TypeScript/FastBrain-9B: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"
Verify live leaderboard standings across 109 model entries, polish README.md, and add full Chinese README_zh.md
Browse files- README.md +69 -52
- README_zh.md +358 -0
README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
|
|
|
| 5 |
library_name: transformers
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
base_model: Cloudflare/clef-flash
|
|
@@ -27,45 +28,54 @@ tags:
|
|
| 27 |
|
| 28 |
# FastBrain-9B
|
| 29 |
|
| 30 |
-
**Non-Autoregressive System-1 Structured Decision Model (`9.4B` Parameters)**
|
| 31 |
|
| 32 |
[-3b82f6?style=flat-square)](#architecture)
|
| 33 |
-
[](./LICENSE)
|
| 38 |
|
|
|
|
|
|
|
| 39 |
</div>
|
| 40 |
|
| 41 |
-
**FastBrain-9B** (`9.4B` total parameters: `Qwen3.5-9B` hybrid backbone + `116M` `JointSchemaHead`) is a
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
---
|
| 48 |
|
| 49 |
## Benchmark Evaluation & Official Leaderboard Rankings
|
| 50 |
|
| 51 |
-
### Official Leaderboard Standing
|
| 52 |
|
| 53 |
-
| Official Leaderboard / Track |
|
| 54 |
| :--- | :---: | :---: | :---: | :---: | :--- |
|
| 55 |
-
| **[`safeagents-judge-bench`](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) *(7-Way Category
|
| 56 |
-
| **[`safeagents-judge-bench`](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) *(Binary Guardrail
|
| 57 |
-
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(Zero-Shot Overall)***<br>([Merged PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58) · [Trace](./eval_submissions/typescript_fastbrain-9b.json)) | **
|
| 58 |
-
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(Zero-Shot `<=9B`
|
| 59 |
-
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(Fitted on `train`)***<br>([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57) · [Trace](./eval_submissions/typescript_fastbrain-9b-fitted.json)) | **
|
| 60 |
-
| **Cloudflare Decision Index (v0.2.1)** *(10-Task Macro)* | 7 Models | **`80.55%` Mean** | **#2 / 7 Overall**<br>**#1 / 10 (`<=9B`)** | **Top 28.6% Overall**<br>**10/10
|
| 61 |
|
| 62 |
---
|
| 63 |
|
| 64 |
-
### Cloudflare Decision Index (v0.2.1) & Parameter Scale Comparison
|
| 65 |
|
| 66 |
-
Evaluated on the official **Cloudflare Decision Index (v0.2.1)** across **10 benchmarks (22,427 evaluation requests)**, **FastBrain-9B (`9.4B`)** achieves an overall Macro Mean of **`80.55%`**:
|
| 67 |
-
- **
|
| 68 |
-
- **Outperforms `3x`-
|
| 69 |
|
| 70 |

|
| 71 |
|
|
@@ -94,43 +104,49 @@ Evaluated on the official **Cloudflare Decision Index (v0.2.1)** across **10 ben
|
|
| 94 |
| **When2Call**<br>*(Macro-F1)* | **81.13%**<br>*(#1 9B)* | 65.58% | 70.64% | 72.37% | **81.91%** | 75.44% | 48.92% |
|
| 95 |
| **Macro Mean**<br>*(10 Tasks)* | **80.55%**<br>*(#2 · #1 9B)* | 74.96% | 76.51% | **81.81%** | 80.32% | 69.14% | 58.09% |
|
| 96 |
|
|
|
|
|
|
|
| 97 |
### External Community Benchmarks (`safeagents-judge-bench` & `LocalLLaMA/typed-decisions`)
|
| 98 |
|
| 99 |
#### 1. [`harness-hub/safeagents-judge-bench`](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) (`v2`: 661 Agent Tool Calls · 82 Unsafe Trajectories · 7 Categories)
|
| 100 |
|
| 101 |
-
> **Official `v2` Leaderboard
|
| 102 |
-
> - **Rank `#1 / 8` Overall on 7-Way Category
|
| 103 |
-
> - **
|
| 104 |
|
| 105 |
-
| Model (`safeagents-judge-bench v2`) | Params | Cat. Macro-F1 ↑ | Cat. Acc ↑ | AUROC ↑ | Balanced Acc ↑ | Recall
|
| 106 |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 107 |
-
| **`TypeScript/FastBrain-9B` *(`v2` Official · Default `t=0.50`)*** | **9.4B** | **75.1%** *(#1 / 8)* | **85.8%** *(#1 / 8)* | **98.5%** | 81.4% | **99.6%**
|
| 108 |
-
| **`TypeScript/FastBrain-9B` *(`v2` Calibrated · `t=0.961`)*** | **9.4B** | **75.1%** *(#1)* | **85.8%** *(#1)* | **98.5%** | **93.8%** | 93.1%
|
| 109 |
-
| **`TypeScript/FastBrain-9B` *(`
|
| 110 |
-
| `Cloudflare/clef` | 27.4B | 56.3% *(#2)* | 73.7% *(#2)* | **99.3%** | 80.8% | **100.0%**
|
| 111 |
-
| `vllm-sr/d3-mini` | 1.8B | 51.2% *(#3)* |
|
| 112 |
-
| `Cloudflare/clef-flash` *(Base Model)* | 9.4B | 46.2% *(#4)* | 57.6% *(#
|
| 113 |
-
| `Cloudflare/clef-omni` | 30B-A3B | 43.7% *(#5)* |
|
| 114 |
-
| `knowledgator/gliclass-v4-edge` | 0.4B | 37.3% *(#6)* |
|
| 115 |
-
| `fastino/GLiNER2.5-Decide` | 0.5B | 35.5% *(#7)* |
|
| 116 |
-
| `LiquidAI/d1-3B` | 3B | 32.8% *(#8)* |
|
| 117 |
|
| 118 |
#### 2. [`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) (400 Test Cases · 2,000 Typed Decisions Across 4 Enterprise Workflows)
|
| 119 |
|
| 120 |
-
> **
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
|
| 125 |
-
|
|
| 126 |
-
| **`TypeScript/FastBrain-9B` *(
|
| 127 |
-
| **`TypeScript/FastBrain-9B` *(
|
| 128 |
-
| `
|
| 129 |
-
| `
|
| 130 |
-
| `
|
| 131 |
-
| `
|
| 132 |
-
| `
|
| 133 |
-
| `
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
---
|
| 136 |
|
|
@@ -152,7 +168,7 @@ Evaluated on the official **Cloudflare Decision Index (v0.2.1)** across **10 ben
|
|
| 152 |
|
| 153 |
### 1. PyTorch / Transformers (`bfloat16` or `4-bit` / `8-bit` Quantized on Colab T4)
|
| 154 |
|
| 155 |
-
`TypeScript/FastBrain-9B` is a drop-in replacement for `Cloudflare/clef-flash` using the standard `joint_schema_model` runtime. It supports both full-precision `bfloat16` (`18.82 GB`, for `>=24 GB` GPUs such as L4 / RTX 4090 / PRO 6000) and mixed-precision **`load_in_4bit=True` (`~6.8 GB` VRAM, runs on a free Google Colab T4 16GB GPU)** or **`load_in_8bit=True` (`~11.2 GB` VRAM)** while keeping the `116M` `JointSchemaHead` in native `bfloat16`/`float16`:
|
| 156 |
|
| 157 |
```python
|
| 158 |
from huggingface_hub import snapshot_download
|
|
@@ -387,7 +403,7 @@ Because `FastBrain-9B` scores all schema questions and candidate options in a **
|
|
| 387 |
| **PyTorch `load_in_4bit=True`** *(NF4 + `fp16` Head)* | `~5.5 GB` | `~6.2 – 6.8 GiB` | **Tesla T4 (16GB) / RTX 3060–4060 (8GB+)** |
|
| 388 |
| **`FastBrain-9B-Q8_0.gguf`** *(Full 8-bit GGUF)* | `9.66 GB` | `~9.0 – 12.6 GiB` | **12GB–16GB GPU / Tesla T4 (16GB) / Mac 16GB+** |
|
| 389 |
| **PyTorch `load_in_8bit=True`** *(INT8 + `bf16` Head)* | `~9.6 GB` | `~11.2 GiB` | **Tesla T4 (16GB) / RTX 4070 Ti (12GB+)** |
|
| 390 |
-
| **Native `bfloat16` (`safetensors` / `BF16.gguf`)** | `18.82 GB` (`18.16 GB`) | `20.3 – 24.7 GiB` | **NVIDIA L4 (24GB) / RTX 3090–4090 / PRO 6000
|
| 391 |
|
| 392 |
---
|
| 393 |
|
|
@@ -402,9 +418,10 @@ Because `FastBrain-9B` scores all schema questions and candidate options in a **
|
|
| 402 |
| `FastBrain-9B-BF16.gguf` | `18.16 GB` | Full-precision `bfloat16` GGUF (`ClefModel` architecture for `llama-server`) |
|
| 403 |
| `mmproj-FastBrain-9B-Q8_0.gguf` & `BF16.gguf` | `624 MB` / `922 MB` | Multimodal vision projector GGUF files for image/screenshot states |
|
| 404 |
| `joint_schema_model.py` | `25 KB` | `ClefModel`, `JointSchemaHead`, `load_release_model(load_in_4bit/8bit)`, and `systemone()` runtime |
|
| 405 |
-
| `eval_submissions/typescript_fastbrain-9b.json` | `901 KB` | Full 400-case / 2,000-decision Zero-Shot prediction trace for `LocalLLaMA/typed-decisions` ([PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58)) |
|
| 406 |
| `eval_submissions/typescript_fastbrain-9b-fitted.json` | `902 KB` | Full 400-case / 2,000-decision Fitted (`train`-calibrated) prediction trace for `LocalLLaMA/typed-decisions` ([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57)) |
|
| 407 |
| `eval_submissions/TypeScript__FastBrain-9B*.jsonl` | `110 KB` | Full 661-call (`v2`) binary & 7-way category prediction traces for `harness-hub/safeagents-judge-bench` ([Merged PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1)) |
|
| 408 |
-
| `.eval_results/*.yaml` | `2.3 KB` | Official Hugging Face Hub benchmark evaluation metadata (`typed-decisions` & `safeagents-judge-bench`) |
|
|
|
|
| 409 |
| `config.json`, `tokenizer.json`, `processor_config.json` | `11 MB` | Standard Hugging Face model, tokenizer, and processor configurations |
|
| 410 |
| `assets/*.png` | `1.2 MB` | High-resolution technical benchmark and calibration charts |
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
- zh
|
| 6 |
library_name: transformers
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
base_model: Cloudflare/clef-flash
|
|
|
|
| 28 |
|
| 29 |
# FastBrain-9B
|
| 30 |
|
| 31 |
+
**Single-Pass Non-Autoregressive System-1 Structured Decision Model (`9.4B` Parameters)**
|
| 32 |
|
| 33 |
[-3b82f6?style=flat-square)](#architecture)
|
| 34 |
+
[-10b981?style=flat-square)](#architecture)
|
| 35 |
+
[_%C2%B7_82%2F82_Caught-ec4899?style=flat-square)](#1-harness-hubsafeagents-judge-bench-v2-661-agent-tool-calls--82-unsafe-trajectories--7-categories)
|
| 36 |
+
[-8b5cf6?style=flat-square)](#2-localllamatyped-decisions-400-test-cases--2000-typed-decisions-across-4-enterprise-workflows)
|
| 37 |
+
[-f59e0b?style=flat-square)](#cloudflare-decision-index-v021--parameter-scale-comparison)
|
| 38 |
[](./LICENSE)
|
| 39 |
|
| 40 |
+
**English** | **[简体中文 (Chinese README)](./README_zh.md)**
|
| 41 |
+
|
| 42 |
</div>
|
| 43 |
|
| 44 |
+
**FastBrain-9B** (`9.4B` total parameters: `Qwen3.5-9B` hybrid Gated DeltaNet + Full-Attention backbone + `116M` `JointSchemaHead`) is a high-throughput, non-autoregressive **System-1 structured decision model** built to beat `27B–35B` decision models at a fraction of their compute and latency.
|
| 45 |
+
|
| 46 |
+
Given an arbitrary JSON or multimodal state and one or more typed decision schemas (`choice`, `noul` binary verification, or `score` ordinal rubric), **FastBrain-9B** evaluates every question and candidate option **jointly in a single prefill forward pass (`0` generated tokens)**—returning calibrated option probabilities, tool-call selections, guardrail verdicts, and open-set abstention decisions in **`30–50 ms` (`14,600–19,300+ tok/s`)**.
|
| 47 |
+
|
| 48 |
+
All fine-tuned backbone updates (`104` projection layers across all `32` hybrid blocks) are merged directly into `model-00001-of-00004.safetensors` .. `model-00004-of-00004.safetensors`, and all `122` decision-head tensors are packaged in `joint_head.safetensors` (plus turnkey `Q8_0` / `Q4_K_M` / `BF16` GGUF builds for `llama-server`). **No external LoRA or PEFT adapter is required at inference time.**
|
| 49 |
|
| 50 |
+
### Why `FastBrain-9B` Stands Out
|
| 51 |
|
| 52 |
+
- **Dominant `#1` on Real-World Agent Security (`safeagents-judge-bench` `v2` & `v1`)**: Ranks **`#1 / 8` overall** on the official `v2` 7-Way Misuse Category Leaderboard (**`75.1%` Macro-F1 · `85.8%` Accuracy**, beating `3x`-larger `27.4B Cloudflare/clef` by **`+18.8 pp`** and base `clef-flash` by **`+28.9 pp`**), catches **`82 / 82` (`100%`)** unsafe trajectories (`98.5%` AUROC · `99.6%` Recall; **`93.8%` Calibrated Bal. Acc**), and swept **`#1 / 9` on both Binary (`97.4%`) and Category (`85.0%`)** tracks in `v1`.
|
| 53 |
+
- **Top-Tier Zero-Shot Generalization & Fastest Latency on `LocalLLaMA/typed-decisions` (`94` Total Model Entries)**: Ranked **`#7 / 43` Overall Zero-Shot** (`#5 / 36` Open-Weight, **`#2 / 19` `<=9B` Open-Weight**, and **`#1` across all `Clef`-architecture models of any size**), while delivering **`50 ms` p50 latency—the `#1` fastest model in the entire Top 28 (`>70%` accuracy tier)** (`66.7x` faster than `#1 Quyet-1.0-Large` `3,335 ms`, `7.1x` faster than `27B Amos 1 large` `357 ms`). Also live on the Fitted Leaderboard at **`#12` Tied (`#14 / 51`, `79.70%` / `80.70%` Acc, `0.0816` KL)**—ranking **`#1` in KL calibration and `#1` `<=9B` among frozen-weight models (`no weights changed`)**.
|
| 54 |
+
- **Outperforms `3x`-Larger `27B` Models on Cloudflare Decision Index (`v0.2.1`)**: Achieves **`80.55%` 10-Benchmark Macro Mean (`#2 / 7` Overall across all parameter scales)**, sweeping **`10 / 10` benchmarks (`#1` on every task) among `<=9B` models** (`+5.59 pp` over base `Clef-flash`), outperforming `27B Jev` (`80.32%`) overall, and beating `27.4B Cloudflare/clef` head-to-head on **`5 / 10` benchmarks**.
|
| 55 |
+
- **Production-Ready Across SGLang, `llama.cpp` GGUF, and PyTorch `4-bit`**: Ships with a `1.90x` faster fused FlashAttention decision head (`max_logit_diff = 0.00000`), lossless `Q8_0.gguf` (`99.86%` Top-1 agreement with `BF16`), and `6.73 GB` `Q4_K_M.gguf` (`98.78%` agreement, runs in `6.78 GiB` VRAM on a 16GB T4 or Apple Silicon Mac).
|
| 56 |
|
| 57 |
---
|
| 58 |
|
| 59 |
## Benchmark Evaluation & Official Leaderboard Rankings
|
| 60 |
|
| 61 |
+
### Official Live Leaderboard Standing Summary (Verified Across 109 Official Model Entries)
|
| 62 |
|
| 63 |
+
| Official Leaderboard / Track | Live Entries | **`FastBrain-9B` Score** | **Official Rank** | **Top Percentile** | Key Models Outperformed (`Params` & Score) |
|
| 64 |
| :--- | :---: | :---: | :---: | :---: | :--- |
|
| 65 |
+
| **[`safeagents-judge-bench` (`v2`)](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) *(7-Way Category)***<br>([Merged PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1) · [Dataset Card](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench)) | **8 Decision Models**<br>*(+2 Baselines)* | **`75.1%` Macro-F1**<br>**`85.8%` Cat. Acc** | **#1 / 8 *(Live)*** | **Top 12.5% *(Rank #1)*** | `Cloudflare/clef` *(27.4B, #2 `56.3%` F1 / `73.7%` Acc)*, `vllm-sr/d3-mini` *(#3 `51.2%`)*, `Cloudflare/clef-flash` *(9.4B, #4 `46.2%`)*, `clef-omni` *(30B, #5 `43.7%`)* |
|
| 66 |
+
| **[`safeagents-judge-bench` (`v2` & `v1`)](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) *(Binary Guardrail)***<br>([Merged PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1) · [`v1` Tag](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v1)) | **8 Models (`v2`)**<br>**9 Models (`v1`)** | **`82/82` (`100%`) Traj. · `98.5%` AUROC**<br>*(`93.8%` Cal. / `81.4%` Raw `v2` · **`97.4%` `v1`**)* | **`#1 / 9` (`v1` Live)**<br>**`100%` Caught · #3 AUROC (`v2`)** | **Top 11.1% (`v1`)**<br>**Top 37.5% AUROC (`v2`)** | Beats `27.4B Cloudflare/clef` (`80.8%` Raw Bal. Acc), `clef-flash` (`96.7%` AUROC, `81/82` Traj.), `clef-omni` (`94.6%` AUROC, `81/82`), `d1-3B` (`68/82` Traj.) |
|
| 67 |
+
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(Zero-Shot Overall)***<br>([Merged PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58) · [Trace](./eval_submissions/typescript_fastbrain-9b.json)) | **43 Models**<br>*(36 Open-Weight)* | **`75.25%` / `76.25%` Acc**<br>*(KL `0.1508` · Brier `0.0795` · **`50 ms`**)* | **#7 / 43 *(Live)***<br>**#5 / 36 Open-Weight** | **Top 16.3% Overall**<br>**Top 13.9% Open** | `vllm-sr/d3` *(27B, #8 `74.9%`)*, `Baseten Elephant 1` *(9B, #9 `74.8%`)*, `Darwin-27B` *(#10 `74.3%`)*, `Cloudflare/clef` *(27B, #16 `72.8%`)*, `openjev` *(27B, #17 `72.8%`)* |
|
| 68 |
+
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(Zero-Shot `<=9B` & Clef-Arch)*** | **19 `<=9B` Open**<br>**4 Clef-Arch** | **`75.25%` / `76.25%` Zero-Shot**<br>*(Distilled Raw: **`77.35%`** · **`50 ms`**)* | **#2 / 19 `<=9B` Open**<br>**#1 Clef-Arch · #1 Speed** | **Top 10.5% (`<=9B`)** | Beats 17 of 18 `<=9B` open models (`d3-mini` `74.3%`, `d3-flash` `71.7%`, `signpost-d-4b` `71.2%`, `clef-flash` `71.0%`, `d1-3B` `65.6%`) & `35B clef-omni` (`67.3%`) |
|
| 69 |
+
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(Fitted on `train`)***<br>([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57) · [Trace](./eval_submissions/typescript_fastbrain-9b-fitted.json)) | **51 Models** | **`79.70%` / `80.70%` Acc**<br>*(KL **`0.0816`** · Brier **`0.0437`** · **`50 ms`**)* | **#12 Tied *(#14 / 51 Live)***<br>**#1 Frozen `<=9B` · #1 Frozen KL** | **Top 23.5% Overall**<br>*(Zero Weight Updates)* | Beats **37** fine-tuned/specialist models: `Rev-gen1-midi` *(25.6B, `79.45%`)*, `OpenDecider-small-td` *(4B, `79.2%`)*, `OpenDecider-medium-td` *(30B, `78.8%`)*, `Seb-9B` *(`75.4%`)* |
|
| 70 |
+
| **Cloudflare Decision Index (`v0.2.1`)** *(10-Task Macro)* | **7 Models** | **`80.55%` Macro Mean** | **#2 / 7 Overall**<br>**#1 / 10 (`<=9B` Sweep)** | **Top 28.6% Overall**<br>**10/10 `#1` (`<=9B`)** | Outperforms `Jev` *(27B, `80.32%`)*, `Kev 9B` *(`76.51%`)*, `Clef-flash` *(9.4B, `74.96%`)*, `DiffGemma` *(26B, `69.14%`)*, and beats `27.4B Clef` on **5 / 10** tasks |
|
| 71 |
|
| 72 |
---
|
| 73 |
|
| 74 |
+
### Cloudflare Decision Index (`v0.2.1`) & Parameter Scale Comparison
|
| 75 |
|
| 76 |
+
Evaluated on the official **Cloudflare Decision Index (`v0.2.1`)** across **10 benchmarks (`22,427` evaluation requests)**, **FastBrain-9B (`9.4B`)** achieves an overall Macro Mean of **`80.55%`**:
|
| 77 |
+
- **Clean Sweep (`10 / 10` `#1` Ranks) Across All `<=9B` Models**: Outperforms the same-size base model `Clef-flash` (`9.4B`, `74.96%`) by **`+5.59 pp`** (including **`+31.67 pp`** on `CLINC150+OOS` and **`+15.55 pp`** on `When2Call`), `Kev 9B` (`9B`, `76.51%`) by **`+4.04 pp`**, and `Laya` (`0.4B`, `58.09%`) by **`+22.46 pp`**.
|
| 78 |
+
- **Outperforms `3x`-Larger `27B`-Class Models**: Surpasses `Jev` (`27B`, `80.32%`) and `DiffusionGemma Jev` (`26B-A4B`, `69.14%`) in 10-benchmark Macro Mean, and beats the `3x`-larger flagship `Clef` (`27.4B`, `81.81%`) head-to-head on **5 out of 10 benchmarks** (`BFCL`, `API-Bank`, `CLINC150+OOS`, `Home appliances`, and `When2Call`, claiming outright **`#1` overall across all model sizes on 4 of them**).
|
| 79 |
|
| 80 |

|
| 81 |
|
|
|
|
| 104 |
| **When2Call**<br>*(Macro-F1)* | **81.13%**<br>*(#1 9B)* | 65.58% | 70.64% | 72.37% | **81.91%** | 75.44% | 48.92% |
|
| 105 |
| **Macro Mean**<br>*(10 Tasks)* | **80.55%**<br>*(#2 · #1 9B)* | 74.96% | 76.51% | **81.81%** | 80.32% | 69.14% | 58.09% |
|
| 106 |
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
### External Community Benchmarks (`safeagents-judge-bench` & `LocalLLaMA/typed-decisions`)
|
| 110 |
|
| 111 |
#### 1. [`harness-hub/safeagents-judge-bench`](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) (`v2`: 661 Agent Tool Calls · 82 Unsafe Trajectories · 7 Categories)
|
| 112 |
|
| 113 |
+
> **Official `v2` & `v1` Leaderboard Verification ([Merged PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1) by `@ybelkada` · [`.eval_results/safeagents-judge-bench.yaml`](./.eval_results/safeagents-judge-bench.yaml))**: Evaluated zero-shot via Hugging Face Jobs on `NVIDIA A100-SXM4-80GB` across `661` suspicious agent tool calls (`536` malicious `block` calls across `82` unsafe trajectories + `125` benign `allow` calls):
|
| 114 |
+
> - **Rank `#1 / 8` Overall on 7-Way Misbehaviour Category Track (`v2`)**: Achieves **`75.1%` Category Macro-F1** and **`85.8%` Category Accuracy (`567/661`)**—leading `#2 Cloudflare/clef` (`27.4B`, `56.3%` Macro-F1 / `73.7%` Acc) by **`+18.8 pp` Macro-F1 (`+12.1 pp` Acc)**, `#3 vllm-sr/d3-mini` (`51.2%`) by **`+23.9 pp`**, and base `Cloudflare/clef-flash` (`46.2%` / `57.6%` Acc) by **`+28.9 pp` Macro-F1 (`+28.2 pp` Acc)**.
|
| 115 |
+
> - **`100%` (`82 / 82`) Unsafe Trajectories Caught & `98.5%` AUROC on Binary Guardrail (`v2`)**: Blocks **`534 / 536` (`99.6%`)** malicious calls (`100%` recall on `harness_introspection` `272/272`, `credential_misuse` `15/15`, and `sandbox_escape` `4/4`; `99.2%` on `eval_gaming` `243/245`) with **`0` median leaked bad calls before catch**. At the uncalibrated default threshold (`P(block) >= 0.50`), Balanced Accuracy is **`81.4%`** (beating `27.4B Cloudflare/clef` at `80.8%`); calibrating the threshold (`P(block) >= 0.961`) reaches **`93.8%` Balanced Accuracy (`5.6%` False Block Rate)** while still catching **`82/82` (`100%`)** unsafe trajectories. On the [`v1` (`562`-call) official release](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v1), `FastBrain-9B` ranked **`#1 / 9` on both Binary (`97.4%` Bal. Acc) and Category (`85.0%` Macro-F1)** tracks.
|
| 116 |
|
| 117 |
+
| Model (`safeagents-judge-bench v2` Official) | Params | Cat. Macro-F1 ↑ | Cat. Acc ↑ | AUROC ↑ | Balanced Acc ↑ | Recall ��� | False Blocks ↓ | Traj. Caught ↑ | P50 Latency *(Hardware)* |
|
| 118 |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 119 |
+
| **`TypeScript/FastBrain-9B` *(`v2` Official · Default `t=0.50`)*** | **9.4B** | **75.1%** *(#1 / 8)* | **85.8%** *(#1 / 8)* | **98.5%** | 81.4% | **99.6%** | 36.8% | **82 / 82 *(100%)*** | 327 ms *(A100 · **104 ms G4**)* |
|
| 120 |
+
| **`TypeScript/FastBrain-9B` *(`v2` Calibrated · `t=0.961`)*** | **9.4B** | **75.1%** *(#1)* | **85.8%** *(#1)* | **98.5%** | **93.8%** | 93.1% | **5.6%** | **82 / 82 *(100%)*** | 327 ms *(A100 · **104 ms G4**)* |
|
| 121 |
+
| **`TypeScript/FastBrain-9B` *(`v1` Official · 562 Calls)*** | **9.4B** | **85.0%** *(#1 / 9)* | **92.3%** *(#1 / 9)* | **98.3%** | **97.4%** *(#1 / 9)* | **100.0%** | **5.1%** | **78 / 78 *(100%)*** | **104 ms *(RTX PRO 6000)*** |
|
| 122 |
+
| `Cloudflare/clef` | 27.4B | 56.3% *(#2)* | 73.7% *(#2)* | **99.3%** | 80.8% | **100.0%** | 38.4% | **82 / 82 *(100%)*** | 636 ms *(A100)* |
|
| 123 |
+
| `vllm-sr/d3-mini` | 1.8B | 51.2% *(#3)* | 65.2% *(#3)* | 98.6% | 85.6% | **100.0%** | 28.8% | **82 / 82 *(100%)*** | 168 ms *(A100)* |
|
| 124 |
+
| `Cloudflare/clef-flash` *(Base Model)* | 9.4B | 46.2% *(#4)* | 57.6% *(#4)* | 96.7% | **89.3%** | 97.8% | 19.2% | 81 / 82 *(98.8%)* | 326 ms *(A100)* |
|
| 125 |
+
| `Cloudflare/clef-omni` | 30B-A3B | 43.7% *(#5)* | 56.4% *(#5)* | 94.6% | 87.7% | 91.4% | 16.0% | 81 / 82 *(98.8%)* | 285 ms *(A100)* |
|
| 126 |
+
| `knowledgator/gliclass-v4-edge` | 0.4B | 37.3% *(#6)* | 52.8% *(#7)* | 75.3% | 67.6% | 69.6% | 34.4% | 68 / 82 *(82.9%)* | 101 ms *(L4)* |
|
| 127 |
+
| `fastino/GLiNER2.5-Decide` | 0.5B | 35.5% *(#7)* | 62.0% *(#6)* | 51.7% | 57.6% | 15.1% | **0.0%** | 17 / 82 *(20.7%)* | 117 ms *(M5 Pro)* |
|
| 128 |
+
| `LiquidAI/d1-3B` | 3B | 32.8% *(#8)* | 45.7% *(#8)* | 94.6% | 83.6% | 68.1% | 0.8% | 68 / 82 *(82.9%)* | **35 ms *(A100)*** |
|
| 129 |
|
| 130 |
#### 2. [`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) (400 Test Cases · 2,000 Typed Decisions Across 4 Enterprise Workflows)
|
| 131 |
|
| 132 |
+
> **Official Live Leaderboard Note (`43` Zero-Shot + `51` Fitted = `94` Model Entries)**:
|
| 133 |
+
> - **Zero-Shot Official Live Rank `#7 / 43` Overall (`#5 / 36` Open-Weight · `#2 / 19` `<=9B` Open-Weight · `#1` Clef-Arch)**: Published in [`eval_submissions/typescript_fastbrain-9b.json`](./eval_submissions/typescript_fastbrain-9b.json) and merged via [PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58), scoring **`75.25%` accuracy (`0.1508` KL · `0.0795` Brier · `50 ms` p50 latency)** under `bench/score_with_jobs.py` (**`76.25%`** under tied-top `scripts/score_model.py`). With **`50 ms` p50 latency**, `FastBrain-9B` is the **`#1` fastest model in the entire Top 28 (`>70%` accuracy tier)**—**`66.7x` faster** than `#1 Quyet-1.0-Large` (`3,335 ms`), **`10.5x` faster** than `#2 meraGPT Decider 1` (`526 ms`), and **`7.1x` faster** than `27B Amos 1 large` (`357 ms`).
|
| 134 |
+
> - **Fitted Official Live Rank `#12` Tied (`#14 / 51` Listed · `#1` Frozen-Weight KL & `<=9B`)**: Published in [`eval_submissions/typescript_fastbrain-9b-fitted.json`](./eval_submissions/typescript_fastbrain-9b-fitted.json) ([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57)), fitting only lightweight per-question priors and temperature on `train` (**`no weights changed`**) reaches **`79.70%` (`80.70%` tied-top) accuracy · `0.0816` KL · `0.0437` Brier · `50 ms`**, outperforming **37 fine-tuned and specialist models** (including `25.6B Rev-gen1-midi` `79.45%`, LoRA-fine-tuned `OpenDecider-small-td` `79.2%`, and `30B-A3B OpenDecider-medium-td` `78.8%`).
|
| 135 |
+
|
| 136 |
+
| Model | Params | Overall Acc ↑ | KL from Gold ↓ | Brier ↓ | `noul` Acc ↑ | `choice` Acc ↑ | `score` Acc ↑ | Agent Trace ↑ | Customer Svc ↑ | Invoice Proc ↑ | Security Inc ↑ | P50 Latency ↓ |
|
| 137 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 138 |
+
| **`TypeScript/FastBrain-9B` *(Fitted · No Weights Changed)*** | **9.4B** | **79.70% / 80.70%** | **0.0816** | **0.0437** | **86.7% / 88.0%** | **76.5% / 77.2%** | **76.9% / 77.9%** | **75.4% / 76.6%** | **82.0% / 83.4%** | **83.4% / 83.6%** | **78.0% / 79.2%** | **50 ms** |
|
| 139 |
+
| **`TypeScript/FastBrain-9B` *(Ordinal-KL Distilled Raw)*** | **9.4B** | **77.35%** *(#1 Raw)* | **0.1039** | **0.0582** | **84.8%** | **74.8%** | **73.8%** | **71.2%** | **80.4%** | **82.6%** | **75.2%** | **50 ms** |
|
| 140 |
+
| **`TypeScript/FastBrain-9B` *(Zero-Shot · Live #7 / 43)*** | **9.4B** | **75.25% / 76.25%** | **0.1508** | **0.0795** | **83.2% / 84.3%** | **74.7% / 76.0%** | **69.8% / 70.4%** | **68.2% / 69.8%** | **77.6% / 78.8%** | **82.0%** | **73.2% / 74.4%** | **50 ms** |
|
| 141 |
+
| `Amos 1 (large)` | 27B | 76.10% | 0.1260 | 0.0690 | 83.2% | 73.7% | 72.6% | 67.4% | 78.8% | 83.0% | 75.2% | 357 ms |
|
| 142 |
+
| `pplx-decider-v1.1-27b` | 27B | 75.30% | 0.4410 | 0.1600 | 85.2% | 73.7% | 69.1% | 66.4% | 80.2% | 80.2% | 74.4% | — |
|
| 143 |
+
| `vllm-sr/d3` | 27B | 74.90% | 0.4090 | 0.1460 | 84.7% | 68.5% | 72.4% | 67.2% | 76.6% | 82.8% | 73.0% | — |
|
| 144 |
+
| `Baseten Elephant 1` | 9B | 74.80% | 0.1340 | 0.0690 | — | — | — | — | — | — | — | 352 ms |
|
| 145 |
+
| `Darwin-27B-ZTC` | 27B | 74.30% | 0.2040 | 0.0970 | — | — | — | — | — | — | — | — |
|
| 146 |
+
| `Cloudflare/clef` | 27.4B | 72.75% | 0.1907 | 0.1032 | 84.5% | 64.8% | 69.9% | 63.8% | 74.2% | 78.6% | 74.4% | — |
|
| 147 |
+
| `vllm-sr/d3-flash` | 9B | 71.70% | 0.3220 | 0.1310 | — | — | — | — | — | — | — | — |
|
| 148 |
+
| `Cloudflare/clef-flash` *(Base Model)* | 9.4B | 71.00% | 0.2093 | 0.1105 | 81.5% | 71.3% | 62.9% | 62.0% | 76.0% | 76.4% | 69.6% | — |
|
| 149 |
+
| `Cloudflare/clef-omni` | 35B-A3B | 67.30% | 0.2469 | 0.1233 | 82.7% | 63.5% | 58.6% | 55.2% | 73.6% | 74.2% | 66.2% | — |
|
| 150 |
|
| 151 |
---
|
| 152 |
|
|
|
|
| 168 |
|
| 169 |
### 1. PyTorch / Transformers (`bfloat16` or `4-bit` / `8-bit` Quantized on Colab T4)
|
| 170 |
|
| 171 |
+
`TypeScript/FastBrain-9B` is a drop-in replacement for `Cloudflare/clef-flash` using the standard `joint_schema_model` runtime. It supports both full-precision `bfloat16` (`18.82 GB`, for `>=24 GB` GPUs such as L4 / A100 / RTX 4090 / PRO 6000) and mixed-precision **`load_in_4bit=True` (`~6.8 GB` VRAM, runs on a free Google Colab T4 16GB GPU)** or **`load_in_8bit=True` (`~11.2 GB` VRAM)** while keeping the `116M` `JointSchemaHead` in native `bfloat16`/`float16`:
|
| 172 |
|
| 173 |
```python
|
| 174 |
from huggingface_hub import snapshot_download
|
|
|
|
| 403 |
| **PyTorch `load_in_4bit=True`** *(NF4 + `fp16` Head)* | `~5.5 GB` | `~6.2 – 6.8 GiB` | **Tesla T4 (16GB) / RTX 3060–4060 (8GB+)** |
|
| 404 |
| **`FastBrain-9B-Q8_0.gguf`** *(Full 8-bit GGUF)* | `9.66 GB` | `~9.0 – 12.6 GiB` | **12GB–16GB GPU / Tesla T4 (16GB) / Mac 16GB+** |
|
| 405 |
| **PyTorch `load_in_8bit=True`** *(INT8 + `bf16` Head)* | `~9.6 GB` | `~11.2 GiB` | **Tesla T4 (16GB) / RTX 4070 Ti (12GB+)** |
|
| 406 |
+
| **Native `bfloat16` (`safetensors` / `BF16.gguf`)** | `18.82 GB` (`18.16 GB`) | `20.3 – 24.7 GiB` | **NVIDIA L4 (24GB) / A100 / RTX 3090–4090 / PRO 6000** |
|
| 407 |
|
| 408 |
---
|
| 409 |
|
|
|
|
| 418 |
| `FastBrain-9B-BF16.gguf` | `18.16 GB` | Full-precision `bfloat16` GGUF (`ClefModel` architecture for `llama-server`) |
|
| 419 |
| `mmproj-FastBrain-9B-Q8_0.gguf` & `BF16.gguf` | `624 MB` / `922 MB` | Multimodal vision projector GGUF files for image/screenshot states |
|
| 420 |
| `joint_schema_model.py` | `25 KB` | `ClefModel`, `JointSchemaHead`, `load_release_model(load_in_4bit/8bit)`, and `systemone()` runtime |
|
| 421 |
+
| `eval_submissions/typescript_fastbrain-9b.json` | `901 KB` | Full 400-case / 2,000-decision Zero-Shot prediction trace for `LocalLLaMA/typed-decisions` ([Merged PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58)) |
|
| 422 |
| `eval_submissions/typescript_fastbrain-9b-fitted.json` | `902 KB` | Full 400-case / 2,000-decision Fitted (`train`-calibrated) prediction trace for `LocalLLaMA/typed-decisions` ([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57)) |
|
| 423 |
| `eval_submissions/TypeScript__FastBrain-9B*.jsonl` | `110 KB` | Full 661-call (`v2`) binary & 7-way category prediction traces for `harness-hub/safeagents-judge-bench` ([Merged PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1)) |
|
| 424 |
+
| `.eval_results/*.yaml` | `2.3 KB` | Official Hugging Face Hub benchmark evaluation metadata (`typed-decisions` & `safeagents-judge-bench v2`) |
|
| 425 |
+
| `README.md` & `README_zh.md` | `32 KB` | Full technical documentation in English and Simplified Chinese |
|
| 426 |
| `config.json`, `tokenizer.json`, `processor_config.json` | `11 MB` | Standard Hugging Face model, tokenizer, and processor configurations |
|
| 427 |
| `assets/*.png` | `1.2 MB` | High-resolution technical benchmark and calibration charts |
|
README_zh.md
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
# FastBrain-9B
|
| 4 |
+
|
| 5 |
+
**单次前向、零生成 Token 的非自回归 System-1 结构化决策模型(`9.4B` 参数)**
|
| 6 |
+
|
| 7 |
+
[-3b82f6?style=flat-square)](#核心架构与技术创新)
|
| 8 |
+
[-10b981?style=flat-square)](#核心架构与技术创新)
|
| 9 |
+
[_%C2%B7_82%2F82_全拦截-ec4899?style=flat-square)](#1-harness-hubsafeagents-judge-benchv2661-条真实-agent-工具调用--82-条越界轨迹--7-类违规识别)
|
| 10 |
+
[-8b5cf6?style=flat-square)](#2-localllamatyped-decisions400-个企业级用例--2000-次类型化决策)
|
| 11 |
+
[-f59e0b?style=flat-square)](#cloudflare-decision-indexv02110-项评测全量对比)
|
| 12 |
+
[](./LICENSE)
|
| 13 |
+
|
| 14 |
+
**[English](./README.md)** | **简体中文**
|
| 15 |
+
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
**FastBrain-9B**(总参数量 `9.4B`:`Qwen3.5-9B` 混合 Gated DeltaNet + 全注意力基座 + `116M` 参数 `JointSchemaHead` 联合决策头)是一款专为**超低延迟、高并发、强校准结构化决策**打造的非自回归 **System-1(快思考)决策模型**,以 9B 级体量在多项权威榜单上正面击败 `27B–35B` 级大模型。
|
| 19 |
+
|
| 20 |
+
给定任意 JSON 状态或多模态图像上下文,以及一个或多个类型化决策 Schema(`choice` 多选路由、`noul` 二元真值校验、`score` 有序量表打分),**FastBrain-9B** 仅需**单次 Prefill 前向传播(`0` 个自回归生成 Token)**即可**同时并行评估所有问题与全部候选项**,在 **`30–50 ms`(吞吐达 `14,600–19,300+ tok/s`)**内直接输出经过严格概率校准的分布、工具调用选择、安全护栏拦截判定与开放集拒识结果。
|
| 21 |
+
|
| 22 |
+
全部微调更新(覆盖全部 `32` 层混合 Block 的 `104` 个线性注意力与自注意力投影层)均已**原地合并(In-Place Merged)**至主干权重 `model-00001-of-00004.safetensors` .. `00004` 中,`122` 个决策头张量独立封装于 `joint_head.safetensors`,并同步提供开箱即用的 `llama.cpp` 官方 GGUF 量化权重(`Q8_0` / `Q4_K_M` / `BF16`)。**推理时无需挂载任何外部 LoRA 或 PEFT 适配器。**
|
| 23 |
+
|
| 24 |
+
### 核心战绩与统治级亮点
|
| 25 |
+
|
| 26 |
+
- **真实 Agent 安全护栏榜单 `safeagents-judge-bench` 断层总冠军(`v2` & `v1` 双版本领跑)**:在 Hugging Face 官方独立评测的 `v2`(661 条真实危险工具调用)**7 分类违规识别赛道**以 **`75.1%` Macro-F1 / `85.8%` 准确率荣登全场 `#1 / 8` 总冠军**,领先 `3` 倍参数量的 `27.4B Cloudflare/clef`(`56.3%`)整整 **`+18.8 pp`**,领先同尺寸基座 `Cloudflare/clef-flash`(`46.2%`)**`+28.9 pp`**;在二分类护栏赛道实现 **`82 / 82`(`100%`)危险轨迹零漏网拦截**(`AUROC 98.5%` · `Recall 99.6%`,校准后平衡准确率 **`93.8%`**),并在 `v1` 官方榜单包揽**二分类(`97.4%`)与多分类(`85.0%`)双赛道 `#1 / 9`**。
|
| 27 |
+
- **企业级决策总榜 `LocalLLaMA/typed-decisions`(共 `94` 个参评模型)零样本前七 & 全场最快推理速度**:在 `43` 个模型的**零样本总榜位列 `#7 / 43`**(**开源权重模型 `#5 / 36`**、**`<=9B` 开源模型 `#2 / 19`**、**全部 `Clef` 架构模型不分尺寸 `#1`**),同时以 **`50 ms` p50 延迟成为 Top 28(准确率 `>70%` 梯队)中速度 `#1` 的模型**——比榜首 `31B Quyet-1.0-Large`(`3,335 ms`)**快 `66.7` 倍**,比 `27B Amos 1 large`(`357 ms`)**快 `7.1` 倍**!在 `51` 个模型的 **`train` 校准/微调总榜**同样已合入主榜(**并列 `#12` / 列表 `#14 / 51`**,准确率 **`79.70%` / `80.70%`**,`KL 0.0816`),在**不修改任何模型权重(Frozen-Weight)**的前提下拿下 **`<=9B` 第 1、全场 KL 校准第 1**,击败 37 个专门在训练集上微调权重的模型!
|
| 28 |
+
- **Cloudflare Decision Index(`v0.2.1`)跨量级越级击败 `27B` 模型**:在涵盖 `22,427` 次评测请求的 10 大基准测试中取得 **`80.55%` 宏平均分(全尺寸总榜 `#2 / 7`)**,在 **`<=9B` 级别豪取 `10 / 10` 全满贯第一**(比同尺寸基座 `Clef-flash` 暴涨 **`+5.59 pp`**,其中 `CLINC150+OOS` 暴涨 **`+31.67 pp`**、`When2Call` 暴涨 **`+15.55 pp`**),总分超越 `27B Jev`(`80.32%`),并在 **5 / 10 个单项上正面击败 `3` 倍参数量的旗舰 `27.4B Cloudflare/clef`**(其中 **4 个单项夺得全尺寸绝对第一**)。
|
| 29 |
+
- **全栈工业级部署生态(`SGLang` + `llama.cpp GGUF` + `PyTorch 4-bit`)**:内置向量化前缀和池化与变长 FlashAttention 融合算子(决策头加速 **`1.90x`**,`max_logit_diff = 0.00000`);`Q8_0.gguf` 与原生 `BF16` Top-1 决策一致率高达 **`99.86%`**(近乎完全无损);`Q4_K_M.gguf` 仅 **`6.73 GB`**,在免费 Colab T4(16GB)或 Mac M 系列芯片上仅占 `6.78 GiB` 显存即可满速运行。
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## 权威榜单评测与官方排名总览
|
| 34 |
+
|
| 35 |
+
### 官方实时排行榜名次汇总(已核验最新 109 个官方参评模型条目)
|
| 36 |
+
|
| 37 |
+
| 官方评测基准 / 赛道 | 实时参评规模 | **`FastBrain-9B` 核心得分** | **官方实时排名** | **所处百分位** | 正面击败的代表性模型(参数量与得分) |
|
| 38 |
+
| :--- | :---: | :---: | :---: | :---: | :--- |
|
| 39 |
+
| **[`safeagents-judge-bench` (`v2`)](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) *(7 分类违规识别)***<br>([已合入 PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1) · [官方榜单](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench)) | **8 个决策模型**<br>*(+2 基线)* | **`75.1%` Macro-F1**<br>**`85.8%` 分类准确率** | **#1 / 8 *(全场第 1)*** | **Top 12.5% *(断层冠军)*** | `Cloudflare/clef` *(27.4B, #2 `56.3%` F1 / `73.7%` Acc)*、`vllm-sr/d3-mini` *(#3 `51.2%`)*、`Cloudflare/clef-flash` *(9.4B, #4 `46.2%`)*、`clef-omni` *(30B, #5 `43.7%`)* |
|
| 40 |
+
| **[`safeagents-judge-bench` (`v2` & `v1`)](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2) *(二分类安全拦截)***<br>([已合入 PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1) · [`v1` 榜单](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v1)) | **8 模型 (`v2`)**<br>**9 模型 (`v1`)** | **`82/82` (`100%`) 轨迹全拦截 · `98.5%` AUROC**<br>*(`93.8%` 校准 / `81.4%` 默认 `v2` · **`97.4%` `v1`**)* | **`#1 / 9` (`v1` 总榜第 1)**<br>**`100%` 拦截 · AUROC #3 (`v2`)** | **Top 11.1% (`v1`)**<br>**Top 37.5% AUROC (`v2`)** | 默认阈值即击败 `27.4B Cloudflare/clef` (`80.8%`);AUROC 与轨迹拦截击败 `clef-flash` (`96.7%`, `81/82`)、`clef-omni` (`94.6%`, `81/82`)、`d1-3B` (`68/82`) |
|
| 41 |
+
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(零样本全量总榜)***<br>([已合入 PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58) · [预测轨迹](./eval_submissions/typescript_fastbrain-9b.json)) | **43 个模型**<br>*(36 个开源权重)* | **`75.25%` / `76.25%` 准确率**<br>*(KL `0.1508` · Brier `0.0795` · **`50 ms`**)* | **#7 / 43 *(实时总榜)***<br>**#5 / 36 开源权重总榜** | **Top 16.3% 总榜**<br>**Top 13.9% 开源** | 击败 `vllm-sr/d3` *(27B, #8 `74.9%`)*、`Baseten Elephant 1` *(9B, #9 `74.8%`)*、`Darwin-27B` *(#10 `74.3%`)*、`Cloudflare/clef` *(27B, #16 `72.8%`)*、`openjev` *(27B, #17 `72.8%`)* |
|
| 42 |
+
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(零样本 `<=9B` 及 Clef 架构榜)*** | **19 个 `<=9B` 开源**<br>**4 个 Clef 架构** | **`75.25%` / `76.25%` 零样本**<br>*(蒸馏原生头: **`77.35%`** · **`50 ms`**)* | **#2 / 19 `<=9B` 开源**<br>**#1 Clef 架构 · #1 极速** | **Top 10.5% (`<=9B`)** | 击败 18 个同级开源模型中的 17 个(`d3-mini` `74.3%`、`d3-flash` `71.7%`、`signpost-d-4b` `71.2%`、`clef-flash` `71.0%`、`d1-3B` `65.6%`)及 `35B clef-omni` (`67.3%`) |
|
| 43 |
+
| **[`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) *(`train` 校准/微调榜)***<br>([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57) · [预测轨迹](./eval_submissions/typescript_fastbrain-9b-fitted.json)) | **51 个模型** | **`79.70%` / `80.70%` 准确率**<br>*(KL **`0.0816`** · Brier **`0.0437`** · **`50 ms`**)* | **并列 #12 *(列表 #14 / 51)***<br>**冻结权重 `<=9B` #1 · KL #1** | **Top 23.5% 总榜**<br>*(零权重微调)* | **不改任何权重**即击败 **37** 个微调/专精模型:`Rev-gen1-midi` *(25.6B, `79.45%`)*、`OpenDecider-small-td` *(4B LoRA, `79.2%`)*、`OpenDecider-medium-td` *(30B LoRA, `78.8%`)*、`Seb-9B` *(`75.4%`)* |
|
| 44 |
+
| **Cloudflare Decision Index (`v0.2.1`)** *(10 任务宏平均)* | **7 个模型** | **`80.55%` 宏平均** | **#2 / 7 全尺寸总榜**<br>**`<=9B` 10/10 全满贯 #1** | **Top 28.6% 总榜**<br>**`<=9B` 100% 统治率** | 总分超越 `Jev` *(27B, `80.32%`)*、`Kev 9B` *(`76.51%`)*、`Clef-flash` *(9.4B, `74.96%`)*、`DiffGemma` *(26B, `69.14%`)*,并在 **5 / 10** 项任务中击败 `27.4B Clef` |
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
### Cloudflare Decision Index(`v0.2.1`):10 项评测全量对比
|
| 49 |
+
|
| 50 |
+
在官方 **Cloudflare Decision Index(`v0.2.1`)** 涵盖 **10 个评测基准(共 `22,427` 条评测请求)** 的完整测试中,**FastBrain-9B(`9.4B`)** 取得 **`80.55%`** 的总宏平均分:
|
| 51 |
+
- **`<=9B` 量级 `10 / 10` 单项全满贯第一**:全面超越同尺寸基座 `Clef-flash`(`9.4B`,`74.96%`)达 **`+5.59 pp`**(其中开放集意图拒识 `CLINC150+OOS` 提升 **`+31.67 pp`**,工具调用治理 `When2Call` 提升 **`+15.55 pp`**),领先 `Kev 9B`(`76.51%`)**`+4.04 pp`**,领先 `Laya`(`0.4B`,`58.09%`)**`+22.46 pp`**。
|
| 52 |
+
- **跨量级击败 `3` 倍参数量的 `27B` 级大模型**:10 任务宏平均分超越 `Jev`(`27B`,`80.32%`)与 `DiffusionGemma Jev`(`26B-A4B`,`69.14%`),并在 **`BFCL`、`API-Bank`、`CLINC150+OOS`、`Home appliances`、`When2Call` 五大基准上正面击败 `27.4B` 旗舰 `Clef`**(其中 **4 项夺得全尺寸全场第一**)。
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
|
| 56 |
+
### 10 大基准全参数量级得分矩阵
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
|
| 60 |
+
### 细粒度概率校准与开放集拒识可靠性分析
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
|
| 64 |
+
### 各参数量级模型逐项得分对比表
|
| 65 |
+
|
| 66 |
+
| 评测基准 | **FastBrain-9B**<br>*(9.4B · 本模型)* | Clef-flash<br>*(9.4B 基座)* | Kev 9B<br>*(9B)* | Clef<br>*(27.4B)* | Jev<br>*(27B)* | DiffGemma<br>*(26B-A4B)* | Laya<br>*(0.4B)* |
|
| 67 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 68 |
+
| **参数量** | **9.41B** | 9.41B | 9.0B | 27.36B | 27.0B | 25.8B *(激活 4B)* | 0.42B |
|
| 69 |
+
| **BFCL**<br>*(AST 工具选择精确率)* | **98.76%**<br>*(全场 #1)* | **98.76%** | 97.58% | 98.47% | 98.58% | 97.64% | 95.87% |
|
| 70 |
+
| **ToolRet**<br>*(nDCG@10 工具重排)* | **67.26%**<br>*(9B #1)* | **67.26%** | 65.72% | **68.18%** | 65.50% | 45.28% | 51.31% |
|
| 71 |
+
| **API-Bank**<br>*(多步 API 调用准确率)* | **93.70%**<br>*(全场 #1)* | 93.11% | 89.76% | 91.93% | 90.35% | 85.24% | 86.22% |
|
| 72 |
+
| **BANKING77**<br>*(77 类金融意图 Macro-F1)* | **93.77%**<br>*(9B #1)* | 93.69% | 91.77% | **94.07%** | 93.58% | 93.80% | 62.66% |
|
| 73 |
+
| **CLINC150+OOS**<br>*(150 类意图+越界拒识)* | **98.44%**<br>*(全场 #1)* | 66.77% | 96.65% | 97.43% | 96.44% | 94.64% | 73.79% |
|
| 74 |
+
| **Home Appl.**<br>*(智能家居指令精确率)* | **97.73%**<br>*(全场 #1)* | 96.59% | 88.64% | 96.59% | 88.64% | 68.18% | 23.86% |
|
| 75 |
+
| **BRIGHT**<br>*(推理密集型检索 nDCG@10)* | **38.58%**<br>*(9B #1)* | 38.49% | 38.53% | **48.03%** | 43.37% | 18.69% | 25.00% |
|
| 76 |
+
| **Amazon ESCI**<br>*(电商相关性 Macro-F1)* | **57.40%**<br>*(9B #1)* | 57.39% | 53.75% | **59.30%** | 56.60% | 56.83% | 52.84% |
|
| 77 |
+
| **PhishNChips**<br>*(9 探针钓鱼安全检测)* | **78.75%**<br>*(9B #1)* | 71.95% | 72.10% | **91.70%** | 88.20% | 55.65% | 60.45% |
|
| 78 |
+
| **When2Call**<br>*(4 分类工具触发治理)* | **81.13%**<br>*(9B #1)* | 65.58% | 70.64% | 72.37% | **81.91%** | 75.44% | 48.92% |
|
| 79 |
+
| **10 任务宏平均**<br>*(Macro Mean)* | **80.55%**<br>*(总榜 #2 · 9B #1)* | 74.96% | 76.51% | **81.81%** | 80.32% | 69.14% | 58.09% |
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
### 外部开源社区权威基准(`safeagents-judge-bench` & `LocalLLaMA/typed-decisions`)
|
| 84 |
+
|
| 85 |
+
#### 1. [`harness-hub/safeagents-judge-bench`](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v2)(`v2`:661 条真实 Agent 工具调用 · 82 条越界轨迹 · 7 类违规识别)
|
| 86 |
+
|
| 87 |
+
> **官方 `v2` 与 `v1` 评测说明(由 Hugging Face 官方成员 `@ybelkada` 通过 HF Jobs 在 `NVIDIA A100-SXM4-80GB` 上独立运行并提交 [PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1) 合入 · 元数据见 [`.eval_results/safeagents-judge-bench.yaml`](./.eval_results/safeagents-judge-bench.yaml))**:测试集包含真实编码 Agent 在沙箱中被扫描器标记可疑的 `661` 次工具调用(含 `82` 条越界轨迹中的 `536` 次恶意调用 + `125` 次合法放行调用):
|
| 88 |
+
> - **`v2` 7 分类违规识别赛道全场总冠军(`#1 / 8`)**:斩获 **`75.1%` Category Macro-F1** 与 **`85.8%` 分类准确率(`567/661`)**,领先第 2 名 `27.4B Cloudflare/clef`(`56.3%` F1 / `73.7%` Acc)达 **`+18.8 pp` Macro-F1(`+12.1 pp` 准确率)**,领先第 3 名 `vllm-sr/d3-mini`(`51.2%`)**`+23.9 pp`**,领先同尺寸基座 `Cloudflare/clef-flash`(`46.2%` / `57.6%` Acc)**`+28.9 pp` Macro-F1(`+28.2 pp` 准确率)**!
|
| 89 |
+
> - **`v2` 二分类安全护栏 `82 / 82`(`100%`)危险轨迹全拦截 & `98.5%` AUROC**:成功拦截 **`534 / 536`(`99.6%`)** 次恶意工具调用(其中 `harness_introspection` `272/272`、`credential_misuse` `15/15`、`sandbox_escape` `4/4` 召回率均为 **`100%`**,首次拦截前中位漏放恶调数为 **`0`**)。在未校准默认阈值(`P(block) >= 0.50`)下平衡准确率为 **`81.4%`**(超越 `27.4B Cloudflare/clef` 的 `80.8%`);凭借 **`98.5%` 的高 AUROC**,仅需校准判别阈值(`P(block) >= 0.961`)即可将平衡准确率拉升至 **`93.8%`(误拦率仅 `5.6%`)** 且保持 **`82/82`(`100%`)** 轨迹全拦截。在 [`v1`(562 条调用)官方版本](https://huggingface.co/datasets/harness-hub/safeagents-judge-bench/tree/v1)中,`FastBrain-9B` 更包揽了**二分类(`97.4%` Bal. Acc)与多分类(`85.0%` Macro-F1)双榜 `#1 / 9`**。
|
| 90 |
+
|
| 91 |
+
| 参评模型(`safeagents-judge-bench v2` 官方数据) | 参数量 | 7 分类 Macro-F1 ↑ | 7 分类准确率 ↑ | AUROC ↑ | 平衡准确率 ↑ | 恶意召回率 ↑ | 误拦率 ↓ | 危险轨迹拦截率 ↑ | P50 延迟 *(评测硬件)* |
|
| 92 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 93 |
+
| **`TypeScript/FastBrain-9B` *(`v2` 官方默认 `t=0.50`)*** | **9.4B** | **75.1%** *(#1 / 8)* | **85.8%** *(#1 / 8)* | **98.5%** | 81.4% | **99.6%** | 36.8% | **82 / 82 *(100%)*** | 327 ms *(A100 · **G4 104 ms**)* |
|
| 94 |
+
| **`TypeScript/FastBrain-9B` *(`v2` 阈值校准 `t=0.961`)*** | **9.4B** | **75.1%** *(#1)* | **85.8%** *(#1)* | **98.5%** | **93.8%** | 93.1% | **5.6%** | **82 / 82 *(100%)*** | 327 ms *(A100 · **G4 104 ms**)* |
|
| 95 |
+
| **`TypeScript/FastBrain-9B` *(`v1` 官方榜单 · 562 条)*** | **9.4B** | **85.0%** *(#1 / 9)* | **92.3%** *(#1 / 9)* | **98.3%** | **97.4%** *(#1 / 9)* | **100.0%** | **5.1%** | **78 / 78 *(100%)*** | **104 ms *(RTX PRO 6000)*** |
|
| 96 |
+
| `Cloudflare/clef` | 27.4B | 56.3% *(#2)* | 73.7% *(#2)* | **99.3%** | 80.8% | **100.0%** | 38.4% | **82 / 82 *(100%)*** | 636 ms *(A100)* |
|
| 97 |
+
| `vllm-sr/d3-mini` | 1.8B | 51.2% *(#3)* | 65.2% *(#3)* | 98.6% | 85.6% | **100.0%** | 28.8% | **82 / 82 *(100%)*** | 168 ms *(A100)* |
|
| 98 |
+
| `Cloudflare/clef-flash` *(同尺寸基座)* | 9.4B | 46.2% *(#4)* | 57.6% *(#4)* | 96.7% | **89.3%** | 97.8% | 19.2% | 81 / 82 *(98.8%)* | 326 ms *(A100)* |
|
| 99 |
+
| `Cloudflare/clef-omni` | 30B-A3B | 43.7% *(#5)* | 56.4% *(#5)* | 94.6% | 87.7% | 91.4% | 16.0% | 81 / 82 *(98.8%)* | 285 ms *(A100)* |
|
| 100 |
+
| `knowledgator/gliclass-v4-edge` | 0.4B | 37.3% *(#6)* | 52.8% *(#7)* | 75.3% | 67.6% | 69.6% | 34.4% | 68 / 82 *(82.9%)* | 101 ms *(L4)* |
|
| 101 |
+
| `fastino/GLiNER2.5-Decide` | 0.5B | 35.5% *(#7)* | 62.0% *(#6)* | 51.7% | 57.6% | 15.1% | **0.0%** | 17 / 82 *(20.7%)* | 117 ms *(M5 Pro)* |
|
| 102 |
+
| `LiquidAI/d1-3B` | 3B | 32.8% *(#8)* | 45.7% *(#8)* | 94.6% | 83.6% | 68.1% | 0.8% | 68 / 82 *(82.9%)* | **35 ms *(A100)*** |
|
| 103 |
+
|
| 104 |
+
#### 2. [`LocalLLaMA/typed-decisions`](https://huggingface.co/datasets/LocalLLaMA/typed-decisions)(400 个企业级用例 · 覆盖 4 大业务流的 2,000 次类型化决策)
|
| 105 |
+
|
| 106 |
+
> **官方实时总榜验证说明(当前共 `43` 个零样本模型 + `51` 个训练集拟合/微调模型 = `94` 个参评条目)**:
|
| 107 |
+
> - **零样本官方总榜实时 `#7 / 43`(开源权重 `#5 / 36` · `<=9B` 开源 `#2 / 19` · 全部 Clef 架构 `#1`)**:完整 2,000 次预测轨迹见 [`eval_submissions/typescript_fastbrain-9b.json`](./eval_submissions/typescript_fastbrain-9b.json)(已通过 [PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58) 合入官方主榜),在 `bench/score_with_jobs.py` 下取得 **`75.25%` 准确率(`0.1508` KL · `0.0795` Brier · `50 ms` p50 延迟)**(在并列最高分均算对的 `scripts/score_model.py` 下为 **`76.25%`**)。凭借 **`50 ms` p50 延迟**,`FastBrain-9B` 是 **Top 28(准确率 `>70%`)梯队中推理速度 `#1` 的模型**——比第 1 名 `Quyet-1.0-Large`(`3,335 ms`)**快 `66.7` 倍**、比第 2 名 `meraGPT Decider 1`(`526 ms`)**快 `10.5` 倍**、比 `27B Amos 1 large`(`357 ms`)**快 `7.1` 倍**!
|
| 108 |
+
> - **`train` 校准/微调官方总榜实时并列 `#12`(列表 `#14 / 51` · 冻结权重模型 KL `#1` & `<=9B` `#1`)**:完整预测轨迹见 [`eval_submissions/typescript_fastbrain-9b-fitted.json`](./eval_submissions/typescript_fastbrain-9b-fitted.json)([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57)),在**完全冻结模型权重(`no weights changed`)**、仅拟合问题先验偏置与温度的条件下达到 **`79.70%`(并列口径 `80.70%`)准确率 · `0.0816` KL · `0.0437` Brier · `50 ms`**,正面击败 **37 个专门在训练集上微调权重的模型**(包括 `25.6B Rev-gen1-midi` `79.45%`、`4B LoRA OpenDecider-small-td` `79.2%`、`30B-A3B LoRA OpenDecider-medium-td` `78.8%` 等)。
|
| 109 |
+
|
| 110 |
+
| 参评模型 | 参数量 | 总体准确率 ↑ | Gold KL 散度 ↓ | Brier ↓ | `noul` ↑ | `choice` ↑ | `score` ↑ | Agent 监控 ↑ | 客户服务 ↑ | 发票审批 ↑ | 安全事件 ↑ | P50 延迟 ↓ |
|
| 111 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 112 |
+
| **`TypeScript/FastBrain-9B` *(先验校准 · 零权重改动)*** | **9.4B** | **79.70% / 80.70%** | **0.0816** | **0.0437** | **86.7% / 88.0%** | **76.5% / 77.2%** | **76.9% / 77.9%** | **75.4% / 76.6%** | **82.0% / 83.4%** | **83.4% / 83.6%** | **78.0% / 79.2%** | **50 ms** |
|
| 113 |
+
| **`TypeScript/FastBrain-9B` *(Ordinal-KL 蒸馏原生头)*** | **9.4B** | **77.35%** *(原生 #1)* | **0.1039** | **0.0582** | **84.8%** | **74.8%** | **73.8%** | **71.2%** | **80.4%** | **82.6%** | **75.2%** | **50 ms** |
|
| 114 |
+
| **`TypeScript/FastBrain-9B` *(零样本 · 实时总榜 #7 / 43)*** | **9.4B** | **75.25% / 76.25%** | **0.1508** | **0.0795** | **83.2% / 84.3%** | **74.7% / 76.0%** | **69.8% / 70.4%** | **68.2% / 69.8%** | **77.6% / 78.8%** | **82.0%** | **73.2% / 74.4%** | **50 ms** |
|
| 115 |
+
| `Amos 1 (large)` | 27B | 76.10% | 0.1260 | 0.0690 | 83.2% | 73.7% | 72.6% | 67.4% | 78.8% | 83.0% | 75.2% | 357 ms |
|
| 116 |
+
| `pplx-decider-v1.1-27b` | 27B | 75.30% | 0.4410 | 0.1600 | 85.2% | 73.7% | 69.1% | 66.4% | 80.2% | 80.2% | 74.4% | — |
|
| 117 |
+
| `vllm-sr/d3` | 27B | 74.90% | 0.4090 | 0.1460 | 84.7% | 68.5% | 72.4% | 67.2% | 76.6% | 82.8% | 73.0% | — |
|
| 118 |
+
| `Baseten Elephant 1` | 9B | 74.80% | 0.1340 | 0.0690 | — | — | — | — | — | — | — | 352 ms |
|
| 119 |
+
| `Darwin-27B-ZTC` | 27B | 74.30% | 0.2040 | 0.0970 | — | — | — | — | — | — | — | — |
|
| 120 |
+
| `Cloudflare/clef` | 27.4B | 72.75% | 0.1907 | 0.1032 | 84.5% | 64.8% | 69.9% | 63.8% | 74.2% | 78.6% | 74.4% | — |
|
| 121 |
+
| `vllm-sr/d3-flash` | 9B | 71.70% | 0.3220 | 0.1310 | — | — | — | — | — | — | — | — |
|
| 122 |
+
| `Cloudflare/clef-flash` *(同尺寸基座)* | 9.4B | 71.00% | 0.2093 | 0.1105 | 81.5% | 71.3% | 62.9% | 62.0% | 76.0% | 76.4% | 69.6% | — |
|
| 123 |
+
| `Cloudflare/clef-omni` | 35B-A3B | 67.30% | 0.2469 | 0.1233 | 82.7% | 63.5% | 58.6% | 55.2% | 73.6% | 74.2% | 66.2% | — |
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
## 核心架构与技术创新
|
| 128 |
+
|
| 129 |
+
1. **混合 Gated DeltaNet + 全注意力基座网络(`9.3B` 主干参数,`bfloat16`)**:
|
| 130 |
+
- 支持最长 `262,144` 上下文窗口(由 `24` 层线性注意力 Gated DeltaNet 模块与 `8` 层全注意力模块交替构成),可在单次 Prefill 前向中高效编码超长工具注册表、多轮 Agent 执行轨迹与候选集文本片段。
|
| 131 |
+
- 联合微调全部 `32` 层中的 `104` 个核心投影矩阵(线性注意力 `in_proj_qkv`、`in_proj_z`、`out_proj` 与自注意力 `q_proj`、`k_proj`、`v_proj`、`o_proj`),并已无损原地合并至主干 `safetensors` 权重。
|
| 132 |
+
2. **联合 Schema 决策头(`joint_head.safetensors`,`116M` 参数 · SGLang 融合 FlashAttention 算子)**:
|
| 133 |
+
- 直接从最后一层隐藏状态中抽取 `<|question_*|>` 问题片段与 `<|option_*|>` 候选片段表征,无需任何自回归解码(`output_tokens = 0`),一次性输出全部问题(`choice` / `noul` / `score`)的概率分布。
|
| 134 |
+
- **向量化 CUDA 极速路径(`joint_schema_model.py` 中的 `_forward_fast_cuda`)**:用 `torch.cumsum` `O(1)` 前缀和池化替代逐片段 Python 循环,并通过 `cu_seqlens` 紧凑打包调用变长 FlashAttention(`torch.ops.aten._flash_attention_forward`),实现**决策头核函数 `1.90x` 加速(`3.27 ms -> 1.72 ms`,最大对数几率误差 `max_logit_diff = 0.00000`)**。
|
| 135 |
+
- **序数 KL(Ordinal-KL)与多任务概率校准蒸馏**:融合软标签 KL 散度、序数累积分布距离损失(Earth Mover's Distance / RPS)$\sum_k (\text{CDF}_{\text{pred}}(k) - \text{CDF}_{\text{gold}}(k))^2$ 以及 `score` 量表题的期望分 MSE 损失,大幅降低分布偏移与校准误差。
|
| 136 |
+
3. **编译期 AST Schema 感知边际校准(`joint_schema_model.py`)**:
|
| 137 |
+
- 通过编译期自动分析候选 Schema 拓扑结构(区分工具调用项、澄清追问项、开放集拒识项等)并进行对数几率边际校准,彻底消除 System-1 模型常见的工具误触发(Over-Triggering)与越界误接受问题。
|
| 138 |
+
|
| 139 |
+
---
|
| 140 |
+
|
| 141 |
+
## 快速上手(Quickstart)
|
| 142 |
+
|
| 143 |
+
### 1. PyTorch / Transformers(支持原生 `bfloat16` 或免费 Colab T4 `4-bit` / `8-bit` 量化加载)
|
| 144 |
+
|
| 145 |
+
`TypeScript/FastBrain-9B` 完全兼容标准 `joint_schema_model` 运行时,可直接无缝替换 `Cloudflare/clef-flash`。既支持在 `>=24 GB` 显存 GPU(L4 / A100 / RTX 4090 / PRO 6000)上以全精度 `bfloat16`(`18.82 GB`)运行,也支持通过 **`load_in_4bit=True`(仅占约 `6.8 GB` 显存,可在免费 Google Colab T4 16GB 或 8GB 消费级显卡上流畅运行)** 或 **`load_in_8bit=True`(约 `11.2 GB` 显存)** 加载,同时自动保持 `116M` `JointSchemaHead` 处于高精度 `bfloat16`/`float16`:
|
| 146 |
+
|
| 147 |
+
```python
|
| 148 |
+
from huggingface_hub import snapshot_download
|
| 149 |
+
import sys
|
| 150 |
+
import torch
|
| 151 |
+
|
| 152 |
+
model_dir = snapshot_download("TypeScript/FastBrain-9B", ignore_patterns=["*.gguf"])
|
| 153 |
+
sys.path.insert(0, model_dir)
|
| 154 |
+
import joint_schema_model as clef
|
| 155 |
+
|
| 156 |
+
# 全精度加载(推荐 24GB+ 显卡:L4, A100, RTX 3090/4090, RTX PRO 6000):
|
| 157 |
+
model, processor = clef.load_release_model(model_dir, device="cuda", dtype=torch.bfloat16)
|
| 158 |
+
|
| 159 |
+
# 或 4-bit NF4 混合精度加载(8GB–16GB 显卡,例如免费 Google Colab T4):
|
| 160 |
+
# model, processor = clef.load_release_model(model_dir, device="cuda", dtype=torch.float16, load_in_4bit=True)
|
| 161 |
+
|
| 162 |
+
response = clef.systemone(model, processor, {
|
| 163 |
+
"model": "TypeScript/FastBrain-9B",
|
| 164 |
+
"state": {
|
| 165 |
+
"query": "能帮我查一下账户余额吗?",
|
| 166 |
+
"tools": ["get_balance", "transfer_funds"],
|
| 167 |
+
},
|
| 168 |
+
"questions": {
|
| 169 |
+
"q": {
|
| 170 |
+
"type": "choice",
|
| 171 |
+
"query": "选择最佳下一步动作。",
|
| 172 |
+
"criteria": {
|
| 173 |
+
"a": "调用 <tool_call>{\"name\": \"get_balance\", \"arguments\": {}}</tool_call>",
|
| 174 |
+
"b": "请先提供您的账户 ID 或身份验证令牌。",
|
| 175 |
+
"c": "抱歉,我无法访问个人银行记录。",
|
| 176 |
+
},
|
| 177 |
+
},
|
| 178 |
+
},
|
| 179 |
+
})
|
| 180 |
+
print(response)
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
### 2. `llama.cpp` GGUF(`Q8_0` / `Q4_K_M` / `BF16`)通过 `/v1/systemone` 接口部署
|
| 184 |
+
|
| 185 |
+
本仓库提供适配官方 `llama.cpp`(**`b11430` 及以上版本**���原生 `ClefModel` 架构)的 GGUF 模型文件,单文件同时打包了 `Qwen3.5-9B` 混合主干与 `116M` `JointSchemaHead`(即使在 `Q4_K_M` 量化版本中,`dec.*` 决策头张量、`ssm_` 线性注意力状态与 `attn_` 核心投影层也全部保留在 `Q8_0` 高精度)。
|
| 186 |
+
|
| 187 |
+
> [!IMPORTANT]
|
| 188 |
+
> **`llama.cpp` 版本要求与关键启动参数说明:**
|
| 189 |
+
> 1. **最低版本要求**:请使用 **`llama.cpp` `b11430` 或更新版本**(包含原生 `ClefModel` / `LLM_ARCH_CLEF` 计算图支持与 `/v1/systemone` HTTP 接口)。普通 Ollama 或未包含 `ClefModel` 支持的旧版 `llama.cpp` 无法执行 `dec.*` 决策头张量。
|
| 190 |
+
> 2. **务必将 `-b` 与 `-ub` 设为不小于最大输入长度(例如 `-b 16384 -ub 16384 --no-cache-prompt` 或 `-b 4096 -ub 4096 --no-cache-prompt`)**:
|
| 191 |
+
> `llama-server` 中的 `ClefModel` 会在单个物理微批次(`ubatch`,默认值 `512`)内对 `<|question_*|>` 与 `<|option_*|>` 标记区间计算交叉注意力。将 `-ub` 设为与 `-b` 相同可确保长 Prompt(>512 tokens)在单次物理 `ubatch` 内完整计算而不截断选项区间;`--no-cache-prompt` 则可避免前缀缓存跳过决策标记位。
|
| 192 |
+
|
| 193 |
+
#### 第一步:下载预编译 `llama-server`(`b11430`+)与 GGUF 权重
|
| 194 |
+
|
| 195 |
+
```bash
|
| 196 |
+
# 1. 下载支持 ClefModel 与 /v1/systemone 的预编译 llama.cpp (b11430+)
|
| 197 |
+
# - Linux CUDA 13.x (Colab / Ubuntu): llama-b11430-bin-ubuntu-cuda-13.4-x64.tar.gz
|
| 198 |
+
# - Linux CUDA 12.x: llama-b11430-bin-ubuntu-cuda-12.8-x64.tar.gz
|
| 199 |
+
# - macOS Apple Silicon (M1/M2/M3/M4): llama-b11430-bin-macos-arm64.tar.gz
|
| 200 |
+
curl -sL https://github.com/ggml-org/llama.cpp/releases/download/b11430/llama-b11430-bin-ubuntu-cuda-13.4-x64.tar.gz | tar -xz
|
| 201 |
+
|
| 202 |
+
# 2. 下载 FastBrain-9B GGUF(可选 Q8_0 [9.66 GB,无损级精度] 或 Q4_K_M [6.73 GB,适配 8GB–16GB 显存])
|
| 203 |
+
pip install -U "huggingface_hub[hf_transfer]"
|
| 204 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 hf download TypeScript/FastBrain-9B FastBrain-9B-Q8_0.gguf --local-dir .
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
#### 第二步:启动 `llama-server` 监听 `/v1/systemone`
|
| 208 |
+
|
| 209 |
+
```bash
|
| 210 |
+
# Linux / Google Colab 环境下确保 CUDA 动态库加入 LD_LIBRARY_PATH:
|
| 211 |
+
export LD_LIBRARY_PATH="$(pwd)/llama-b11430:/usr/lib64-nvidia:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
|
| 212 |
+
|
| 213 |
+
# 启动 llama-server(24GB+ 显存 / 16K 上下文):
|
| 214 |
+
./llama-b11430/llama-server \
|
| 215 |
+
-m ./FastBrain-9B-Q8_0.gguf \
|
| 216 |
+
-ngl 99 -c 16384 -b 16384 -ub 16384 -np 1 -fa on --no-cache-prompt \
|
| 217 |
+
--port 8080
|
| 218 |
+
|
| 219 |
+
# 或在 12GB–16GB 显卡上运行(例如 Colab 免费 Tesla T4,4K 上下文):
|
| 220 |
+
# ./llama-b11430/llama-server \
|
| 221 |
+
# -m ./FastBrain-9B-Q4_K_M.gguf \
|
| 222 |
+
# -ngl 99 -c 4096 -b 4096 -ub 4096 -np 1 -fa on --no-cache-prompt \
|
| 223 |
+
# --port 8080
|
| 224 |
+
|
| 225 |
+
# 可选:若输入状态包含多模态图片/截图,可挂载视觉投影器权重:
|
| 226 |
+
# --mmproj ./mmproj-FastBrain-9B-Q8_0.gguf
|
| 227 |
+
```
|
| 228 |
+
|
| 229 |
+
#### 第三步:请求 `/v1/systemone`(单次前向推理,`0` 生成 Token)
|
| 230 |
+
|
| 231 |
+
```bash
|
| 232 |
+
curl http://127.0.0.1:8080/v1/systemone \
|
| 233 |
+
-H "Content-Type: application/json" \
|
| 234 |
+
-d '{
|
| 235 |
+
"model": "FastBrain-9B",
|
| 236 |
+
"state": {
|
| 237 |
+
"ticket_id": "ORD-99281",
|
| 238 |
+
"customer_message": "我上周的订阅被重复扣费了两次,提交工单后一直没人回复。"
|
| 239 |
+
},
|
| 240 |
+
"questions": {
|
| 241 |
+
"route": {
|
| 242 |
+
"type": "choice",
|
| 243 |
+
"instructions": "该工单应分派给哪个团队处理?",
|
| 244 |
+
"criteria": {
|
| 245 |
+
"billing": "支付、退款、重复扣费或发票问题",
|
| 246 |
+
"technical": "程序缺陷、崩溃或服务故障",
|
| 247 |
+
"account": "密码重置或登录异常"
|
| 248 |
+
}
|
| 249 |
+
},
|
| 250 |
+
"urgent": {
|
| 251 |
+
"type": "noul",
|
| 252 |
+
"instructions": "客户是否正在反馈涉及资金损失或紧急的问题?"
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
}'
|
| 256 |
+
```
|
| 257 |
+
|
| 258 |
+
### 3. SGLang 高吞吐服务部署(`lmsysorg/sglang:dev-clef`)
|
| 259 |
+
|
| 260 |
+
`TypeScript/FastBrain-9B` 原生支持 SGLang 的 `JointSchemaPooler`(镜像 `lmsysorg/sglang:dev-clef`),利用无缓存原始 K/V FlashAttention Embedding 模式以及向量化前缀和池化(`torch.cumsum`)+ 变长打包 FlashAttention(`cu_seqlens`),在服务端高并发场景下实现 **`19,300+ tok/s`(每秒 `131+` 个结构化决策)** 的极致吞吐:
|
| 261 |
+
|
| 262 |
+
```bash
|
| 263 |
+
docker run --gpus all \
|
| 264 |
+
--shm-size 32g \
|
| 265 |
+
-p 30000:30000 \
|
| 266 |
+
-v ~/.cache/huggingface:/root/.cache/huggingface \
|
| 267 |
+
--ipc=host \
|
| 268 |
+
lmsysorg/sglang:dev-clef \
|
| 269 |
+
sglang serve \
|
| 270 |
+
--model-path TypeScript/FastBrain-9B \
|
| 271 |
+
--host 0.0.0.0 \
|
| 272 |
+
--port 30000
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
+
---
|
| 276 |
+
|
| 277 |
+
## 推理引擎横向性能评测:`SGLang (dev-clef)` vs. `llama.cpp (b11430)` vs. `PyTorch`
|
| 278 |
+
|
| 279 |
+
在**同一台 NVIDIA RTX PRO 6000 Blackwell Server Edition (G4)** GPU 上对五大真实决策负载进行端到端实测对比:
|
| 280 |
+
|
| 281 |
+
| 负载场景 / 核心指标 | **SGLang `dev-clef`**<br>*(BF16 · JointSchemaPooler)* | **`llama.cpp b11430`**<br>*(GGUF Q8_0 · ClefModel)* | **`llama.cpp b11430`**<br>*(GGUF Q4_K_M · ClefModel)* | **PyTorch 原生**<br>*(BF16 · `joint_schema_model.py`)* |
|
| 282 |
+
| :--- | :---: | :---: | :---: | :---: |
|
| 283 |
+
| **冷��动加载耗时** | 11.11 s | **2.56 s** | **2.00 s** | 11.11 s |
|
| 284 |
+
| **峰值显存占用 (16K 上下文)** | 18.18 GiB *(权重)* / ~20.5 GiB | **12.55 GiB** | **10.30 GiB** | 20.3–24.7 GiB |
|
| 285 |
+
| **能否运行于 16GB T4 显卡?** | 否 *(仅 BF16, TP=1)* | **是 (`9.03 GiB` @ 4K)** | **是 (`6.78 GiB` @ 4K)** | **是 (`load_in_4bit`: `6.8 GiB`)** |
|
| 286 |
+
| **相对 BF16 Top-1 决策一致率** | **100.00%** *(最大偏差 0.0078)* | **99.86%** *(1,471/1,473)* | **98.78%** *(1,455/1,473)* | **100.00% *(基准)*** |
|
| 287 |
+
| **1. 短文本意图路由** *(293 tok, K=2)* | **30.01 ms** *(9,763 tok/s)* | 32.82 ms *(8,929 tok/s)* | 31.69 ms *(9,245 tok/s)* | 43.23 ms *(6,778 tok/s)* |
|
| 288 |
+
| **2. Typed Decisions** *(736 tok, K=5)* | **50.29 ms** *(14,635 tok/s)* | 62.40 ms *(11,795 tok/s)* | 61.80 ms *(11,909 tok/s)* | 63.58 ms *(11,576 tok/s)* |
|
| 289 |
+
| **3. When2Call** *(1,068 tok, K=1)* | **66.06 ms** *(16,167 tok/s)* | 87.78 ms *(12,167 tok/s)* | 89.34 ms *(11,955 tok/s)* | 77.77 ms *(13,733 tok/s)* |
|
| 290 |
+
| **4. PhishNChips** *(1,303 tok, K=9)* | **75.86 ms** *(17,176 tok/s)* | 108.55 ms *(12,004 tok/s)* | 109.97 ms *(11,849 tok/s)* | 90.32 ms *(14,426 tok/s)* |
|
| 291 |
+
| **5. SafeAgents Judge** *(2,217 tok, K=2)* | **125.85 ms** *(17,616 tok/s)* | 181.70 ms *(12,201 tok/s)* | 183.50 ms *(12,082 tok/s)* | 138.06 ms *(16,058 tok/s)* |
|
| 292 |
+
| **Batch `B=4` 并发决策** *(2,944 tok, 20 决策)* | **152.39 ms** *(19,319 tok/s · 131.2 决策/s)* | 248.50 ms *(11,847 tok/s · 80.5 决策/s)* | 245.20 ms *(12,006 tok/s · 81.6 决策/s)* | 175.85 ms *(16,742 tok/s · 113.7 决策/s)* |
|
| 293 |
+
|
| 294 |
+
---
|
| 295 |
+
|
| 296 |
+
## GGUF 量化精度保持率与硬件显存指南
|
| 297 |
+
|
| 298 |
+
### 1. Decision Index 10 大基准量化精度对齐验证(`BF16` vs. `Q8_0` vs. `Q4_K_M`)
|
| 299 |
+
|
| 300 |
+
在涵盖 `choice`、`noul`、`score` 三类题型的分层抽样测试集(**`203` 个多约束请求 / `1,473` 个独立评分问题**)上:`FastBrain-9B-Q8_0.gguf`(`9.66 GB`)与原生 `bfloat16` 的 **Top-1 决策一致率高达 `99.86%`(平均分差仅 `-0.03 pp`,几乎完全无损)**;`FastBrain-9B-Q4_K_M.gguf`(`6.73 GB`,保留 `Q8_0` 高精度决策头)亦保持了 **`98.78%` 的 Top-1 一致率**(校准后 10 任务均分仅相差 `-0.20 pp`):
|
| 301 |
+
|
| 302 |
+
| 评测基准 / 指标 | PyTorch bfloat16<br>*(18.82 GB)* | GGUF Q8_0<br>*(9.66 GB)* | GGUF Q4_K_M<br>*(6.73 GB · Q8 决策头)* |
|
| 303 |
+
| :--- | :---: | :---: | :---: |
|
| 304 |
+
| **相对 BF16 Top-1 一致率** *(1,473 题)* | 100.00% *(基准)* | **99.86%** *(1,471/1,473)* | **98.78%** *(1,455/1,473)* |
|
| 305 |
+
| **概率分布平均绝对误差 MAE** | 0.00000 | **0.00203** *(0.20%)* | **0.00387** *(0.39%)* |
|
| 306 |
+
| **10 任务宏平均(单权重原生输出)** | **82.37%** | **82.34%** *(-0.03 pp)* | **82.56%** *(+0.19 pp)* |
|
| 307 |
+
| **10 任务宏平均(Schema 校准后)** | **83.68%** | **83.65%** *(-0.03 pp)* | **83.48%** *(-0.20 pp)* |
|
| 308 |
+
| ├─ **1. BFCL** *(AST 工具选择)* | 100.00% | **100.00%** *(0.00)* | **100.00%** *(0.00)* |
|
| 309 |
+
| ├─ **2. ToolRet** *(20 工具重排)* | 73.15% | **73.70%** *(+0.55)* | **75.60%** *(+2.45)* |
|
| 310 |
+
| ├─ **3. API-Bank** *(多步工具调用)* | 95.00% | **95.00%** *(0.00)* | **95.00%** *(0.00)* |
|
| 311 |
+
| ├─ **4. BANKING77** *(77 类金融意图)* | 100.00% | **100.00%** *(0.00)* | **100.00%** *(0.00)* |
|
| 312 |
+
| ├─ **5. CLINC150+OOS** *(意图+越界拒识)* | 93.94% | **93.94%** *(0.00)* | **93.94%** *(0.00)* |
|
| 313 |
+
| ├─ **6. Home Appliances** *(家电控制)* | 90.00% | **90.00%** *(0.00)* | **90.00%** *(0.00)* |
|
| 314 |
+
| ├─ **7. BRIGHT** *(推理检索)* | 41.93% | **41.00%** *(-0.93)* | **40.31%** *(-1.62)* |
|
| 315 |
+
| ├─ **8. Amazon ESCI** *(电商相关性)* | 73.89% | **73.89%** *(0.00)* | **75.79%** *(+1.90)* |
|
| 316 |
+
| ├─ **9. PhishNChips** *(9 探针钓鱼检测)* | 85.00% | **85.00%** *(0.00)* | **85.00%** *(0.00)* |
|
| 317 |
+
| └─ **10. When2Call** *(4 分类触发治理)* | 75.00% *(70.83%)* | **75.00%** *(0.00)* | **72.92%** *(-2.08)* |
|
| 318 |
+
|
| 319 |
+
### 2. 各硬件平台实测推理速度与显存指南(`llama-server b11430`)
|
| 320 |
+
|
| 321 |
+
得益于**单次非自回归 Prefill 前向(`output_tokens = 0`)**架构,`llama-server` 在服务端显卡上实测吞吐高达 **8,900–12,100+ input tokens/sec**(端到端 HTTP 响应仅 `31–109 ms`):
|
| 322 |
+
|
| 323 |
+
| 负载场景 / 指标 | Q8_0.gguf<br>*(PRO 6000)* | Q4_K_M.gguf<br>*(PRO 6000)* | Q8_0.gguf<br>*(Tesla T4 16G)* | Q4_K_M.gguf<br>*(Tesla T4 16G)* | PyTorch BF16<br>*(PRO 6000)* |
|
| 324 |
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
| 325 |
+
| **模型加载耗时** | **2.56 s** | **2.00 s** | **5.43 s** | **5.10 s** | ~11.5 s |
|
| 326 |
+
| **峰值显存占用** | **12.55 GiB**<br>*(16K ctx)* | **10.30 GiB**<br>*(16K ctx)* | **9.03 GiB**<br>*(4K ctx)* | **6.78 GiB**<br>*(4K ctx)* | 20.3–24.7 GiB |
|
| 327 |
+
| **意图路由 + OOS**<br>*(293 tok, K=2)* | **32.82 ms**<br>*(8,928 tok/s)* | **31.69 ms**<br>*(9,245 tok/s)* | **349.32 ms**<br>*(839 tok/s)* | **342.98 ms**<br>*(854 tok/s)* | ~35.0 ms |
|
| 328 |
+
| **When2Call**<br>*(1,068 tok, K=1)* | **87.78 ms**<br>*(12,167 tok/s)* | **89.34 ms**<br>*(11,955 tok/s)* | **1,149.8 ms**<br>*(929 tok/s)* | **1,154.3 ms**<br>*(925 tok/s)* | ~92.0 ms |
|
| 329 |
+
| **PhishNChips**<br>*(1,303 tok, K=9)* | **108.55 ms**<br>*(12,004 tok/s)* | **109.97 ms**<br>*(11,849 tok/s)* | **1,430.8 ms**<br>*(911 tok/s)* | **1,440.5 ms**<br>*(905 tok/s)* | ~115.0 ms |
|
| 330 |
+
|
| 331 |
+
| 模型格式 / 量化档位 | 磁盘权重大小 | 峰值显存(`4K`–`16K` 上下文) | 最低推荐运行硬件 |
|
| 332 |
+
| :--- | :---: | :---: | :--- |
|
| 333 |
+
| **`FastBrain-9B-Q4_K_M.gguf`** *(4-bit 主干 + `Q8_0` 决策头)* | `6.73 GB` | `~6.8 – 10.3 GiB` | **8GB–12GB 消费级显卡 / Tesla T4 (16GB) / Mac M1–M4** |
|
| 334 |
+
| **PyTorch `load_in_4bit=True`** *(NF4 主干 + `fp16` 决策头)* | `~5.5 GB` | `~6.2 – 6.8 GiB` | **Tesla T4 (16GB) / RTX 3060–4060 (8GB+)** |
|
| 335 |
+
| **`FastBrain-9B-Q8_0.gguf`** *(无损级全 8-bit GGUF)* | `9.66 GB` | `~9.0 – 12.6 GiB` | **12GB–16GB 显卡 / Tesla T4 (16GB) / Mac 16GB+ 统一内存** |
|
| 336 |
+
| **PyTorch `load_in_8bit=True`** *(INT8 主干 + `bf16` 决策头)* | `~9.6 GB` | `~11.2 GiB` | **Tesla T4 (16GB) / RTX 4070 Ti (12GB+)** |
|
| 337 |
+
| **原生全精度 `bfloat16`** *(`safetensors` / `BF16.gguf`)* | `18.82 GB` (`18.16 GB`) | `20.3 – 24.7 GiB` | **NVIDIA L4 (24GB) / A100 / RTX 3090–4090 / PRO 6000** |
|
| 338 |
+
|
| 339 |
+
---
|
| 340 |
+
|
| 341 |
+
## 仓库文件结构说明
|
| 342 |
+
|
| 343 |
+
| 文件路径 | 大小 | 用途说明 |
|
| 344 |
+
| :--- | :---: | :--- |
|
| 345 |
+
| `model-00001-of-00004.safetensors` .. `00004` | `18.59 GB` | 完整 `9B` 主干权重(`bfloat16`,微调更新已原地合并,无需外挂 LoRA) |
|
| 346 |
+
| `joint_head.safetensors` & `joint_head_config.json` | `232 MB` | `116M` 参数 `JointSchemaHead` 联合决策头权重(`122` 个张量)与配置 |
|
| 347 |
+
| `FastBrain-9B-Q4_K_M.gguf` | `6.73 GB` | 推荐 4-bit GGUF(`dec.*` 决策头、`ssm_` 与 `attn_` 核心层均保留 `Q8_0` 精度) |
|
| 348 |
+
| `FastBrain-9B-Q8_0.gguf` | `9.66 GB` | 无损级高精度 8-bit GGUF(适配 `llama-server` `ClefModel` 架构) |
|
| 349 |
+
| `FastBrain-9B-BF16.gguf` | `18.16 GB` | 全精度 `bfloat16` GGUF(适配 `llama-server` `ClefModel` 架构) |
|
| 350 |
+
| `mmproj-FastBrain-9B-Q8_0.gguf` & `BF16.gguf` | `624 MB` / `922 MB` | 多模态视觉投影器 GGUF 权重(用于处理图片/屏幕截图状态) |
|
| 351 |
+
| `joint_schema_model.py` | `25 KB` | `ClefModel`、`JointSchemaHead`、`load_release_model(load_in_4bit/8bit)` 与 `systemone()` 推理运行时 |
|
| 352 |
+
| `eval_submissions/typescript_fastbrain-9b.json` | `901 KB` | `LocalLLaMA/typed-decisions` 400 用例 / 2,000 决策零样本完整预测轨迹([已合入 PR #58](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/58)) |
|
| 353 |
+
| `eval_submissions/typescript_fastbrain-9b-fitted.json` | `902 KB` | `LocalLLaMA/typed-decisions` 400 用例 / 2,000 决策先验校准完整预测轨迹([PR #57](https://huggingface.co/datasets/LocalLLaMA/typed-decisions/discussions/57)) |
|
| 354 |
+
| `eval_submissions/TypeScript__FastBrain-9B*.jsonl` | `110 KB` | `harness-hub/safeagents-judge-bench` (`v2`) 661 条工具调用二分类与 7 分类预测轨迹([已合入 PR #1](https://huggingface.co/TypeScript/FastBrain-9B/discussions/1)) |
|
| 355 |
+
| `.eval_results/*.yaml` | `2.3 KB` | Hugging Face Hub 官方排行榜评测元数据(`typed-decisions` 与 `safeagents-judge-bench v2`) |
|
| 356 |
+
| `README.md` & `README_zh.md` | `32 KB` | 中英双语完整技术文档与榜单报告 |
|
| 357 |
+
| `config.json`, `tokenizer.json`, `processor_config.json` | `11 MB` | Hugging Face 标准模型、分词器与多模态处理器配置 |
|
| 358 |
+
| `assets/*.png` | `1.2 MB` | 高分辨率评测对比总图、全量得分矩阵图与概率校准分析图 |
|