nonatofabio commited on
Commit
f391703
·
verified ·
1 Parent(s): 1fdb498

Update the model card

Browse files

A fuller card: what the model is, how to start, evaluation, uses, how it works, training, limitations, files, license and citation. It corrects the model id, the Python example for strands-decider 0.4.0 and the number of options of a choice.

Files changed (1) hide show
  1. README.md +276 -65
README.md CHANGED
@@ -1,5 +1,7 @@
1
  ---
2
  license: apache-2.0
 
 
3
  base_model: google/gemma-4-E2B-it
4
  base_model_relation: finetune
5
  library_name: strands-decider
@@ -11,7 +13,7 @@ tags:
11
  - strands-decider
12
  - gemma4
13
  model-index:
14
- - name: strands-decider-E2B-gemma4-v2
15
  results:
16
  - task:
17
  type: text-classification
@@ -60,70 +62,120 @@ model-index:
60
  name: BEV
61
  ---
62
 
63
- # strands-decider-E2B-gemma4-v2
64
 
65
- strands-decider-E2B-gemma4-v2 is the next version of our [strands-decider-E2B-gemma4-v1-2610](https://huggingface.co/StrandsAgents/strands-decider-E2B-gemma4-v1-2610) decision model, on the same Gemma 4 E2B backbone.
66
 
67
- ![strands-decider-E2B-gemma4-v2: four numbers of this size, and against Strands Decider v1](assets/strands-decider-v2-E2B.png)
68
 
69
- **Answer codes and a shared state.** v1 added a small pointer head to the decoder and shipped as an adapter. This model
70
- replaces Gemma 4's LM head with a token readout: a 255-row layer that starts from the LM head's rows for the answer codes
71
- (A, B, C, ...) and is trained with the model; the rest of the LM head is dropped. Each option's probability is read from
72
- its code at the last token of the prompt. The state is encoded once, in both directions, and every question reads it, so
73
- answering several questions about the same state costs little more than answering one, and no question sees another.
74
 
75
- **Prompt length.** The model is trained on prompts of up to 16,384 tokens and checked up to 32,768, the default limit.
76
- Longer prompts run, up to 131,072 (`--max-length 131072` with `strands-decider serve`, or `max_length=131072` in
77
- `load_decision_engine`).
78
-
79
- **Images.** Images go through Gemma 4's own vision encoder, unchanged from the base: v2 is trained on text only.
80
-
81
- This checkpoint is one full model: the fine-tuned decoder merged into Gemma 4 E2B's own checkpoint, with its temperature in
82
- `decision_config.json`. The code is at https://github.com/strands-labs/strands-decider, under the same Apache-2.0
83
- license as this model.
84
 
85
  | | |
86
  | --- | --- |
87
  | **Base model** | [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it), 2.3B effective parameters (5.1B with embeddings) |
88
- | **Inputs** | Text or JSON, plus up to 4 images: a state and any number of typed questions about it |
89
- | **Decision types** | Choice (1 to 255 options) · Yes / No · Score |
90
  | **Context** | 32,768 tokens (validated; the default limit), up to 131,072 |
91
- | **Size** | 10.3 GB in bf16; one GPU with 24 GB of memory |
 
 
 
 
92
  | **License** | Apache-2.0 |
93
 
94
- ## Evaluation
95
 
96
- | Model | [Decision Index 0.3, public](https://huggingface.co/spaces/multimodalart/jev-decision-index) | [JevBench](https://benchmarkheaven.com/jev-models) | [OpenDecisions](https://huggingface.co/datasets/jgeuter/OpenDecisions) | [DecisionPivot](https://huggingface.co/datasets/startlux-models/DecisionPivot) | [BEV](https://huggingface.co/datasets/avbiswas/bev-decision) |
97
- |---|---:|---:|---:|---:|---:|
98
- | **strands-decider-E2B-gemma4-v2 (this model)** | **57.1** | **87.4** | **77.7** | **23.3** | **74.0** |
99
- | [strands-decider-E2B-gemma4-v1-2610](https://huggingface.co/StrandsAgents/strands-decider-E2B-gemma4-v1-2610) | 29.3 | 77.5 | 56.8 | 7.3 | 63.9 |
 
 
 
 
 
100
 
101
- 0–100. This model's row is at the temperature it ships with (T = 1.5456). Of these benchmarks only
102
- OpenDecisions depends on it: 76.2 at T = 1, as on the Jev leaderboard. v1 at T = 1. Decision Index 0.3, public: 41 tasks in five areas; JevBench: % of the 231 public items answered correctly; OpenDecisions: everyday decisions, scored on answer quality and calibration; DecisionPivot: pair accuracy on items that differ in one decisive detail; BEV: choice, yes/no and ordered-score decisions across 18 domains.
103
 
104
- ## Usage
105
 
106
- Requirements: a GPU with 24 GB of memory for the 10.3 GB of bf16 weights, or Apple silicon (`--device mps`) or a CPU, more
107
- slowly.
108
 
109
  ```bash
110
  pip install strands-decider
111
- strands-decider ask StrandsAgents/strands-decider-E2B-gemma4-v2 \
112
- --state "Help! My payouts have been failing for 3 days!" \
 
113
  --choice "Which team should handle this?=billing,sales,retail" \
114
- --noul "Does this convey urgency?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  ```
116
 
117
- Add `--image photo.jpg`, up to four times, to send images with the state.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
- The same model serves `POST /v1/systemone` with `strands-decider serve StrandsAgents/strands-decider-E2B-gemma4-v2 --port 8000`; the server binds to `127.0.0.1`
120
- and has no authentication. In Python:
121
 
122
  ```python
 
123
  from strands_decider.decision import load_decision_engine
124
 
125
- engine = load_decision_engine("StrandsAgents/strands-decider-E2B-gemma4-v2", device="cuda")
126
- response = engine.evaluate({
127
  "state": "My integration keeps failing with a 401 since we rotated our API key. Please help.",
128
  "questions": {
129
  "team": {"type": "choice", "instructions": "Which team should handle this request?",
@@ -133,17 +185,19 @@ response = engine.evaluate({
133
  "frustration": {"type": "score", "instructions": "How frustrated is the customer?",
134
  "criteria": ["calm", "mildly annoyed", "frustrated", "angry"]},
135
  },
136
- })
137
  answers = response.model_dump(exclude_none=True)["answers"]
138
  print(answers["team"]["choice"], answers["urgent"]["noul"])
139
  ```
140
 
141
  ### Request schema
142
 
 
 
143
  ```python
144
  {
145
  "state": str | dict | list, # the context to decide on; non-strings are serialized as JSON
146
- "images": [str], # optional: up to 4 images, each a base64 PNG, JPEG, WebP or GIF of at most
147
  # 16 MB, with or without a data:image/...;base64, prefix
148
  "questions": { # 1 or more questions, answered from the same state
149
  "<id>": {
@@ -157,34 +211,191 @@ print(answers["team"]["choice"], answers["urgent"]["noul"])
157
 
158
  | Type | `criteria` | Answer |
159
  |---|---|---|
160
- | `choice` | `{option_name: description or None}`, 1 to 255 options | `choice`, `probabilities` (per option), `confidence` |
161
- | `noul` | optional `{"true": description, "false": description}` | `noul` = P(true) |
162
- | `score` | list of ordered levels, lowest first | `score` (expected level index), `probabilities`, `legend`, `confidence` |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
 
164
- The options are shown to the model in the order you give them, under the answer codes `A`, `B`, ... A choice's `confidence`
165
- rescales the top probability so that an even split is 0 and a certain answer is 1. A prompt (the state plus one question)
166
- of up to 32,768 tokens is served by default, and of up to 131,072 with `load_decision_engine(..., max_length=131072)`; inputs
167
- are never truncated.
168
 
169
- ## Several questions in one request
170
 
171
- A request can carry any number of questions about the same state. An answer does not change when you add, remove or
172
- reorder the other questions, and each extra question costs only its own tokens. On one H100 in bf16, the median request over JevBench's 231 takes 62 ms with one question and 92 ms with
173
- 30 questions on the same state.
 
 
174
 
175
- ## Temperature and calibration
176
 
177
- `decision_config.json` stores the temperature fitted on held-out data (1.5456 for this checkpoint), and every
178
- runtime applies it once, then normalizes a softmax over each question's own options. The temperature never changes the chosen
179
- answer. If your application relies on the probability values rather than the top answer, we recommend checking them on a sample
180
- of your own traffic.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
- ## Checkpoint format
183
 
184
- This is the decision-checkpoint layout of the [decision interface](https://github.com/strands-labs/strands-decider/blob/main/docs/spec.md):
185
- Gemma 4 E2B's own checkpoint, every tensor under the base's names with the fine-tuned decoder merged in, plus
186
- `readout.safetensors`, a bf16 `[255, hidden]` decision readout, and `decision_config.json`, which names the prompt format
187
- (`strands-chat`), the 255 answer codes and their token ids, the temperature and the attention mode (`prefix_bidir`). That
188
- mask is used on every layer, Gemma 4's sliding-window layers included, so every layer sees the whole prompt instead of only
189
- its usual window. There is no chat template and no code in the repository.
190
- `golden_vectors.jsonl` holds the reference answers a runtime is checked against.
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
  base_model: google/gemma-4-E2B-it
6
  base_model_relation: finetune
7
  library_name: strands-decider
 
13
  - strands-decider
14
  - gemma4
15
  model-index:
16
+ - name: strands-decider-E2B-gemma4-v2-2611
17
  results:
18
  - task:
19
  type: text-classification
 
62
  name: BEV
63
  ---
64
 
65
+ # strands-decider-E2B-gemma4-v2-2611
66
 
67
+ Strands Decider is a decision model for agentic AI. A large language model (LLM) generates arbitrary text; a decision model picks between sets of options and rates things on a scale, and every answer carries a calibrated confidence.
68
 
69
+ You send a **state** (the text a decision is about) and one or more **questions**, each of one type: `choice` (one of 2 to 255 options), `noul` (yes/no) or `score` (a level on an ordered scale). In one pass, with no generated text, the model returns a probability for each option. The questions and options are in the request, so the same model answers a new decision with no more training.
70
 
71
+ This repository holds the E2B model, the smallest of the five in Strands Decider v2. Each is a Gemma 4 instruction model from Google, fine-tuned for decisions. This one follows [strands-decider-E2B-gemma4-v1-2610](https://huggingface.co/StrandsAgents/strands-decider-E2B-gemma4-v1-2610) on the same base model. Code: https://github.com/strands-labs/strands-decider, under the same Apache-2.0 license as this model.
 
 
 
 
72
 
73
+ ![Strands Decider v2 E2B against v1 E2B on four benchmarks, with its calibration gap and latency.](assets/strands-decider-v2-E2B.png)
 
 
 
 
 
 
 
 
74
 
75
  | | |
76
  | --- | --- |
77
  | **Base model** | [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it), 2.3B effective parameters (5.1B with embeddings) |
78
+ | **Inputs** | A state (text or JSON, with optional images) and any number of typed questions about it |
79
+ | **Decision types** | Choice (2 to 255 options) · Yes / No · Score (2 to 10 levels) |
80
  | **Context** | 32,768 tokens (validated; the default limit), up to 131,072 |
81
+ | **Size** | 10.3 GB of weights in bf16; one GPU with 24 GB of memory |
82
+ | **Results** | 57.1 on the Decision Index 0.3, 27.8 points over Strands Decider v1 E2B. An average gap of 3.2 points between confidence and accuracy. 62 ms for one question on one NVIDIA H100 GPU, and 92 ms for 30 questions about one state |
83
+ | **Version** | v2, the second release of Strands Decider. Names follow `strands-decider-{size}-{base}-v{N}-{YYMM}` ([naming rule](https://github.com/strands-labs/strands-decider/blob/main/docs/naming.md)) |
84
+ | **Developed by** | The Strands Decider team, in [Strands Labs](https://github.com/strands-labs) |
85
+ | **Documentation** | https://strandsagents.com/docs/labs/strands-decider/overview/ |
86
  | **License** | Apache-2.0 |
87
 
88
+ The five v2 models take the same request and give the same kind of answer, so a change of model is a change of one name. All Strands Decider models are at https://huggingface.co/StrandsAgents.
89
 
90
+ | Model | Base model | Parameters | Weights in bf16 | Pick it for |
91
+ | --- | --- | --- | --- | --- |
92
+ | **[E2B](https://huggingface.co/StrandsAgents/strands-decider-E2B-gemma4-v2-2611) (this model)** | [gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it) | 2.3B effective (5.1B with embeddings) | 10.3 GB | The smallest model: one 24 GB GPU, or no GPU |
93
+ | [E4B](https://huggingface.co/StrandsAgents/strands-decider-E4B-gemma4-v2-2611) | [gemma-4-E4B-it](https://huggingface.co/google/gemma-4-E4B-it) | 4.5B effective (8B with embeddings) | 16 GB | One 40 GB GPU |
94
+ | [12B](https://huggingface.co/StrandsAgents/strands-decider-12B-gemma4-v2-2611) | [gemma-4-12B-it](https://huggingface.co/google/gemma-4-12B-it) | 11.95B | 24 GB | One 48 GB GPU |
95
+ | [26B-A4B](https://huggingface.co/StrandsAgents/strands-decider-26B-A4B-gemma4-v2-2611) | [gemma-4-26B-A4B-it](https://huggingface.co/google/gemma-4-26B-A4B-it) | 25.2B, 3.8B active (128 experts) | 52 GB | One 80 GB GPU, many questions about one state |
96
+ | [31B](https://huggingface.co/StrandsAgents/strands-decider-31B-gemma4-v2-2611) | [gemma-4-31B-it](https://huggingface.co/google/gemma-4-31B-it) | 30.7B | 63 GB | The most accurate model, on one 80 GB GPU |
97
+
98
+ **Contents:** [How to get started](#how-to-get-started) · [Evaluation](#evaluation) · [Uses](#uses) · [How the model works](#how-the-model-works) · [Training](#training) · [Limitations and risks](#limitations-and-risks) · [Files and checkpoint format](#files-and-checkpoint-format) · [License and attribution](#license-and-attribution) · [Citation](#citation) · [Report a problem](#report-a-problem)
99
 
100
+ ## How to get started
 
101
 
102
+ You need one NVIDIA GPU with 24 GB of memory, 10.3 GB of disk for the weights and Python 3.11 or later. This size also runs on a CPU, more slowly: add `--device cpu` to a command, or write `device="cpu"` in Python.
103
 
104
+ ### Ask from the command line
 
105
 
106
  ```bash
107
  pip install strands-decider
108
+ strands-decider ask StrandsAgents/strands-decider-E2B-gemma4-v2-2611 \
109
+ --state 'Help! My payouts have been failing for 3 days!' \
110
+ --noul "Does this convey urgency?" \
111
  --choice "Which team should handle this?=billing,sales,retail" \
112
+ --score "How frustrated is the writer?=calm,frustrated,very angry"
113
+ ```
114
+
115
+ At first use, the command downloads the model from Hugging Face. It names the questions `noul_0`, `choice_0` and `score_0`. This is the output of this model on a CPU. On a GPU the last digits can differ:
116
+
117
+ ```
118
+ noul_0 noul = 0.929
119
+ choice_0 -> billing (confidence 0.969)
120
+ billing 0.979
121
+ sales 0.010
122
+ retail 0.010
123
+ score_0 score = 1.26 (confidence 0.533)
124
+ 0: calm 0.013
125
+ 1: frustrated 0.714
126
+ 2: very angry 0.273
127
+ ```
128
+
129
+ How to read the output:
130
+
131
+ - `--noul` asks a yes/no question: `noul` is the name of this question type. The answer is the probability of "yes", so a value near 0 is a confident "no" and a value near 1 is a confident "yes". Read it as "yes" above a threshold that you pick for the task: 0.5 is the natural default.
132
+ - `--choice` gives the best option and a probability for each option.
133
+ - `--score` gives a value on a scale, here from 0 (calm) to 2 (very angry). The value is the expected level, so it can fall between two levels.
134
+ - The confidence of a choice or a score goes from 0 (the model cannot decide) to 1 (the model is sure). A high confidence does not guarantee a right answer. For a choice with N options, it is (N × the largest probability − 1) / (N − 1). Here: (3 × 0.979 − 1) / 2 = 0.969. For a score with L levels, it is 1 − s / ((L − 1) / 2), where s is the standard deviation of the levels under their probabilities.
135
+
136
+ Add `--image photo.jpg`, once for each image, to send images with the state.
137
+
138
+ ### Serve it over HTTP
139
+
140
+ ```bash
141
+ strands-decider serve StrandsAgents/strands-decider-E2B-gemma4-v2-2611 --port 8000
142
  ```
143
 
144
+ The server binds to `127.0.0.1` and has no authentication: use it for local experiments. It answers `POST /v1/systemone` with the same engine as `strands-decider ask`. `GET /health` and `GET /ping` report that the server is up.
145
+
146
+ ```bash
147
+ curl -s localhost:8000/v1/systemone -H 'content-type: application/json' -d '{
148
+ "state": "Help! My payouts have been failing for 3 days!",
149
+ "questions": {
150
+ "is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"},
151
+ "team": {"type": "choice", "instructions": "Which team should handle this?",
152
+ "criteria": {"billing": null, "sales": null, "retail": null}}
153
+ }
154
+ }'
155
+ ```
156
+
157
+ The answer has the same question names. This sample is from an NVIDIA GPU, and it leaves out `usage` (the token counts) and `latency_ms`, which the answer also has:
158
+
159
+ ```json
160
+ {
161
+ "model": "strands-decider-E2B-gemma4-v2-2611",
162
+ "answers": {
163
+ "is_urgent": {"type": "noul", "noul": 0.929},
164
+ "team": {"type": "choice", "choice": "billing",
165
+ "probabilities": {"billing": 0.98, "sales": 0.0098, "retail": 0.0102},
166
+ "confidence": 0.97}
167
+ }
168
+ }
169
+ ```
170
 
171
+ ### Call it from Python
 
172
 
173
  ```python
174
+ from strands_decider.core import Request
175
  from strands_decider.decision import load_decision_engine
176
 
177
+ engine = load_decision_engine("StrandsAgents/strands-decider-E2B-gemma4-v2-2611", device="cuda")
178
+ response = engine.evaluate(Request.model_validate({
179
  "state": "My integration keeps failing with a 401 since we rotated our API key. Please help.",
180
  "questions": {
181
  "team": {"type": "choice", "instructions": "Which team should handle this request?",
 
185
  "frustration": {"type": "score", "instructions": "How frustrated is the customer?",
186
  "criteria": ["calm", "mildly annoyed", "frustrated", "angry"]},
187
  },
188
+ }))
189
  answers = response.model_dump(exclude_none=True)["answers"]
190
  print(answers["team"]["choice"], answers["urgent"]["noul"])
191
  ```
192
 
193
  ### Request schema
194
 
195
+ The command line, the server and Python take the same request:
196
+
197
  ```python
198
  {
199
  "state": str | dict | list, # the context to decide on; non-strings are serialized as JSON
200
+ "images": [str], # optional: each image a base64 PNG, JPEG, WebP or GIF of at most
201
  # 16 MB, with or without a data:image/...;base64, prefix
202
  "questions": { # 1 or more questions, answered from the same state
203
  "<id>": {
 
211
 
212
  | Type | `criteria` | Answer |
213
  |---|---|---|
214
+ | `choice` | `{option_name: description or None}`, 2 to 255 options | `choice`, `probabilities` (per option), `confidence` |
215
+ | `noul` | optional `{"true": description, "false": description}` | `noul` = P(true), the probability of yes |
216
+ | `score` | list of ordered levels, lowest first, 2 to 10 levels | `score` (expected level index), `probabilities`, `legend` (the label of each level), `confidence` |
217
+
218
+ The options are shown to the model in the order you give them, under the answer codes `A`, `B`, ... In `criteria`, a description tells the model what an option means.
219
+
220
+ A prompt (the state plus one question) of up to 32,768 tokens is served by default, and of up to 131,072 with `load_decision_engine(..., max_length=131072)` or `strands-decider serve --max-length 131072`. Inputs are never truncated: the server refuses a prompt that is too long with HTTP status 422, and the reason is in the `detail` field.
221
+
222
+ ### Several questions in one request
223
+
224
+ An answer does not change when you add, remove or reorder the other questions of a request, and each extra question costs only its own tokens: [Latency](#latency) has the time for 1 question and for 30. Put all the questions about one state in the same request.
225
+
226
+ ## Evaluation
227
+
228
+ ### Results
229
+
230
+ Scores go from 0 to 100, and higher is better. The last row is the v1 model of the same size. Each v2 row is at the temperature that its model ships with (for this model, T = 1.5456), and the v1 row is at a temperature of 1. Of these benchmarks, only OpenDecisions depends on the temperature, which [Calibration](#calibration) explains: this model scores 76.2 there at a temperature of 1, as on the Jev leaderboard.
231
+
232
+ | Model | Decision Index 0.3, public | JevBench | OpenDecisions | DecisionPivot | BEV |
233
+ |---|---:|---:|---:|---:|---:|
234
+ | **v2 E2B (this model)** | **57.1** | **87.4** | **77.7** | **23.3** | **74.0** |
235
+ | v2 E4B | 63.2 | 88.3 | 83.9 | 45.2 | 78.9 |
236
+ | v2 12B | 64.1 | 92.2 | 85.7 | 58.9 | 79.0 |
237
+ | v2 26B-A4B | 69.0 | 92.6 | 88.6 | 69.2 | 81.4 |
238
+ | v2 31B | 71.5 | 93.1 | 92.2 | 84.3 | 84.5 |
239
+ | [v1 E2B](https://huggingface.co/StrandsAgents/strands-decider-E2B-gemma4-v1-2610) | 29.3 | 77.5 | 56.8 | 7.3 | 63.9 |
240
+
241
+ | Benchmark | What it measures |
242
+ | --- | --- |
243
+ | [Decision Index 0.3, public](https://huggingface.co/spaces/multimodalart/jev-decision-index) | 41 tasks in five areas |
244
+ | [JevBench](https://benchmarkheaven.com/jev-models) | The share of the 231 public items answered correctly |
245
+ | [OpenDecisions](https://huggingface.co/datasets/jgeuter/OpenDecisions) | Everyday decisions, scored on answer quality and calibration |
246
+ | [DecisionPivot](https://huggingface.co/datasets/startlux-models/DecisionPivot) | Pair accuracy on items that differ in one decisive detail |
247
+ | [BEV](https://huggingface.co/datasets/avbiswas/bev-decision) | Choice, yes/no and ordered-score decisions across 18 domains |
248
+
249
+ The Decision Index and JevBench links open public leaderboards, which show the scores of other models on the same benchmarks.
250
+
251
+ ### Calibration
252
+
253
+ A model is calibrated when its probabilities follow its accuracy: of the answers that get a probability of 0.9, about 90% are right. For this model, the average gap between confidence and accuracy is 3.2 points.
254
+
255
+ One temperature, a number that scales the scores of the options before they become probabilities, makes the probabilities follow the accuracy. `decision_config.json` stores the temperature fitted on held-out data (1.5456 for this checkpoint), and every runtime (a program that runs the model) applies it once. The temperature does not change which option has the highest probability. It changes the probability values. You do not set it in a request.
256
+
257
+ ### Latency
258
+
259
+ On one NVIDIA H100 GPU in bf16, the median request over JevBench's 231 items takes 62 ms with one question and 92 ms with 30 questions on the same state.
260
+
261
+ ## Uses
262
 
263
+ ### Direct use
 
 
 
264
 
265
+ Use the model where your application makes the same kind of decision again and again, and where you can list the possible answers before the request. Typical decisions:
266
 
267
+ - **Model routing:** send a request to a small model or to a large one.
268
+ - **Tool selection and argument checking:** choose the tool that an agent calls, and check the arguments of a tool call.
269
+ - **Interventions and guardrails:** decide if a person must review the next action of an agent, or if a request breaks a policy. Use it as one check among others, not as the only safety control.
270
+ - **Evaluation:** judge an answer against a rubric, for example if a document supports its claims.
271
+ - **Triage and classification:** label support tickets, sort email or tag documents into fixed categories, with or without an agent.
272
 
273
+ ### Downstream use
274
 
275
+ - **In a Strands agent.** [Decision models in the Strands SDK](https://strandsagents.com/docs/user-guide/sdk/decision-models/) shows how to use Strands Decider as the decision model of an agent.
276
+ - **A new general model.** The [v2 recipes](https://github.com/strands-labs/strands-decider/blob/main/training/README.md#the-v2-recipes) train a model from a Gemma 4 base model on a broad data mix.
277
+
278
+ ### Out-of-scope use
279
+
280
+ The model does not write text, explain an answer or add an option of its own. When a task needs generated text, a conversation, code or a summary, use a generative model, and use Strands Decider to decide when to call it.
281
+
282
+ ## How the model works
283
+
284
+ **A decision, not a generation.** A language model generates text token by token. Strands Decider does not. The request fixes the possible answers, so one forward pass gives one score for each option, and a softmax over the scores of a question's own options is the answer. There is no decoding loop.
285
+
286
+ **Answer codes and a token readout.** The prompt lists the options of a question under short answer codes (`A`, `B`, `C`, ...). Gemma 4 ends in an LM head, the layer that scores every token of the vocabulary to generate text. This model replaces it with a token readout of 255 rows, one for each answer code. Each row starts from the LM head's row for its code and is trained with the model, and the rest of the LM head is dropped. Each option's probability is read from its code at the last token of the prompt. The readout has rows for codes, not for options, so a new set of options needs no change to the model. How well it answers depends on the decision: measure on your own data before you rely on it.
287
+
288
+ **One state, read once and in both directions.** The state is encoded once, and every question reads it. A state token sees all of the state, the text before it and the text after it, and never a question. A question token sees the state and its own question, so no question sees another. Most layers of Gemma 4 are sliding-window layers, which see only a window of nearby tokens: in this model, every layer sees the whole prompt.
289
+
290
+ <details>
291
+ <summary>Technical facts of this checkpoint</summary>
292
+
293
+ | | |
294
+ | --- | --- |
295
+ | **Decoder** | Gemma 4 E2B: 35 layers, hidden size 1,536 |
296
+ | **Readout** | 255 answer codes × 1,536, in bf16 |
297
+ | **Attention** | `prefix_bidir` on every layer, with no window |
298
+ | **Prompt format** | `strands-chat` |
299
+ | **Temperature** | 1.5456 |
300
+
301
+ </details>
302
+
303
+ ### What changed from v1
304
+
305
+ <details>
306
+ <summary>The v1 models on Gemma 4 against the v2 models</summary>
307
+
308
+ | | Strands Decider v1 on Gemma 4 | Strands Decider v2 |
309
+ | --- | --- | --- |
310
+ | **Sizes** | E2B, E4B, 12B, 26B-A4B | E2B, E4B, 12B, 26B-A4B, 31B |
311
+ | **Readout** | A pointer head added to the decoder. It scores each option from the state of the decoder at the answer position and at the last token of the option | A token readout instead of the LM head |
312
+ | **Attention** | Causal: a token sees only the text before it | The state in both directions |
313
+ | **Checkpoint** | A LoRA adapter (a small set of extra weights) and a head, next to the base model | One full model, with the adapter merged in |
314
+ | **Inputs** | Text | Text and images |
315
+ | **Calibration** | One temperature for each question type | One temperature for all question types |
316
+ | **Training data** | 135,602 rows | 17.48 million rows |
317
+ | **LoRA rank** | 16 in each run | 64 |
318
+
319
+ </details>
320
+
321
+ ## Training
322
+
323
+ ### Training data
324
+
325
+ Strands Decider v2 trains on a data mix of 17.5 million rows of text (8.9 billion tokens). Each row is one decision: a state, a question and 2 to 255 options. Language models wrote 72% of the rows from task specifications. 6% come from generator programs in known task formats, and 22% come from more than 200 public datasets, converted to the same format. The rows cover 13 topics, such as knowledge questions, reasoning, judging responses against rubrics, tool use and safety. About 96% of the rows are in English, and none is longer than 16,384 tokens. The [data card](https://github.com/strands-labs/strands-decider/blob/main/docs/data-card.md) gives the counts, the kinds of source, the topics, the shape of the rows and sample rows.
326
+
327
+ ### Training procedure
328
+
329
+ <details>
330
+ <summary>How the released model was trained</summary>
331
+
332
+ Training starts from [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it) at the revision that [License and attribution](#license-and-attribution) names. It adds a LoRA adapter of rank 64 and trains it with the token readout. The base model's own weights stay as they are.
333
+
334
+ A run makes one pass over the data mix, with about 2,700 rows for each update of the weights. It uses no teacher model: the target of each row is all that a run trains toward, with a cross-entropy loss on the answer. Attention in training is the same as in use.
335
+
336
+ The released model is the average of three runs of the same config with different random seeds: the export merges the adapter of each run into the base model and averages the results with equal weights. Then the temperature is fitted on held-out questions and written into `decision_config.json`.
337
+
338
+ The config of this size is [`configs/v2/strands-decider-E2B-gemma4-v2-2611.yaml`](https://github.com/strands-labs/strands-decider/blob/main/configs/v2/strands-decider-E2B-gemma4-v2-2611.yaml), and [the v2 recipes](https://github.com/strands-labs/strands-decider/blob/main/training/README.md#the-v2-recipes) have the steps: convert the rows, train one config and export.
339
+
340
+ </details>
341
+
342
+ ## Limitations and risks
343
+
344
+ - On a GPU, the model needs 24 GB of memory and cannot be split over GPUs. Long prompts with many questions need more memory: send a shorter text or fewer questions in one request.
345
+ - Images go through the base model's own image input layers, unchanged from the base model: v2 is trained on text only.
346
+ - The temperature is fitted on held-out data. It does not change which option has the highest probability. It changes the probability values. If your application relies on those values, check them on a sample of your own traffic.
347
+ - The model gives a probability to each option of the request, also when no option is right. If that can happen, add an option for the case, for example `out_of_scope` or "I don't know". The training data has rows with such options.
348
+ - The model does not answer every question correctly: [Evaluation](#evaluation) has the scores. Where a wrong decision has a cost, set a threshold on the confidence with your own data. Above the threshold, act. Below it, confirm the answer, call a larger model or ask a person.
349
+ - The model starts from Gemma 4 and can carry the biases and the knowledge limits of that model and of the training data. Do not use it as the only basis for a decision with a legal or similar effect on a person, such as hiring, credit, health or housing.
350
+ - About 96% of the training rows are in English. For another language, measure the model on a sample of your own data before you rely on it.
351
+ - Language models wrote 72% of the training rows, so the data carries the style of those models, and the shares of its topics are not those of real use. Use the [data card](https://github.com/strands-labs/strands-decider/blob/main/docs/data-card.md) to judge how close your decisions are to the training data.
352
+ - The model is trained on prompts of up to 16,384 tokens. 32,768 tokens, the default limit, is the longest prompt that it is checked at. Before you raise the limit, measure the model on your own long inputs.
353
+
354
+ ## Files and checkpoint format
355
+
356
+ <details>
357
+ <summary>The files of this repository</summary>
358
+
359
+ | File | Content |
360
+ | --- | --- |
361
+ | `model.safetensors` | Gemma 4 E2B's own checkpoint, every tensor under the base's names, with the fine-tuned decoder merged in |
362
+ | `readout.safetensors` | The decision readout: a bf16 tensor of 255 × 1,536 (answer codes × hidden size) |
363
+ | `decision_config.json` | The prompt format (`strands-chat`), the 255 answer codes and their token ids, the temperature, the attention mode (`prefix_bidir`), the validated prompt length and the revision of the base model |
364
+ | `config.json`, `processor_config.json`, `tokenizer.json`, `tokenizer_config.json` | The configuration of the model and of its input processor, and the tokenizer |
365
+ | `golden_vectors.jsonl` | The reference answers that a runtime is checked against |
366
+ | `LICENSE`, `NOTICE` | The Apache-2.0 license, and the notice that names the base model and what changed |
367
+ | `README.md`, `assets/strands-decider-v2-E2B.png` | This card and its picture |
368
+ | `.gitattributes` | The Git settings of the repository |
369
+
370
+ This is the decision-checkpoint layout of the [decision interface](https://github.com/strands-labs/strands-decider/blob/main/docs/architecture.md#the-cores-runtime-interface), which the code repository defines. The attention mode `prefix_bidir` is the attention that [How the model works](#how-the-model-works) describes. The repository has no chat template and no code. [The token readout](https://github.com/strands-labs/strands-decider/blob/main/docs/architecture.md#opt-in-the-token-readout) in the code repository describes the export that writes the weights, the readout, `decision_config.json` and the configuration files.
371
+
372
+ </details>
373
+
374
+ ## License and attribution
375
+
376
+ The weights of this repository and the code of Strands Decider have the Apache-2.0 license (`LICENSE`).
377
+
378
+ This model is derived from [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it), revision `3e22461f65e89153144f8adb70e3b8c2cc9845a7`, under the [Apache License 2.0](https://ai.google.dev/gemma/docs/gemma_4_license). `NOTICE` states what changed:
379
+
380
+ > Modifications: the text decoder was fine-tuned, and a decision readout of 255 rows, one per answer code, takes the place of the generation output layer; it started from the tied output-embedding rows of those codes. Every layer reads the prompt with the decision interface's prefix-bidirectional attention. Every other part of the base model, its image and audio input layers where it has them, is the base model's, unchanged.
381
+
382
+ Gemma is a trademark of Google LLC. No affiliation with or endorsement by Google is implied.
383
+
384
+ ## Citation
385
+
386
+ To cite the Strands Decider v2 models:
387
+
388
+ ```bibtex
389
+ @misc{strandsdecider2026v2,
390
+ title = {Strands Decider v2: Open, Calibrated Decision Models from E2B to 31B},
391
+ author = {{The Strands Decider team}},
392
+ year = {2026},
393
+ howpublished = {\url{https://github.com/strands-labs/strands-decider}},
394
+ note = {Model weights: https://huggingface.co/StrandsAgents}
395
+ }
396
+ ```
397
 
398
+ ## Report a problem
399
 
400
+ - A bug, a question or a result on your task: open an issue at https://github.com/strands-labs/strands-decider/issues. Name the model size, your hardware, the command and the message.
401
+ - A security problem: do not open a public issue. Follow the [security policy](https://github.com/strands-labs/strands-decider/blob/main/SECURITY.md).