Instructions to use corners-ai/CoCo-Decision-DS-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use corners-ai/CoCo-Decision-DS-4B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B") model = PeftModel.from_pretrained(base_model, "corners-ai/CoCo-Decision-DS-4B") - Notebooks
- Google Colab
- Kaggle
CoCo-Decision-DS-4B
Version 1.0.0 (2026-10-08) ยท Git tag v1.0.0 in this repository
CoCo-Decision-DS-4B is a 4B-parameter decision model for disaster safety (DS) response. It is a domain-adapted version of CoCo-Decision-4B-Ko. Given a situation and a typed question, it returns a probability distribution instead of free text:
| Question type | Output |
|---|---|
noul |
probability that a yes/no statement holds |
choice |
probability for each of the listed options |
score |
probability for each point on an ordinal scale |
It is a LoRA adapter on Qwen/Qwen3.5-4B (revision 851bf6e8). Probabilities are read from the option-label token logits of a single forward pass, so one decision costs one prefill and no generation.
Not affiliated with or endorsed by TypeSafe AI. "System One" and "Jev" are names used by TypeSafe AI; this model independently implements a compatible decision interface.
Intended use
- Decision support for an incident commander in facility disaster response: classifying incoming field reports and sensor events, proposing the next procedure step, and flagging when a human confirmation is required
- Places where a threshold on a probability is more useful than a generated answer (for example, propose an action above 0.9, ask the operator below it)
Every proposed action must be approved by a responsible person. Out of scope: autonomous control of safety equipment, replacing official emergency procedures or the judgement of fire and rescue services, and open-ended generation.
How to use
Quick start (transformers + PEFT)
Requirements: torch, transformers>=5.17, peft>=0.21, and bitsandbytes for 4-bit loading.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
BASE, REVISION = "Qwen/Qwen3.5-4B", "851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a"
tokenizer = AutoTokenizer.from_pretrained(BASE, revision=REVISION)
model = AutoModelForCausalLM.from_pretrained(
BASE, revision=REVISION, device_map="auto", dtype=torch.bfloat16,
# 8 GB GPU: 4-bit base. Remove quantization_config for bf16 on a GPU with >= 12 GB.
quantization_config=BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True),
)
model = PeftModel.from_pretrained(model, "corners-ai/CoCo-Decision-DS-4B", revision="v1.0.0").eval()
def decide(state: str, question: str, options: dict[str, str]) -> dict[str, float]:
"""Return a probability for each option key."""
letters = [chr(ord("A") + i) for i in range(len(options))]
lines = ["State:", state, "", f"Question: {question}", "Options:"]
lines += [f"{letter}. {key}: {text}" for letter, (key, text) in zip(letters, options.items())]
lines.append("Answer with the letter only.")
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "\n".join(lines)}], tokenize=False, add_generation_prompt=True
) + "Answer:"
ids = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
with torch.no_grad():
logits = model(**ids).logits[0, -1]
label_ids = [tokenizer.encode(" " + letter, add_special_tokens=False)[0] for letter in letters]
probs = torch.softmax(logits[label_ids].float(), dim=-1).tolist()
return dict(zip(options, probs))
print(decide(
"Field team report: thick smoke in the east corridor, two people still inside a shop.",
"Which kind of report is this?",
{"fire": "fire or smoke", "flood": "water inflow or flooding",
"crowd": "crowding or congestion", "other": "none of the above"},
))
Prompt format
The adapter was trained on exactly this input; deviations lower accuracy and calibration.
- User turn:
State:+ the situation, a blank line,Question:+ the question,Options:, one line per option as<letter>. <key>: <description>, thenAnswer with the letter only. - Apply the model's chat template with
add_generation_prompt=Trueand appendAnswer:. - Read the next-token logits of the letters with a leading space (
" A"," B", ...) and softmax over those letters only. - Yes/no questions are two options:
yes: The statement is true.andno: The statement is false. - A structured situation can be passed as JSON text in
State:.
Hardware: 12 GB of GPU memory in bf16 at a 4,096-token context, or 8 GB with the 4-bit base shown above.
Training
- Method: LoRA (r=16, alpha=32) on the attention and linear-attention projections, context length 4,096 tokens, starting from the CoCo-Decision-4B-Ko training recipe
- Data: the CoCo-Decision-4B-Ko general decision mixture plus synthetic Korean disaster-response decisions (fire, gas leak, flooding, earthquake and crowd scenarios) derived from a facility standard operating procedure. The disaster-response dataset is not released.
Evaluation
Measured with omj bench in bf16 (2026-10). Brackets are 95% Wilson intervals for accuracy.
| Suite | N | CoCo-Decision-DS-4B accuracy | ECE | CoCo-Decision-4B-Ko accuracy | ECE |
|---|---|---|---|---|---|
| JevBench public | 231 | 0.879 [0.830, 0.915] | 0.079 | 0.870 | 0.070 |
- JevBench public hard-tier accuracy 0.766 (CoCo-Decision-4B-Ko: 0.748). General decision ability is retained after domain adaptation.
- ECE: expected calibration error (15 bins; lower is better).
Limitations
- Domain performance depends on the procedure it was adapted to; validate on your own facility's procedures before use.
- Calibration is slightly weaker than CoCo-Decision-4B-Ko (ECE 0.079 vs 0.070); recalibrate on your own data before relying on fixed thresholds.
- Disaster-response decisions were trained in Korean only.
Versions
| Version | Date | Notes |
|---|---|---|
| 1.0.0 | 2026-10-08 | First release. LoRA adapter on Qwen/Qwen3.5-4B @ 851bf6e8 |
Load a fixed version with hf download corners-ai/CoCo-Decision-DS-4B --revision v1.0.0.
License
The adapter is released under Apache-2.0. The base model is subject to its own license (Qwen/Qwen3.5-4B).
Citation
@misc{cocodecisionds4b2026,
title = {CoCo-Decision-DS-4B: a calibrated decision model for disaster safety response},
version = {1.0.0},
author = {{Corners AI}},
year = {2026},
url = {https://huggingface.co/corners-ai/CoCo-Decision-DS-4B}
}
- Downloads last month
- 46
Model tree for corners-ai/CoCo-Decision-DS-4B
Evaluation results
- Accuracy on JevBench publicself-reported0.879
- ECE (15 bins) on JevBench publicself-reported0.079