Text Generation
Transformers
Safetensors
GGUF
English
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"
File size: 10,938 Bytes
a409e51 f84a65d a409e51 f84a65d a409e51 f84a65d a409e51 f84a65d a409e51 f84a65d a409e51 f84a65d a409e51 f84a65d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | ---
base_model: Cloudflare/clef-flash
library_name: transformers
license: apache-2.0
pipeline_tag: text-generation
tags:
- fastbrain
- clef
- gguf
- systemone
- decision-index
- tool-calling
- intent-classification
- structured-decision
---
<div align="center">
# FastBrain-9B
**Non-Autoregressive System-1 Structured Decision Model (`9.4B` Parameters)**
[-3b82f6?style=flat-square)](#architecture)
[-10b981?style=flat-square)](#architecture)
[-f59e0b?style=flat-square)](#benchmark-evaluation)
[](./LICENSE)
</div>
**FastBrain-9B** (`9.4B` total parameters: `Qwen3.5-9B` hybrid backbone + `116M` `JointSchemaHead`) is a single-forward-pass, non-autoregressive **System-1 structured decision model**.
Given an arbitrary JSON state and one or more structured decision schemas (`choice`, `noul` binary verification, or `score` ranking), **FastBrain-9B** evaluates all candidate options and questions **jointly in a single forward pass (`0` generated tokens)**—delivering calibrated option probabilities, tool-call selections, and open-set abstention decisions at encoder-level latency.
All fine-tuned backbone updates (`104` projection layers across all `32` hybrid blocks) are merged directly into the `9B` backbone weights (`model-00001-of-00004.safetensors` .. `model-00004-of-00004.safetensors`), and all `122` decision-head tensors are packaged in `joint_head.safetensors`. **No external LoRA or PEFT adapter is required at inference time.**
---
## Benchmark Evaluation & Parameter Scale Comparison
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%`**:
- **Ranks `#1` across all `<=9B` models on `10 / 10` benchmarks**, outperforming the same-size base model `Clef-flash` (`9.4B`, `74.96%`) by **`+5.59 pp`**, `Kev 9B` (`9B`, `76.51%`) by **`+4.04 pp`**, and `Laya` (`0.4B`, `58.09%`) by **`+22.46 pp`**.
- **Outperforms `3x`-larger `27B`-class models**: surpasses `Jev` (`27B`, `80.32%`) and `DiffusionGemma Jev` (`26B-A4B`, `69.14%`) in 10-benchmark Macro Mean, and outperforms the `3x`-larger flagship `Clef` (`27.4B`, `81.81%`) on **5 out of 10 benchmarks** (`BFCL`, `API-Bank`, `CLINC150+OOS`, `Home appliances`, and `When2Call`).

### Full 10-Benchmark Evaluation Matrix (Annotated by Model Parameter Scale)

### Fine-Grained Decision Calibration & Open-Set Reliability

### Summary Comparison by Model Parameter Scale
| Benchmark | Metric | `Laya`<br>*(0.4B / 421M)* | `DiffusionGemma Jev`<br>*(26B-A4B · 4B Act)* | `Clef-flash`<br>*(9.4B Base)* | `Kev 9B`<br>*(9B Dense)* | `Jev`<br>*(27B Dense)* | `Clef`<br>*(27.4B Flagship)* | **FastBrain-9B**<br>*(9.4B · Ours)* |
| :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| **Parameter Scale** | **Total (Active)** | `0.42B` | `25.8B (4B MoE)` | `9.41B` | `9.0B` | `27.0B` | `27.36B` | **`9.41B`** |
| **BFCL** | Case Exact | 95.87% | 97.64% | 98.76% | 97.58% | 98.58% | 98.47% | **98.76% (#1)** |
| **ToolRet** | nDCG@10 | 51.31% | 45.28% | 67.26% | 65.72% | 65.50% | 68.18% | **67.26% (#2 · #1 9B)** |
| **API-Bank** | Accuracy | 86.22% | 85.24% | 93.11% | 89.76% | 90.35% | 91.93% | **93.70% (#1)** |
| **BANKING77** | Macro-F1 | 62.66% | 93.80% | 93.69% | 91.77% | 93.58% | 94.07% | **93.77% (#1 9B)** |
| **CLINC150+OOS** | Macro-F1 | 73.79% | 94.64% | 66.77% | 96.65% | 96.44% | 97.43% | **98.44% (#1)** |
| **Home appliances** | Case Exact | 23.86% | 68.18% | 96.59% | 88.64% | 88.64% | 96.59% | **97.73% (#1)** |
| **BRIGHT** | nDCG@10 | 25.00% | 18.69% | 38.49% | 38.53% | 43.37% | 48.03% | **38.58% (#1 9B)** |
| **Amazon ESCI** | Macro-F1 | 52.84% | 56.83% | 57.39% | 53.75% | 56.60% | 59.30% | **57.40% (#2 · #1 9B)** |
| **PhishNChips** | Accuracy | 60.45% | 55.65% | 71.95% | 72.10% | 88.20% | 91.70% | **78.75% (#1 9B)** |
| **When2Call** | Macro-F1 | 48.92% | 75.44% | 65.58% | 70.64% | 81.91% | 72.37% | **81.13% (#2 · #1 9B)** |
| **Macro Mean (10)** | **Average** | **58.09%** | **69.14%** | **74.96%** | **76.51%** | **80.32%** | **81.81%** | **80.55% (#2 · #1 9B)** |
---
## Architecture
1. **Hybrid Gated DeltaNet + Full-Attention Backbone (`9.3B` Backbone, `bfloat16`)**:
- Processes long-context tool registries, multi-turn agent states, and candidate option spans in a single prefill pass up to `262,144` tokens (`24` linear-attention blocks + `8` full-attention blocks).
- Jointly adapted across all `104` linear-attention (`in_proj_qkv`, `in_proj_z`, `out_proj`) and self-attention (`q_proj`, `k_proj`, `v_proj`, `o_proj`) projections and merged in-place into the backbone weights.
2. **Joint Schema Decision Head (`joint_head.safetensors`, `116M` Parameters)**:
- Extracts question-level and option-level span representations directly from the final hidden states and scores all questions (`choice`, `noul`, `score`) simultaneously without autoregressive decoding (`output_tokens = 0`).
3. **Compile-Time AST Schema-Aware Margin Calibration (`joint_schema_model.py`)**:
- Eliminates System-1 tool over-triggering and open-set false acceptance via compile-time schema topology analysis and post-hoc logit margin calibration.
---
## Quickstart
### 1. PyTorch / Transformers (`bfloat16` or `4-bit` / `8-bit` Quantized on Colab T4)
`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`:
```python
from huggingface_hub import snapshot_download
import sys
import torch
model_dir = snapshot_download("TypeScript/FastBrain-9B", ignore_patterns=["*.gguf"])
sys.path.insert(0, model_dir)
import joint_schema_model as clef
# Full precision (24GB+ GPU: L4, A100, RTX 3090/4090, RTX PRO 6000):
model, processor = clef.load_release_model(model_dir, device="cuda", dtype=torch.bfloat16)
# Or 4-bit NF4 mixed-precision (8GB–16GB GPU, e.g., free Google Colab T4):
# model, processor = clef.load_release_model(model_dir, device="cuda", dtype=torch.float16, load_in_4bit=True)
response = clef.systemone(model, processor, {
"model": "TypeScript/FastBrain-9B",
"state": {
"query": "Can you check my account balance?",
"tools": ["get_balance", "transfer_funds"],
},
"questions": {
"q": {
"type": "choice",
"query": "Select the best next action.",
"criteria": {
"a": "Call <tool_call>{\"name\": \"get_balance\", \"arguments\": {}}</tool_call>",
"b": "Could you please provide your account ID or authentication token first?",
"c": "I am unable to access personal banking records.",
},
},
},
})
print(response)
```
### 2. `llama.cpp` GGUF (`Q4_K_M` / `Q8_0` / `BF16`) via `/v1/systemone`
This repository includes official `llama.cpp` (`b11430`+ / `ClefModel`) GGUF quantizations that pack both the `Qwen3.5-9B` hybrid backbone and the `116M` `JointSchemaHead` (`dec.*` tensors preserved at `Q8_0` precision):
```bash
# Start llama-server on the /v1/systemone decision endpoint (6.04 GB Q4_K_M quant)
llama-server -hf TypeScript/FastBrain-9B:Q4_K_M --port 8080
# Query the single-forward-pass /v1/systemone endpoint
curl http://127.0.0.1:8080/v1/systemone \
-H "Content-Type: application/json" \
-d '{
"model": "FastBrain-9B",
"state": "Customer message: I was charged twice for my order last week and nobody has replied.",
"questions": {
"route": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {"billing": "Payments or invoices", "technical": "Bugs or outages"}
},
"urgent": {"type": "noul", "instructions": "Is the customer requesting urgent resolution?"}
}
}'
```
---
## Hardware Footprint, Quantization Tiers & Inference Speed
| Format / Precision Tier | Weight Footprint | Peak VRAM | Minimum Hardware | Typical Latency (`500–1k tok`) |
| :--- | :---: | :---: | :--- | :---: |
| **`FastBrain-9B-Q4_K_M.gguf`** *(4-bit + `Q8_0` Head)* | `6.04 GB` | `~7.2 GB` | **8GB GPU / Colab Free T4 (16GB) / Mac M1–M4** | `~90–220 ms` |
| **PyTorch `load_in_4bit=True`** *(NF4 + `fp16` Head)* | `~5.5 GB` | `~6.8 GB` | **Colab Free T4 (16GB) / RTX 3060–4060 (8GB+)** | `~180–280 ms` |
| **`FastBrain-9B-Q8_0.gguf`** *(Full 8-bit GGUF)* | `9.68 GB` | `~11.0 GB` | **12GB–16GB GPU / Colab T4 / Mac 16GB+** | `~80–180 ms` |
| **PyTorch `load_in_8bit=True`** *(INT8 + `bf16` Head)* | `~9.6 GB` | `~11.2 GB` | **Colab T4 (16GB) / RTX 4070 Ti (12GB+)** | `~130–210 ms` |
| **Native `bfloat16` (`safetensors` / `BF16.gguf`)** | `18.82 GB` (`18.16 GB`) | `20.3–24.7 GB` | **Colab L4 (24GB) / RTX 3090–4090 / PRO 6000 (96GB)** | **`38.8 ms` (`B=1`) · `61.7 ms` (`B=16` on G4 6000)** |
---
## Repository Structure
| File | Size | Description |
| :--- | :---: | :--- |
| `model-00001-of-00004.safetensors` .. `00004` | `18.59 GB` | Full `9B` backbone weights (`bfloat16`, in-place merged, no LoRA required) |
| `joint_head.safetensors` & `joint_head_config.json` | `232 MB` | `116M`-parameter `JointSchemaHead` weights (`122` tensors) and configuration |
| `FastBrain-9B-Q4_K_M.gguf` | `6.04 GB` | Recommended 4-bit GGUF (`dec.*` decision head, `ssm_`, and `attn_` preserved at `Q8_0`) |
| `FastBrain-9B-Q8_0.gguf` | `9.68 GB` | High-precision 8-bit GGUF (`ClefModel` architecture for `llama-server`) |
| `FastBrain-9B-BF16.gguf` | `18.16 GB` | Full-precision `bfloat16` GGUF (`ClefModel` architecture for `llama-server`) |
| `mmproj-FastBrain-9B-Q8_0.gguf` & `BF16.gguf` | `624 MB` / `922 MB` | Multimodal vision projector GGUF files for image/screenshot states |
| `joint_schema_model.py` | `25 KB` | `ClefModel`, `JointSchemaHead`, `load_release_model(load_in_4bit/8bit)`, and `systemone()` runtime |
| `config.json`, `tokenizer.json`, `processor_config.json` | `11 MB` | Standard Hugging Face model, tokenizer, and processor configurations |
| `assets/*.png` | `1.2 MB` | High-resolution technical benchmark and calibration charts |
|