Instructions to use dream-only/lg-decision-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dream-only/lg-decision-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="dream-only/lg-decision-4B")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("dream-only/lg-decision-4B") model = AutoModelForMultimodalLM.from_pretrained("dream-only/lg-decision-4B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
lg-decision-4B
lg-decision-4B is a 4B-parameter text model fine-tuned from Qwen/Qwen3.5-4B for decision-style tasks: classification, multiple choice, retrieval reranking and tool selection. A request carries a state (text or JSON) and one or more named, typed questions. For each question the server returns:
- choice: a probability for every named option, the most probable option (
choice) and its probability (confidence); - noul (yes/no): the probability that the answer is yes (
noul); - score: a probability for every level of an ordered scale (levels are numbered from 0;
legendmaps them to the given labels), the expected level (score) and the probability of the most probable level (confidence).
The model is served by the bundled simple-jev server (transformers), which exposes the /v1/systemone endpoint used by the Decision Index kit.
Model description
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3.5-4B |
| Architecture | Qwen3_5ForConditionalGeneration; text model with 32 layers (8 full-attention, 24 linear-attention) |
| Weights | one model.safetensors, 10,350,023,784 bytes, bf16 |
| Serving | simple-jev/hf-server/hf_server.py (transformers). Each question is scored as one branch that shares the whole request as a prefix. |
| Prompt | fixed baseline prompt policy (PROMPT_POLICY=baseline) |
| Capacity | 65,536 tokens per branch with the settings below; longer requests are rejected with HTTP 422, not truncated |
| Modalities | text and JSON only (see Limitations) |
| Tested runtime | Python 3.12.13, PyTorch 2.10.0+cu129, transformers 5.20.2, 1Γ NVIDIA H200 |
Decision Index 0.3 (public suite)
Our own run of the public Decision Index 0.3 suite with the kit's own scorer. This is not a leaderboard result.
| Headline | Value |
|---|---|
| Public index | 78.56 |
| Balanced raw | 83.14 |
| Breadth | 78.07 |
| Requests | 140,620: 140,332 ok, 288 error |
| Scored rows | 140,178 (complete: true) |
| Area | Skill | Raw | Coverage | Benchmarks |
|---|---|---|---|---|
| Knowledge & Reasoning | 0.6475 | 0.7130 | 1.0000 | 11 |
| Language Understanding | 0.8543 | 0.8947 | 1.0000 | 9 |
| Retrieval & Classification | 0.7966 | 0.8328 | 1.0000 | 6 |
| Tools & Automation | 0.8934 | 0.9046 | 0.9997 | 5 |
| Arts & Human Taste | 0.7455 | 0.8371 | 1.0000 | 6 |
Area values are as reported in the kit's index.json.
- The 288 errors are HTTP 422 rejections of requests in which a single branch exceeds 65,536 tokens (ToolRet 284, BRIGHT 4). They are recorded as errors in the results and were not rerun.
- Per-request results and the kit's score files: SunZhengda/lg-decision-4B-decision-index.
Latency on 1Γ H200 (100-row stratified sample of the public suite, warm, one server process):
| Weighting | Median | Mean | p80 |
|---|---|---|---|
| Suite-weighted | 109 ms | 274 ms | 238 ms |
| Equal weight per dataset | 115 ms | β | 732 ms |
These numbers were not measured on the Decision Index reference hardware (RTX PRO 6000).
Quick start
Install PyTorch 2.10.0 for your CUDA version (tested with 2.10.0+cu129), then exactly the tested versions of the other dependencies (in particular transformers 5.20.2 and accelerate 1.15.0), and download the model:
pip install "transformers==5.20.2" "accelerate==1.15.0" "pydantic==2.12.3" \
"fastapi==0.135.1" "uvicorn==0.41.0" "numpy==1.26.4"
hf download SunZhengda/lg-decision-4B --local-dir lg-decision-4B
cd lg-decision-4B
start_server.sh sets PYTHONPATH to the bundled simple-jev/ sources, so the server package does not need to be installed. Start the server (the defaults are the settings used for the Decision Index run):
ENV_SERVER_PORT=30000 bash simple-jev/start_server.sh
The default model path is the repository root; set ENV_MODEL_PATH to load the weights from another directory.
Example request:
curl -s http://127.0.0.1:30000/v1/systemone -H 'Content-Type: application/json' -d '{
"model": "lg-decision-4B",
"state": "Order 1042 arrived with a cracked screen. The customer asks for a replacement before Friday.",
"questions": {
"action": {"type": "choice", "instructions": "What should support do next?",
"criteria": {"replace": "Send a replacement", "refund": "Issue a refund", "repair": "Arrange a repair"}},
"damaged": {"type": "noul", "instructions": "Did the item arrive damaged?"},
"urgency": {"type": "score", "instructions": "How urgent is this request?", "criteria": ["low", "medium", "high"]}
}
}'
Response (from our server; probabilities rounded to 4 decimals here):
{
"model": "lg-decision-4B",
"answers": {
"action": {
"type": "choice",
"confidence": 0.9908,
"probabilities": {"replace": 0.9908, "refund": 0.0040, "repair": 0.0052},
"choice": "replace"
},
"damaged": {"type": "noul", "noul": 0.9897},
"urgency": {
"type": "score",
"confidence": 0.9235,
"probabilities": {"0": 0.0007, "1": 0.0758, "2": 0.9235},
"score": 1.9227,
"legend": {"0": "low", "1": "medium", "2": "high"}
}
},
"usage": {"input_tokens": 811, "output_tokens": 0}
}
In-process smoke test without HTTP:
python simple-jev/smoke_decide.py
For benchmark maintainers: Decision Index
This is the configuration behind the results above. Use it as written.
GPU. Measured on 1Γ NVIDIA H200 (143,771 MiB). The peak GPU memory was 92,361 MiB (nvidia-smi) at MAX_BATCH_SIZE=16, measured on the 47 longest public-suite requests. It was not measured on a 96 GB card. If you hit out-of-memory errors, restart the server with MAX_BATCH_SIZE=8. Answers were identical at batch sizes 16, 32 and 64; batch size 8 was not tested.
1. Serve (these are also the defaults of start_server.sh):
ENV_SERVER_PORT=30000 \
SERVED_MODEL_NAME=lg-decision-4B \
PROMPT_POLICY=baseline \
MAX_MODEL_LEN=65536 \
MAX_BATCH_TOKENS=65536 \
MAX_BATCH_SIZE=16 \
bash simple-jev/start_server.sh
2. Run the kit (kit commit 25c6ec7, edition 0.3; one server, one process), from a directory that contains the suite:
python -m decision_index run --engine http \
--option base_url=http://127.0.0.1:30000 \
--option model=lg-decision-4B \
--compact --out runs/lg-decision-4B
python -m decision_index score --results runs/lg-decision-4B/results.jsonl
Expected result: public index 78.56 on 140,178 scored rows; 288 requests rejected with HTTP 422 as described above.
Do not change:
- transformers 5.20.2 and accelerate 1.15.0. Use exactly these versions; other versions can give different outputs.
PROMPT_POLICY=baseline. If it is unset, the server auto-selects a different policy (strict_mix_repeat2for this model).MAX_MODEL_LENandMAX_BATCH_TOKENSof 65,536. With 32,768, more requests are rejected; a 100-row sample already had one rejection.
Our suite was rebuilt locally with the kit at 25c6ec7; all published hashes of the 0.3 suite matched.
What is in this repository
| File | Content |
|---|---|
model.safetensors, config.json, generation_config.json |
weights (bf16) and model configuration |
tokenizer.json, tokenizer_config.json, chat_template.jinja |
tokenizer and chat template |
simple-jev/start_server.sh |
launcher; its defaults are the Decision Index settings |
simple-jev/hf-server/ |
HTTP server (hf_server.py), prompt policies, pyproject.toml |
simple-jev/common/ |
request schema, prompt builder, response scoring |
simple-jev/smoke_decide.py |
in-process smoke test |
LICENSE |
Apache License 2.0 |
Limitations
- Text only. The config keeps the base model's vision tower, but its weights are stored under
model.language_model.visual.*, which transformers does not map, so the vision tower is randomly initialized on load and a missing-weights warning is printed. Text inference is not affected. Do not send images. - A request in which one branch exceeds 65,536 tokens is rejected with HTTP 422; it is not truncated.
- The bundled server answers typed questions only; it does not generate free text.
- The results above are our own run of the public suite. They do not establish performance on the Decision Index private sets or on other data.
License
Apache-2.0, for both the weights and the serving code in simple-jev/. Built on Qwen/Qwen3.5-4B by the Qwen team (Alibaba Cloud), Apache-2.0.
- Downloads last month
- 33
Model tree for dream-only/lg-decision-4B
Base model
Qwen/Qwen3.5-4B-Base