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
fp8
w8a8
compressed-tensors
quantized
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)
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)# 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=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-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
| # -*- coding: utf-8 -*- | |
| """VERITAS λΆμ°© νΈλ€λ¬ β JGOS-398B-fp8 (9-νμ₯ 2026-09-17) | |
| 무μμ νλ | |
| ν λ²μ νΈμΆλ‘ **λ΅κ³Ό μ μ νΈλ₯Ό κ°μ΄** λλ €μ€λ€. | |
| μ μ νΈ = λ§μ§λ§ μΈ΅Β·λ§μ§λ§ ν ν°μ μλ벑ν°(κ°κ³΅ μ λ μλ³Έκ°). | |
| μ΄κ²μ΄ VERITAS κ° μ½λ λ°λ‘ κ·Έ κ°μ΄λ©°, **ν ν°μ ν κ°λ λ μ°μ§ μλλ€** | |
| (μ΄λ―Έ κ³μ°λ κ²μ κΊΌλ΄ μ¬ λΏμ΄λ€). | |
| λ κ°μ§ λͺ¨λ | |
| mode="generate" : λ΅ μμ± + κ·Έ λ΅κΉμ§ ν¬ν¨ν μλ (λ¬Έν νμ΄μ©) | |
| mode="embed" : μ£Όμ΄μ§ κΈμμ΄μ μλλ§ (μ΄λ―Έ λ½μ λ λ΅μ μ±μ ν λ) | |
| π΄ κ·μ¨ | |
| - μλ¦Ό(length)μ κ²°κ³Όμ λ°λμ νμνλ€. μμ μμ§μ μ€λ΅μΌλ‘ μΈμ§ μκΈ° μν΄μλ€. | |
| - μλμ μ κ·ννμ§ μλλ€. μ κ·ννλ©΄ VERITAS κ° μ°λ ν¬κΈ° μ λ³΄κ° λ μκ°λ€. | |
| - μμ±λΆμ΄ reasoning μͺ½μΌλ‘ λΉ μ§λ ν νλ¦Ώμ΄λ©΄ κ·Έκ²κΉμ§ ν©μ³ λλ €μ€λ€(λ²λ¦¬μ§ μλλ€). | |
| """ | |
| from __future__ import annotations | |
| from typing import Any, Dict, List | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| class EndpointHandler: | |
| def __init__(self, path: str = ""): | |
| self.tok = AutoTokenizer.from_pretrained(path) | |
| if self.tok.pad_token is None: | |
| self.tok.pad_token = self.tok.eos_token | |
| self.tok.padding_side = "left" # π΄ λμ½λ λͺ¨λΈ λ°°μΉμ νμ 쑰건 | |
| self.model = AutoModelForCausalLM.from_pretrained( | |
| path, dtype="auto", device_map="auto" | |
| ).eval() | |
| cfg = self.model.config | |
| cfg = cfg.get_text_config() if hasattr(cfg, "get_text_config") else cfg | |
| self.n_layers = cfg.num_hidden_layers | |
| # ---- λ΄λΆ: λ§μ§λ§ μΈ΅Β·λ§μ§λ§ ν ν° μλ ------------------------------ | |
| def _hidden(self, ids) -> List[List[float]]: | |
| out = self.model(**ids, output_hidden_states=True, use_cache=False) | |
| h = out.hidden_states[-1] # λ§μ§λ§ μΈ΅ | |
| mask = ids["attention_mask"] | |
| last = mask.sum(dim=1) - 1 # μ’ν¨λ©μ΄λΌ μ€μ λ§μ§λ§ μμΉ | |
| picked = h[torch.arange(h.size(0), device=h.device), last, :] | |
| return picked.float().cpu().tolist() | |
| def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]: | |
| inputs = data.get("inputs") | |
| if isinstance(inputs, str): | |
| inputs = [inputs] | |
| p = data.get("parameters") or {} | |
| mode = p.get("mode", "generate") | |
| # ββ μλλ§ ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| if mode == "embed": | |
| ids = self.tok(inputs, return_tensors="pt", padding=True, | |
| truncation=True, max_length=p.get("max_length", 32768)) | |
| ids = {k: v.to(self.model.device) for k, v in ids.items()} | |
| return {"hidden": self._hidden(ids), "layer": self.n_layers, | |
| "normalized": False} | |
| # ββ μμ± + μλ βββββββββββββββββββββββββββββββββββββββββββββ | |
| max_new = int(p.get("max_new_tokens", 16384)) | |
| n = int(p.get("n", 1)) | |
| temp = float(p.get("temperature", 0.0)) | |
| texts = [] | |
| for s in inputs: | |
| if p.get("chat", True): | |
| msgs = [{"role": "user", "content": s}] | |
| kw = {} | |
| if p.get("enable_thinking") is not None: | |
| kw["enable_thinking"] = p["enable_thinking"] | |
| try: | |
| texts.append(self.tok.apply_chat_template( | |
| msgs, tokenize=False, add_generation_prompt=True, **kw)) | |
| except TypeError: | |
| texts.append(self.tok.apply_chat_template( | |
| msgs, tokenize=False, add_generation_prompt=True)) | |
| else: | |
| texts.append(s) | |
| enc = self.tok(texts, return_tensors="pt", padding=True) | |
| enc = {k: v.to(self.model.device) for k, v in enc.items()} | |
| gen_kw = dict(max_new_tokens=max_new, pad_token_id=self.tok.pad_token_id) | |
| if temp > 0: | |
| gen_kw.update(do_sample=True, temperature=temp, num_return_sequences=n) | |
| else: | |
| gen_kw.update(do_sample=False) | |
| with torch.no_grad(): | |
| g = self.model.generate(**enc, **gen_kw) | |
| plen = enc["input_ids"].shape[1] | |
| new = g[:, plen:] | |
| outs = self.tok.batch_decode(new, skip_special_tokens=True) | |
| ntok = (new != self.tok.pad_token_id).sum(dim=1).tolist() | |
| # π΄ μλ¦Ό νμ β μμ μμ§μ μ€λ΅μΌλ‘ μΈμ§ μκΈ° μν΄ κ²°κ³Όμ λ¨κΈ΄λ€ | |
| hit_cap = [int(t >= max_new - 2) for t in ntok] | |
| att = torch.ones_like(g) | |
| att[g == self.tok.pad_token_id] = 0 | |
| hid = self._hidden({"input_ids": g, "attention_mask": att}) | |
| return {"generated": outs, "hidden": hid, "n_tokens": ntok, | |
| "hit_cap": hit_cap, "layer": self.n_layers, "normalized": False} | |