Image-Text-to-Text
Transformers
Safetensors
qwen4_exp
darwin
darwin-rsi
recursive-self-improvement
self-improvement
vidraft
final-bench
qwen
qwen3.8
Mixture of Experts
mixture-of-experts
sparse-moe
180b
hybrid-attention
linear-attention
long-context
262k-context
vision-language
multimodal
reasoning
reasoning-model
thinking
chain-of-thought
math
science
stem
ztc
model-level-rsi
zero-token-confidence
confidence-estimation
hallucination-detection
gpqa
gpqa-diamond
mmlu-pro
mmmu-pro
lexam
lexam-hard
Eval Results
korean
english
vllm
openai-compatible
b200
conversational
Eval Results (legacy)
Instructions to use FINAL-Bench/Darwin-180B-RSI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FINAL-Bench/Darwin-180B-RSI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FINAL-Bench/Darwin-180B-RSI") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("FINAL-Bench/Darwin-180B-RSI") model = AutoModelForMultimodalLM.from_pretrained("FINAL-Bench/Darwin-180B-RSI", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FINAL-Bench/Darwin-180B-RSI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FINAL-Bench/Darwin-180B-RSI" # 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-180B-RSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/FINAL-Bench/Darwin-180B-RSI
- SGLang
How to use FINAL-Bench/Darwin-180B-RSI 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-180B-RSI" \ --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-180B-RSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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-180B-RSI" \ --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-180B-RSI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use FINAL-Bench/Darwin-180B-RSI with Docker Model Runner:
docker model run hf.co/FINAL-Bench/Darwin-180B-RSI
Download handler.py from FINAL-Bench/Darwin-180B-RSI: direct link, hf CLI and curl.
- Browser
- Download file 2.81 kB
-
https://huggingface.co/FINAL-Bench/Darwin-180B-RSI/resolve/main/handler.py
- Command line
-
hf download hf://FINAL-Bench/Darwin-180B-RSI/handler.py
-
curl -L -o handler.py https://huggingface.co/FINAL-Bench/Darwin-180B-RSI/resolve/main/handler.py
2.81 kB
| # -*- coding: utf-8 -*- | |
| """Darwin-180B-RSI handler — answer + Zero-Token Confidence (ZTC) in one JSON. | |
| ZTC reads the final-layer hidden state of the last prompt token ONCE, before generation, | |
| and returns the probability that the answer the model is about to produce is correct. | |
| No extra tokens are generated and no second model is needed. | |
| Output (one item per input): | |
| {"answer": str, "confidence": float, "ztc_score": float, "truncated": bool} | |
| """ | |
| from __future__ import annotations | |
| import os | |
| from typing import Any, Dict, List | |
| import numpy as np | |
| import torch | |
| from transformers import AutoModelForImageTextToText, AutoProcessor | |
| class ZTC: | |
| def __init__(self, path: str): | |
| z = np.load(path) | |
| self.w, self.mu, self.sd = z["w"].astype(np.float32), z["mu"].astype(np.float32), z["sd"].astype(np.float32) | |
| self.s_mean, self.s_std = float(z["s_mean"]), float(z["s_std"]) | |
| self.A, self.B = float(z["cal_A"]), float(z["cal_B"]) | |
| def score(self, h: np.ndarray): | |
| s = ((np.asarray(h, np.float32) - 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 float(s), float(p) | |
| class EndpointHandler: | |
| def __init__(self, path: str = ""): | |
| self.proc = AutoProcessor.from_pretrained(path) | |
| self.model = AutoModelForImageTextToText.from_pretrained(path, torch_dtype="auto", device_map="auto").eval() | |
| self.ztc = ZTC(os.path.join(path, "ztc", "ztc_probe_darwin180rsi.npz")) | |
| def _one(self, prompt: str, max_new_tokens: int) -> Dict[str, Any]: | |
| msgs = [{"role": "user", "content": [{"type": "text", "text": prompt}]}] | |
| text = self.proc.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False) | |
| enc = self.proc(text=[text], return_tensors="pt").to(self.model.device) | |
| # 1) ZTC: one forward pass over the prompt, final layer, last token — zero generated tokens | |
| h = self.model(**enc, output_hidden_states=True, use_cache=False).hidden_states[-1][0, -1].float().cpu().numpy() | |
| s, p = self.ztc.score(h) | |
| # 2) answer | |
| out = self.model.generate(**enc, max_new_tokens=max_new_tokens, do_sample=True, temperature=1.0, top_p=0.95, top_k=20) | |
| gen = out[0, enc["input_ids"].shape[1]:] | |
| answer = self.proc.decode(gen, skip_special_tokens=True) | |
| return {"answer": answer, "confidence": round(p, 4), "ztc_score": round(s, 4), "truncated": bool(len(gen) >= max_new_tokens)} | |
| def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: | |
| inputs = data.get("inputs") | |
| inputs = [inputs] if isinstance(inputs, str) else inputs | |
| mnt = int((data.get("parameters") or {}).get("max_new_tokens", 32768)) | |
| return [self._one(x, mnt) for x in inputs] | |