Instructions to use Joesh1/onca-3.0-12b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Joesh1/onca-3.0-12b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Joesh1/onca-3.0-12b")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Joesh1/onca-3.0-12b") model = AutoModelForMultimodalLM.from_pretrained("Joesh1/onca-3.0-12b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Joesh1/onca-3.0-12b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Joesh1/onca-3.0-12b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Joesh1/onca-3.0-12b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Joesh1/onca-3.0-12b
- SGLang
How to use Joesh1/onca-3.0-12b 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 "Joesh1/onca-3.0-12b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Joesh1/onca-3.0-12b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Joesh1/onca-3.0-12b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Joesh1/onca-3.0-12b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Joesh1/onca-3.0-12b with Docker Model Runner:
docker model run hf.co/Joesh1/onca-3.0-12b
ONCA 3.0-12B
One text-only model for six structured oncology research tasks
ONCA 3.0-12B is an 11.95B-parameter research model derived from
google/gemma-4-12B. It handles
pathological TNM classification, clinical-trial triage and criterion reasoning,
and CIViC molecular-evidence classification through compact JSON outputs.
This repository contains the final full-GRPO model checkpoint. GRPO started from Phase 2 SFT and completed 285 optimizer steps over three epochs
ONCA 3.0-12B is a research model, not a medical device or substitute for qualified clinical judgment. Human oncology/pathology validation remains pending. Valid JSON can still be clinically wrong.
Results
Figure 3 is reproduced from the final manuscript draft v11. Results use the frozen 4,599-row development-validation set. Exact match requires the complete expected structured output; schema validity measures format only.
| Task | Rows | Mean reward | Exact match | Valid schema |
|---|---|---|---|---|
| Pathological T | 1,035 | 88.70% | 87.44% | 100.00% |
| Pathological N | 846 | 93.18% | 92.43% | 99.88% |
| Pathological M | 688 | 95.55% | 95.06% | 100.00% |
| Trial-space triage | 1,000 | 88.47% | 87.20% | 99.90% |
| Trial-criterion reasoning | 190 | 78.21% | 63.16% | 100.00% |
| CIViC evidence | 840 | 87.79% | 68.69% | 99.29% |
| Overall | 4,599 | 89.90% | 85.02% | 99.83% |
The TrialGPT evidence-sentence score was 83.88%. Nineteen validation inputs were truncated by the declared 4,096-token evaluation limit. No validation or test row was used for SFT or GRPO selection. Gemma 4 and Woollie-13B in the figure use candidate scoring with deterministic assembly, so their results are not controlled native-generation comparisons.
Model details
| Property | Value |
|---|---|
| Final checkpoint | Full GRPO, step 285 |
| Starting checkpoint | Phase 2 SFT |
| Architecture | Gemma 4 Unified, text-only use |
| SFT data | 16,625 unique examples across two disjoint phases |
| GRPO data | 287 eligible prompts: 175 T, 63 trial-space, 49 trial-criterion |
| Evaluation decoding | Greedy, thinking disabled, 128 new tokens maximum |
| Primary format | Merged Hugging Face FP16, 11 safetensors shards |
| Context | Base limit 262,144 tokens; evaluation capped at 4,096 |
The same checkpoint supports all six tasks. No separate task model is needed.
| Task key | Output contract |
|---|---|
tnm_t |
`{"task":"tnm_t","label":"T1 |
tnm_n |
`{"task":"tnm_n","label":"N0 |
tnm_m |
`{"task":"tnm_m","label":"M0 |
trial_space |
`{"task":"trial_space","decision":"CONSIDER |
trial_criterion |
Criterion type, native/canonical decision, and supporting sentence IDs |
civic_evidence |
Evidence type, level, direction, and clinical significance |
Transformers usage
The release was produced with Transformers 5.16.1.
pip install "transformers>=5.10,<6" accelerate safetensors torch
import json
import torch
from transformers import AutoModelForMultimodalLM, AutoTokenizer
MODEL_ID = "Joesh1/onca-3.0-12b"
SYSTEM = (
"Return only valid JSON matching the requested schema. Use only the "
"provided input. This is a research classification, not medical advice."
)
report = "...insert a de-identified pathology report..."
request = f"""TASK: TNM_T
Classify the historical TCGA pathological T category represented by the report.
Use only T1, T2, T3, T4.
Return only JSON: {{"task":"tnm_t","label":"<LABEL>"}}
Cancer type: pancreatic adenocarcinoma
Pathology report:
{report}"""
# Exact text-only serialization used for training and evaluation.
prompt = (
"<bos>"
f"<|turn>system\n{SYSTEM}<turn|>\n"
f"<|turn>user\n{request}<turn|>\n"
"<|turn>model\n<|channel>thought\n<channel|>"
)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
MODEL_ID,
dtype=torch.float16,
device_map="auto",
attn_implementation="sdpa",
).eval()
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
with torch.inference_mode():
generated = model.generate(
**inputs,
do_sample=False,
max_new_tokens=128,
pad_token_id=tokenizer.eos_token_id,
)
text = tokenizer.decode(
generated[0, inputs["input_ids"].shape[1]:],
skip_special_tokens=True,
).strip()
print(json.loads(text))
Keep the task key, allowed labels, and exact JSON contract in each prompt. Validate every response against the selected schema and fail closed on parse errors or unknown fields. Do not request chain-of-thought.
GGUF
Quantized text-only builds are available in the
Joesh1/onca-3.0-12b-gguf
repository in F16, Q8_0, Q6_K, and Q4_K_M formats.
Training and provenance
Two NF4 QLoRA SFT phases trained on 16,625 unique examples. Phase 2 ended at
step 2,184 with validation loss 0.020104. The final GRPO stage used six sampled
completions per eligible prompt, learning rate 1e-6, KL coefficient 0.02,
temperature 0.8, top-p 0.95, group-relative reward normalization, and
three epochs.
The merged release contains 677 FP16 tensors. The merge applied 328 LoRA tensor pairs from the full-GRPO adapter.
| Provenance item | Value |
|---|---|
| Foundation revision | 023679ed352de9bb66cc873c9009ce3482585c08 |
| Full-GRPO adapter SHA-256 | 3f49a260731478ddcfc15a84f64dde0336d0af87c0877cf01c16f9889cc77d94 |
| Export dtype | FP16 |
| Export tensor bytes | 23,919,460,448 |
Training sources include historical TCGA pathology reports, MatchMiner AI synthetic trial-space examples, TrialGPT criterion annotations, and accepted CIViC evidence statements. Group-aware splitting used TCGA patients, MatchMiner patients, TrialGPT patients, and CIViC PMIDs.
Limitations
- Results are from frozen development-validation data, not the locked final test partitions.
- Prospective clinical validation and independent expert adjudication are incomplete.
- GRPO produced only a marginal aggregate gain over Phase 2 SFT.
- TrialGPT data is small; trial-criterion exact match is the weakest result.
- MatchMiner examples are synthetic and trial-space output is triage, not eligibility.
- The model can hallucinate, misclassify, omit evidence, or return unsupported JSON.
- The release is text-only; do not submit images or identifiable patient information.
License
Released under CC BY-NC 4.0 as a conservative designation because MatchMiner AI training material is CC BY-NC 4.0. Gemma 4 is Apache 2.0; TCGA-derived sources are CC BY 4.0; TrialGPT is marked public domain in the frozen manifest; and CIViC data is CC0 1.0. Review all upstream terms before use.
Citation
@misc{onca30_2026,
title = {ONCA 3.0-12B: Oncology Language Model},
author = {ONCA Research Team},
year = {2026},
url = {https://huggingface.co/Joesh1/onca-3.0-12b}
}
Related: ONCA 2.0 · Gemma 4 12B
- Downloads last month
- 182
