Instructions to use Phanhai2804/Decision-4B-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Phanhai2804/Decision-4B-v1 with PEFT:
from peft import PeftModel from transformers import AutoModel base_model = AutoModel.from_pretrained("Qwen/Qwen3.5-4B-Base") model = PeftModel.from_pretrained(base_model, "Phanhai2804/Decision-4B-v1") - Transformers
How to use Phanhai2804/Decision-4B-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Phanhai2804/Decision-4B-v1")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Phanhai2804/Decision-4B-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Decision-4B-v1
Decision-4B-v1 is a 4-billion-parameter structured decision model built from
Qwen/Qwen3.5-4B-Base. It was trained with a rank-16 LoRA adapter and a Kev
pointer head to score explicitly supplied alternatives rather than generate
free-form text.
The model accepts a state and one or more typed questions. It returns calibrated probabilities, a selected choice, a boolean decision, or an expected ordinal score depending on the question type.
This repository contains a Kev checkpoint. It is not a standalone generative
chat model. Use the Kev runtime so that both the LoRA adapter and head.pt are
loaded correctly.
Model details
| Item | Value |
|---|---|
| Base model | Qwen/Qwen3.5-4B-Base |
| Checkpoint type | PEFT LoRA adapter plus Kev pointer head |
| Parameters updated | 33.8 million trainable parameters |
| LoRA rank | 16 |
| LoRA targets | All supported projection layers |
| Decision head dimension | 256 |
| Supported question types | choice, noul, score |
| Training context limit | 7,552 state tokens |
| Primary training language | English |
| Preliminary evaluated language | Vietnamese |
| Developed by | Phanhai2804 |
Intended use
Decision-4B-v1 is intended for applications that can describe a decision as:
- a factual or policy state;
- a concise instruction;
- an explicit set of valid choices, a boolean decision, or an ordered scale.
Suitable uses include intent routing, policy-based decisions, document and clause classification, complaint routing, risk triage, and structured multiple-choice reasoning.
The model is best used as a scoring component inside a larger application. The application should validate the schema, apply domain-specific thresholds, log decisions, and route low-confidence or high-impact cases to human review.
Input and output format
Choice
{
"state": "A customer reports that the same card payment was charged twice.",
"questions": {
"intent": {
"type": "choice",
"instructions": "Identify the customer's primary intent.",
"criteria": {
"card_payment_duplicate": "The same card payment was charged twice",
"cash_withdrawal": "The customer wants to withdraw cash",
"change_pin": "The customer wants to change a PIN"
}
}
}
}
Boolean (noul)
{
"state": "The policy requires enhanced review for transactions of at least 500,000,000 VND. The transaction is 620,000,000 VND.",
"questions": {
"enhanced_review": {
"type": "noul",
"instructions": "Does this transaction require enhanced review?"
}
}
}
Ordinal score
For score, criteria order defines the scale. The response is an expected
position on that scale together with a probability for every level.
{
"state": "The account completed two successful activities thousands of kilometres apart within five minutes.",
"questions": {
"risk": {
"type": "score",
"instructions": "Select the immediate system action.",
"criteria": [
"allow",
"monitor",
"require_otp",
"block_account"
]
}
}
}
Do not change the order of score criteria between requests unless the meaning of the ordinal scale is also intended to change.
Running the model
Clone and install the Kev repository:
git clone https://github.com/jaredpalmer/kev.git
cd kev
uv sync --extra serve
Serve a checkpoint downloaded from Hugging Face:
CUDA_VISIBLE_DEVICES=0 \
KEV_DTYPE=bf16 \
uv run --no-sync python -m kev.serve \
--run Phanhai2804/decision-4b-v1 \
--device cuda \
--port 8009
Or serve a local checkpoint directory:
CUDA_VISIBLE_DEVICES=0 \
KEV_DTYPE=bf16 \
uv run --no-sync python -m kev.serve \
--run runs/decision-data-v1-base-full-20261017-000022 \
--device cuda \
--port 8009
Example request:
curl -s http://127.0.0.1:8009/v1/systemone \
-H "Content-Type: application/json" \
-d '{
"state": "The customer says the same card payment was charged twice.",
"questions": {
"intent": {
"type": "choice",
"instructions": "Identify the primary intent.",
"criteria": {
"card_payment_duplicate": null,
"cash_withdrawal": null,
"change_pin": null
}
}
}
}'
The Kev server also exposes GET /v1/models for checkpoint metadata.
Checkpoint contents
| File | Purpose |
|---|---|
adapter_model.safetensors |
LoRA adapter weights |
adapter_config.json |
PEFT adapter configuration |
head.pt |
Kev pointer head, temperature, and checkpoint metadata |
tokenizer.json |
Tokenizer snapshot |
tokenizer_config.json |
Tokenizer configuration |
chat_template.jinja |
Input formatting template |
training_config.json |
Training configuration |
training_metrics.json |
Recorded training metrics |
Loading only the PEFT adapter with PeftModel is insufficient for decision
inference because that does not load the Kev pointer head.
Training
Training data
The model was trained on 60,365 structured decision records assembled in three stages:
| Component | Records | Purpose |
|---|---|---|
| General decision examples | 35,785 | Multiple-choice and boolean reasoning |
| Minimal-pair records | 17,580 | Contrastive choice and none-of-the-above behavior |
| Complex-domain documents | 7,000 | Classification and intent-routing tasks |
| Total | 60,365 |
Training configuration
| Hyperparameter | Value |
|---|---|
| Epochs | 2 |
| Learning rate | 5e-5 |
| Weight decay | 0.01 |
| Batch setting | 2 |
| Gradient accumulation | 4 |
| LoRA rank | 16 |
| Head dimension | 256 |
| Compute dtype | BF16 |
| Saved adapter weight dtype | FP32 |
| Gradient checkpointing | Enabled |
| Maximum state length | 7,552 tokens |
| Length sorting | Enabled |
| Seed | 42 |
License
The final license is not yet declared. Use of the checkpoint is subject to the base model license and the applicable terms of the training data. Review those terms before redistribution or commercial use.
Contact
Maintainer: Phanhai2804
- Downloads last month
- 5
Model tree for Phanhai2804/Decision-4B-v1
Base model
Qwen/Qwen3.5-4B-Base