Text Generation
Transformers
Safetensors
qwen3_5_moe
image-text-to-text
darwin
darwin-v9
darwin-jgos
vidraft
final-bench
qwen
qwen3.5
Mixture of Experts
mixture-of-experts
sparse-moe
397b
a17b
hybrid-attention
linear-attention
long-context
262k-context
reasoning
reasoning-model
thinking
chain-of-thought
cot
math
science
stem
code
agentic
tool-calling
function-calling
ztc
zero-token-confidence
confidence-estimation
uncertainty-quantification
hallucination-detection
calibration
self-verification
selective-prediction
pre-action-gating
agent-safety
llm-router
guardrails
gpqa
gpqa-diamond
mmlu-pro
benchmark
Eval Results
greedy
korean
english
bilingual
multilingual-llm
vllm
sglang
openai-compatible
multi-gpu
h100
conversational
Eval Results (legacy)
compressed-tensors
Instructions to use FINAL-Bench/Darwin-397B-ZTC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FINAL-Bench/Darwin-397B-ZTC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FINAL-Bench/Darwin-397B-ZTC") 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("FINAL-Bench/Darwin-397B-ZTC") model = AutoModelForMultimodalLM.from_pretrained("FINAL-Bench/Darwin-397B-ZTC", 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
- vLLM
How to use FINAL-Bench/Darwin-397B-ZTC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FINAL-Bench/Darwin-397B-ZTC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/Darwin-397B-ZTC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FINAL-Bench/Darwin-397B-ZTC
- SGLang
How to use FINAL-Bench/Darwin-397B-ZTC 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 "FINAL-Bench/Darwin-397B-ZTC" \ --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": "FINAL-Bench/Darwin-397B-ZTC", "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 "FINAL-Bench/Darwin-397B-ZTC" \ --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": "FINAL-Bench/Darwin-397B-ZTC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FINAL-Bench/Darwin-397B-ZTC with Docker Model Runner:
docker model run hf.co/FINAL-Bench/Darwin-397B-ZTC
Download ztc/usage.py from FINAL-Bench/Darwin-397B-ZTC: direct link, hf CLI and curl.
- Browser
- Download file 2.14 kB
-
https://huggingface.co/FINAL-Bench/Darwin-397B-ZTC/resolve/main/ztc/usage.py
- Command line
-
hf download hf://FINAL-Bench/Darwin-397B-ZTC/ztc/usage.py
-
curl -L -o usage.py https://huggingface.co/FINAL-Bench/Darwin-397B-ZTC/resolve/main/ztc/usage.py
2.14 kB
| # Zero-Token Confidence (ZTC) — usage | |
| # | |
| # ZTC reads the model's own internal state ONCE, before generation, and returns | |
| # the probability that the answer the model is about to produce will be correct. | |
| # No extra tokens are generated. No second model is required. | |
| # | |
| # probe file : ztc/ztc_probe_darwin397b.npz (45 KB) | |
| # input : final-layer hidden state of the last prompt token (4096-dim) | |
| # output : score, and a calibrated probability in [0, 1] | |
| # | |
| # Reported performance on this model (PubMedQA, 539 items, 146 incorrect): | |
| # self-reported confidence AUROC 0.7646 | |
| # ZTC AUROC 0.8801 (permutation null z = 13.31) | |
| import numpy as np | |
| import torch | |
| from transformers import AutoModel, AutoTokenizer | |
| MODEL = "FINAL-Bench/Darwin-397B-ZTC" | |
| PROBE = "ztc/ztc_probe_darwin397b.npz" | |
| class ZTC: | |
| def __init__(self, path=PROBE): | |
| z = np.load(path) | |
| self.w = z["w"].astype(np.float32) | |
| self.mu = z["mu"].astype(np.float32) | |
| self.sd = z["sd"].astype(np.float32) | |
| self.s_mean = float(z["s_mean"]); self.s_std = float(z["s_std"]) | |
| self.A = float(z["cal_A"]); self.B = float(z["cal_B"]) | |
| def score(self, hidden): | |
| """hidden: (4096,) or (batch, 4096) final-layer state of the last prompt token.""" | |
| h = np.asarray(hidden, dtype=np.float32) | |
| s = ((h - self.mu) / self.sd) @ self.w | |
| p = 1.0 / (1.0 + np.exp(-(self.A * (s - self.s_mean) / self.s_std + self.B))) | |
| return s, p | |
| # --- one forward pass, zero generated tokens ------------------------------- | |
| tok = AutoTokenizer.from_pretrained(MODEL) | |
| model = AutoModel.from_pretrained(MODEL, dtype=torch.bfloat16, device_map="auto").eval() | |
| ztc = ZTC() | |
| prompt = "Question: ...\nAnswer:" | |
| b = tok(prompt, return_tensors="pt").to(next(model.parameters()).device) | |
| with torch.no_grad(): | |
| h = model(**b).last_hidden_state[0, -1].float().cpu().numpy() | |
| s, p = ztc.score(h) | |
| print("ZTC score %.3f -> P(correct) = %.3f" % (s, p)) | |
| # Gate the action, not the answer: | |
| # if p < THRESHOLD: do not call the tool / escalate / answer "I don't know" | |
| # else: generate as usual | |