aleks-wordcab commited on
Commit
c77d752
·
verified ·
1 Parent(s): 5f295e3

Publish Apex model card with GLiClass 4 attribution and Apache 2.0 license

Browse files
Files changed (3) hide show
  1. LICENSE +202 -0
  2. README.md +31 -553
  3. UPSTREAM_README.md +601 -0
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md CHANGED
@@ -1,601 +1,79 @@
1
  ---
2
  language:
3
  - en
 
4
  library_name: gliclass
5
  pipeline_tag: zero-shot-classification
 
 
6
  tags:
 
7
  - gliclass
8
- - deberta
9
  - zero-shot-classification
10
  - text-classification
11
  - multi-label-classification
12
  - instruction-following
13
  - reranking
14
- - guardrails
15
- - content-moderation
16
- - knowledge-graph-reasoning
17
- license: apache-2.0
18
- base_model: microsoft/deberta-v3-large
19
  ---
20
- # GLiClass v4 Edge
21
 
22
- **Instruction-following zero-shot classification in a 0.4B encoder, built for CPUs and edge devices.**
23
 
24
- `knowledgator/gliclass-v4-edge` is the 0.4B-parameter edge release of
25
- [GLiClass v4](https://github.com/Knowledgator/GLiClass). The labels you pass and an
26
- optional instruction tell it what to decide at inference time. It returns a score for
27
- every label in one forward pass and generates no text. It reaches a Decision Index public skill of 47.5 at a median
28
- latency of 11 ms per decision, ahead of every model up to 1B parameters on the public board (the best of them scores 36.9).
29
 
 
30
 
31
- ## Usage
 
 
 
 
 
 
32
 
33
- ```bash
34
- pip install gliclass -U
35
- ```
36
 
37
- Or install from source in a Python 3.10+ environment:
38
 
39
  ```bash
40
- git clone https://github.com/Knowledgator/GLiClass.git
41
- cd GLiClass
42
- pip install -e .
43
  ```
44
 
45
- The following examples reuse `pipeline`:
46
 
47
  ```python
48
  import torch
49
  from gliclass import GLiClassModel, ZeroShotClassificationPipeline
50
 
51
- model_id = "knowledgator/gliclass-v4-edge"
52
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
53
-
54
  model = GLiClassModel.from_pretrained(model_id)
55
  pipeline = ZeroShotClassificationPipeline(
56
  model,
57
- model_id, # loads the tokenizer
58
  classification_type="multi-label",
59
  max_length=2048,
60
  device=device,
61
  )
62
- ```
63
-
64
- For a local copy, replace the model ID with the checkpoint directory.
65
-
66
- ### Multi-label classification
67
 
68
- ```python
69
  results = pipeline(
70
- "The battery lasts two days, but the screen scratches easily.",
71
- ["battery", "display", "durability", "price", "shipping"],
72
  threshold=0.5,
73
  )[0]
74
  for result in results:
75
- print(result["label"], round(result["score"], 3))
76
- ```
77
-
78
- Each prediction contains `label` and `score`. Pass a list of texts and `batch_size=8` for batched inference.
79
-
80
- Scores are calibrated on held-out data; predictions also carry `initial_score`, the uncalibrated score.
81
-
82
- ### Single-label decisions and scoring
83
-
84
- Use `classification_type="single-label"` to pick one answer: scores are a softmax over the labels.
85
- To score an input, use the levels of a scale as labels and read their probabilities:
86
-
87
- ```python
88
- answer = pipeline(
89
- "Our refund window is 30 days. The customer bought the item 45 days ago.",
90
- ["refund approved", "refund denied", "escalate to a human"],
91
- prompt="Apply the refund policy to the customer's request.",
92
- classification_type="single-label",
93
- )[0]
94
- print(answer)
95
-
96
- quality = pipeline(
97
- "Q: What causes tides? A: Mostly the Moon's gravity, with a smaller effect from the Sun.",
98
- ["1 - wrong", "2 - poor", "3 - partly correct", "4 - good", "5 - excellent"],
99
- prompt="Rate the factual quality of the answer.",
100
- classification_type="single-label",
101
- return_hierarchical=True,
102
- )[0]
103
- print(quality) # every level with its probability
104
- ```
105
-
106
- ### Instruction following
107
-
108
- Use `prompt` for the instruction, policy, or rubric. Labels are interpreted in light of it:
109
-
110
- ```python
111
- policy = (
112
- "Flag a message only if it shares another person's contact details without consent. "
113
- "Public business contact pages are allowed."
114
- )
115
- results = pipeline(
116
- [
117
- "You can reach our support team at help@acme.com.",
118
- "Here is my neighbour's personal phone number: 555-0134, call her at night.",
119
- ],
120
- ["violates policy", "complies with policy"],
121
- prompt=policy,
122
- classification_type="single-label",
123
- )
124
- ```
125
-
126
- Few-shot examples (`examples=[{"text": ..., "labels": [...]}]`) and hierarchical labels
127
- (`{"sentiment": ["positive", "negative"], "topic": ["product", "service"]}`) are also supported.
128
-
129
- ### Knowledge graph reasoning
130
-
131
- Pass the graph as text next to the story, the question as the instruction, and the answers as labels:
132
-
133
- ```python
134
- graph = (
135
- "Alice -member_of-> Finance team\n"
136
- "Finance team -can_read-> Reports folder\n"
137
- "Reports folder -contains-> Salaries.xlsx\n"
138
- "Alice -explicit_deny-> Salaries.xlsx\n"
139
- "Rule: explicit restrictions override team permissions."
140
- )
141
- answer = pipeline(
142
- graph,
143
- ["yes", "no"],
144
- prompt="Can Alice open Salaries.xlsx?",
145
- classification_type="single-label",
146
- )[0]
147
- print(answer) # [{'label': 'no', 'score': ...}]
148
- ```
149
-
150
- The same pattern covers multi-hop questions, agent and web-browsing steps (which link, tool, or action
151
- comes next), and NLI (`entailment`, `neutral`, `contradiction`).
152
-
153
- ### Reranking
154
-
155
- ```python
156
- query = "How do I reset a forgotten router password?"
157
- passages = [
158
- "Hold the reset button for 10 seconds to restore factory settings, then log in with the default password.",
159
- "Our routers support Wi-Fi 7 and dual-band operation.",
160
- "To change your Wi-Fi name, open the admin panel and edit the SSID field.",
161
- ]
162
- scores = pipeline(
163
- passages,
164
- [query],
165
- prompt="Does the passage answer the query?",
166
- threshold=0.0,
167
- )
168
- ranked = sorted(zip(passages, scores), key=lambda p: -p[1][0]["score"])
169
  ```
170
 
171
- ## Serving a Jev-style decision API
172
-
173
- Decision engines such as Jev take a **state** (text or JSON) and a set of typed **questions**, and return a
174
- probability for every option of every question, with no generated text. GLiClass answers the same requests
175
- directly: each question is one GLiClass pass in which the state is the text, the question's `instructions`
176
- are the prompt, and every option is a label. This is the setup used for the Decision Index results below.
177
-
178
- | Question type | Request fields | GLiClass labels | Answer |
179
- | --- | --- | --- | --- |
180
- | `choice` | `instructions`, `criteria: {key: description}` | the option descriptions (the key when a description is missing) | `choice`, `confidence`, `probabilities` per key |
181
- | `noul` (yes / no) | `instructions`, optional `criteria: {"true": ..., "false": ...}` | the true and false descriptions (`yes` / `no` when missing) | `noul` = P(true) |
182
- | `score` | `instructions`, `criteria: [level 0, level 1, ...]` | the level descriptions, in order | `score` = expected level, `confidence`, `probabilities` per level |
183
-
184
- Probabilities are a softmax over the option logits. A JSON state is rendered as `key: value` lines, with string lists as `- item` lines.
185
-
186
- The server below exposes `POST /v1/systemone` and `GET /v1/models`, the request and response shape of
187
- TypeSafe's System One API, so clients written for it (for example the
188
- [WorkflowEvals](https://github.com/typesafe-ai/WorkflowEvals) runner) can point at a local GLiClass model.
189
- It needs only `gliclass`, `fastapi`, and `uvicorn`:
190
-
191
- ```python
192
- # jev_api.py
193
- import json
194
- import os
195
-
196
- import torch
197
- from fastapi import FastAPI, HTTPException
198
- from pydantic import BaseModel
199
-
200
- from gliclass import GLiClassModel, ZeroShotClassificationPipeline
201
-
202
- MODEL_ID = os.environ.get("MODEL", "knowledgator/gliclass-v4-edge")
203
- MAX_LENGTH = int(os.environ.get("MAX_LENGTH", "16384"))
204
- DEVICE = "cuda:0" if torch.cuda.is_available() else "cpu"
205
- DTYPE = torch.bfloat16 if DEVICE != "cpu" else torch.float32
206
-
207
- model = GLiClassModel.from_pretrained(MODEL_ID, torch_dtype=DTYPE).to(DEVICE).eval()
208
- pipe = ZeroShotClassificationPipeline(model, MODEL_ID, max_length=10**9, classification_type="single-label",
209
- device=DEVICE, progress_bar=False).pipe
210
- app = FastAPI(title="GLiClass System One API")
211
-
212
-
213
- class Request(BaseModel):
214
- state: str | dict | list | None = None
215
- questions: dict[str, dict]
216
-
217
-
218
- def as_text(value):
219
- return value if isinstance(value, str) else json.dumps(value, ensure_ascii=False)
220
-
221
-
222
- def render_state(state):
223
- if state in (None, "", {}, []):
224
- return ""
225
- if isinstance(state, str):
226
- return state
227
- if isinstance(state, list):
228
- return "\n".join(f"- {as_text(item)}" for item in state)
229
- lines = []
230
- for key, value in state.items():
231
- if isinstance(value, list) and all(isinstance(item, str) for item in value):
232
- lines += [f"{key}:"] + [f"- {item}" for item in value]
233
- else:
234
- lines.append(f"{key}: {as_text(value)}")
235
- return "\n".join(lines)
236
-
237
-
238
- def options(question):
239
- kind, criteria = question.get("type"), question.get("criteria")
240
- if kind == "choice":
241
- if not criteria or len(criteria) < 2:
242
- raise HTTPException(422, "a choice question needs at least two criteria")
243
- return list(criteria), [as_text(v) if v is not None else k for k, v in criteria.items()]
244
- if kind == "noul":
245
- c = criteria or {}
246
- return ["true", "false"], [as_text(c.get("true") or "yes"), as_text(c.get("false") or "no")]
247
- if kind == "score":
248
- if not criteria or len(criteria) < 2:
249
- raise HTTPException(422, "a score question needs at least two levels")
250
- return [str(i) for i in range(len(criteria))], [as_text(c) for c in criteria]
251
- raise HTTPException(422, f"unsupported question type {kind!r}")
252
-
253
-
254
- @torch.no_grad()
255
- def probabilities(text, prompt, labels):
256
- inputs = pipe.prepare_inputs([text], labels, same_labels=True, prompt=prompt)
257
- length = inputs["input_ids"].shape[-1]
258
- if length > MAX_LENGTH: # refuse instead of truncating
259
- raise HTTPException(422, f"input of {length} tokens exceeds the {MAX_LENGTH}-token limit")
260
- logits = model(**inputs, max_num_classes=len(labels)).logits[0, : len(labels)].float()
261
- return torch.softmax(logits, dim=-1).tolist(), length
262
-
263
-
264
- @app.get("/v1/models")
265
- def models():
266
- return {"models": [{"name": MODEL_ID, "description": "GLiClass"}]}
267
-
268
-
269
- @app.post("/v1/systemone")
270
- def systemone(request: Request):
271
- text, answers, tokens = render_state(request.state), {}, 0
272
- for name, question in request.questions.items():
273
- keys, labels = options(question)
274
- prompt = as_text(question.get("instructions") or "") or None
275
- probs, length = probabilities(text, prompt, labels)
276
- tokens += length
277
- p = dict(zip(keys, probs))
278
- best = max(keys, key=p.get)
279
- if question["type"] == "choice":
280
- answers[name] = {"type": "choice", "choice": best, "confidence": p[best], "probabilities": p}
281
- elif question["type"] == "noul":
282
- answers[name] = {"type": "noul", "noul": p["true"]}
283
- else:
284
- answers[name] = {"type": "score", "score": sum(int(k) * v for k, v in p.items()),
285
- "confidence": p[best], "probabilities": p}
286
- return {"model": MODEL_ID, "answers": answers, "usage": {"input_tokens": tokens, "output_tokens": 0}}
287
- ```
288
-
289
- ```bash
290
- pip install gliclass fastapi uvicorn
291
- uvicorn jev_api:app --host 0.0.0.0 --port 8765
292
- ```
293
-
294
- ```bash
295
- curl -s localhost:8765/v1/systemone -H 'Content-Type: application/json' -d '{
296
- "state": {"ticket": "Checkout errors hit 12% after the 14:05 deploy.",
297
- "facts": ["Rolling back takes two minutes.", "No incident is open yet."]},
298
- "questions": {
299
- "action": {"type": "choice", "instructions": "What should the on-call engineer do right now?",
300
- "criteria": {"rollback": "Roll back to the last healthy build.",
301
- "wait": "Watch error rates for another hour.",
302
- "escalate": "Page the payments team lead."}},
303
- "urgent": {"type": "noul", "instructions": "Does this need action within the next hour?",
304
- "criteria": {"true": "Yes, customers are affected right now.", "false": "No, it can wait."}},
305
- "severity": {"type": "score", "instructions": "Rate the incident severity.",
306
- "criteria": ["minor", "moderate", "major", "critical"]}
307
- }}'
308
- ```
309
-
310
- The response has one answer per question. This one comes from gliclass-v4-edge (rounded):
311
-
312
- ```json
313
- {
314
- "model": "knowledgator/gliclass-v4-edge",
315
- "answers": {
316
- "action": {"type": "choice", "choice": "rollback", "confidence": 0.938, "probabilities": {"rollback": 0.938, "wait": 0.059, "escalate": 0.003}},
317
- "urgent": {"type": "noul", "noul": 0.300},
318
- "severity": {"type": "score", "score": 0.24, "confidence": 0.832, "probabilities": {"0": 0.832, "1": 0.124, "2": 0.013, "3": 0.031}}
319
- },
320
- "usage": {"input_tokens": 172, "output_tokens": 0}
321
- }
322
- ```
323
-
324
- Here the edge model picks the rollback but rates the incident as minor and not urgent; check judgment-style
325
- questions such as severity on your own data before relying on them.
326
-
327
- - **Instructions matter.** Put the decision rule or rubric in `instructions` and give `noul` questions explicit `true` / `false` descriptions; bare yes / no labels are less reliable.
328
- - **Throughput.** The server answers questions one at a time. For batch jobs, group questions that share a state with `pipe.prepare_inputs([text] * n, labels_per_question, same_labels=False, prompt=prompts)` and run one forward pass.
329
- - **Long inputs** over `MAX_LENGTH` tokens are refused with HTTP 422, never truncated, as the Decision Index rules require.
330
- - **Calibration.** For calibrated checkpoints `logits` are the calibrated logits; `uncalibrated_logits` holds the raw ones.
331
- - The Decision Index results below come from a kit engine (`gliclass_engine.GLiClassEngine`) that applies exactly this mapping, run with `python -m decision_index run --engine gliclass_engine:GLiClassEngine --model knowledgator/gliclass-v4-edge`.
332
-
333
- ## Reported evaluation results
334
-
335
- Columns **Edge 0.4B**, **9B**, and **27B** are [gliclass-v4-edge](https://huggingface.co/knowledgator/gliclass-v4-edge),
336
- [gliclass-v4-9b](https://huggingface.co/knowledgator/gliclass-v4-9b), and
337
- [gliclass-v4-27b](https://huggingface.co/knowledgator/gliclass-v4-27b); this card is **Edge 0.4B**.
338
-
339
- ### Decision Index 0.3
340
-
341
- Public part of the [Decision Index](https://github.com/apolinario/decision-index) 0.3 (37 benchmarks in five
342
- areas, 140,178 requests), scored with the kit's own scorers. Skill is chance-corrected (0 = random guessing,
343
- 100 = perfect) and coverage-adjusted (unanswered = wrong); the public index weighs the areas 25.8 / 25.8 / 20.0 /
344
- 18.3 / 10.0%.
345
-
346
- GLiClass models: one pass per question through the Jev-style mapping above, on one RTX PRO 6000
347
- (this model: bf16, `max_length=16384`, batch size 8). Edge 0.4B, 9B, and 27B take a median of 11.0, 34.0, and 73.7 ms per request. Other models: the per-benchmark public results in the kit's board snapshot, with area scores recomputed using the kit's aggregation, which reproduces each published index
348
- exactly. The main board ranking (the Full score) also includes private tests; this table covers the public
349
- part only.
350
-
351
- | Model | Public index (skill) | Raw index | Breadth | Knowledge | Language | Retrieval | Tools | Arts |
352
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
353
- | **Edge 0.4B** | 47.49 | 59.70 | 44.54 | 21.4 | 54.6 | 66.7 | 58.1 | 38.6 |
354
- | **9B** | 55.56 | 66.10 | 53.99 | 36.6 | 61.6 | 61.6 | 74.8 | 41.5 |
355
- | **27B** | 61.74 | 70.76 | 60.66 | 45.7 | 67.6 | 63.0 | 81.0 | 50.3 |
356
- | Torchcast 27B | 65.10 | 73.64 | 63.86 | 46.7 | 72.0 | 67.5 | 84.6 | 54.4 |
357
- | pplx-decider 27B | 62.25 | 71.66 | 61.52 | 52.0 | 67.5 | 61.3 | 78.9 | 47.0 |
358
- | clef | 61.71 | 71.07 | 61.04 | 52.8 | 61.3 | 62.8 | 80.7 | 48.9 |
359
- | GLiDE 28B | 59.06 | 69.61 | 57.96 | 45.8 | 59.7 | 58.4 | 83.6 | 48.2 |
360
- | Jev 1.13 | 57.96 | 68.55 | 57.27 | 53.9 | 59.2 | 55.4 | 75.1 | 39.1 |
361
- | Kev 27B | 56.69 | 67.55 | 55.91 | 45.7 | 62.6 | 55.7 | 72.6 | 42.7 |
362
-
363
- Every benchmark, as skill (★ = gold benchmark, weight 1.2 inside its area):
364
-
365
- <details>
366
- <summary>Per-benchmark Decision Index results</summary>
367
-
368
- #### Knowledge & Reasoning
369
-
370
- | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
371
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
372
- | GPQA Diamond ★ | 10.2 | 25.2 | 26.5 | 35.4 | 41.5 | 31.3 | 36.0 | 71.4 | 29.9 |
373
- | GSM8K | 2.1 | 42.3 | 60.1 | 58.1 | 72.0 | 52.1 | 61.2 | 66.2 | 65.5 |
374
- | ChessBench | 10.7 | 10.4 | 13.7 | 10.8 | 10.3 | 17.8 | 9.9 | 9.8 | 11.0 |
375
- | MuSR | 34.7 | 38.9 | 49.7 | 48.0 | 53.5 | 74.2 | 44.8 | 46.1 | 43.8 |
376
- | SATA-Bench | 24.5 | 26.0 | 34.4 | 13.9 | 27.2 | 32.6 | 28.6 | 25.4 | 26.9 |
377
- | CRUXEval | 0.0 | 28.7 | 57.4 | 66.0 | 77.2 | 78.6 | 57.4 | 57.1 | 63.8 |
378
- | CLadder | 42.2 | 54.4 | 63.8 | 49.0 | 58.6 | 88.2 | 54.9 | 45.3 | 48.3 |
379
- | HLE ★ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 4.7 | 0.0 |
380
- | MMLU-Pro ★ | 20.5 | 46.4 | 57.5 | 66.7 | 67.4 | 61.7 | 66.9 | 80.5 | 63.2 |
381
- | BBH fixed-option tasks ★ | 28.1 | 55.8 | 66.9 | 72.0 | 76.8 | 61.8 | 68.6 | 89.7 | 70.8 |
382
- | WinoGrande ★ | 60.4 | 71.4 | 73.6 | 87.7 | 84.8 | 87.1 | 71.9 | 83.9 | 76.6 |
383
-
384
- #### Language Understanding
385
-
386
- | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
387
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
388
- | ContractNLI | 69.6 | 77.0 | 76.8 | 80.4 | 68.7 | 73.0 | 69.5 | 59.1 | 68.0 |
389
- | ANLI ★ | 42.6 | 52.8 | 62.5 | 68.2 | 61.5 | 55.0 | 60.0 | 62.2 | 56.5 |
390
- | HellaSwag ★ | 77.1 | 89.8 | 93.6 | 96.8 | 91.0 | 97.6 | 93.4 | 92.7 | 92.5 |
391
- | ACOS | 13.3 | 28.2 | 21.3 | 55.9 | 25.9 | 31.0 | 22.1 | 27.3 | 20.8 |
392
- | FinEntity | 86.4 | 83.3 | 92.2 | 90.0 | 93.3 | 94.2 | 88.3 | 80.8 | 91.2 |
393
- | iSarcasmEval | 37.1 | 38.9 | 54.5 | 35.8 | 62.7 | 31.0 | 22.2 | 36.3 | 50.2 |
394
- | VAST | 59.6 | 61.7 | 66.5 | 72.9 | 65.1 | 39.0 | 54.4 | 46.9 | 52.4 |
395
- | NLI4CT | 45.2 | 56.9 | 71.0 | 73.2 | 70.6 | 66.9 | 69.7 | 69.0 | 67.2 |
396
- | RAGTruth response-level hallucination | 58.6 | 62.2 | 65.8 | 71.0 | 65.0 | 57.6 | 51.4 | 51.3 | 59.8 |
397
-
398
- #### Retrieval & Classification
399
-
400
- | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
401
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
402
- | BANKING77 ★ | 90.7 | 80.1 | 80.0 | 91.0 | 80.3 | 94.0 | 79.4 | 79.5 | 85.9 |
403
- | CLINC150+OOS ★ | 92.2 | 85.0 | 88.9 | 93.4 | 91.5 | 97.4 | 87.3 | 89.2 | 86.5 |
404
- | BRIGHT ★ | 22.4 | 31.5 | 33.3 | 44.3 | 44.4 | 40.6 | 43.6 | 40.6 | 41.7 |
405
- | Amazon ESCI | 39.3 | 45.4 | 50.3 | 51.9 | 50.3 | 46.5 | 47.9 | 43.8 | 46.5 |
406
- | PhishNChips phishing decisions | 86.8 | 55.8 | 47.9 | 40.7 | 46.3 | 58.7 | 37.7 | 25.1 | 24.8 |
407
- | HoVer claim verification | 67.6 | 69.2 | 74.8 | 78.8 | 48.2 | 31.2 | 47.7 | 45.7 | 39.7 |
408
-
409
- #### Tools & Automation
410
-
411
- | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
412
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
413
- | BFCL ★ | 87.2 | 94.4 | 96.2 | 96.9 | 96.2 | 97.9 | 97.0 | 94.3 | 97.0 |
414
- | ToolRet | 47.9 | 56.4 | 60.8 | 63.5 | 62.6 | 64.3 | 63.4 | 59.9 | 63.5 |
415
- | API-Bank ★ | 82.5 | 87.8 | 86.8 | 85.0 | 85.2 | 91.8 | 84.8 | 88.0 | 82.7 |
416
- | Home appliance simulator | 12.5 | 58.0 | 77.3 | 89.8 | 80.7 | 80.7 | 92.0 | 52.3 | 63.6 |
417
- | When2Call MCQ | 49.7 | 71.2 | 79.7 | 85.3 | 65.1 | 63.3 | 77.9 | 74.6 | 49.4 |
418
-
419
- #### Arts & Human Taste
420
-
421
- | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
422
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
423
- | BPoMP | 82.4 | 83.2 | 90.9 | 91.1 | 90.5 | 94.1 | 88.0 | 81.8 | 90.6 |
424
- | Humicroedit | 27.6 | 27.0 | 28.8 | 25.2 | 22.3 | 33.1 | 21.7 | 23.7 | 24.9 |
425
- | POP909-CL | 23.1 | 11.6 | 46.0 | 50.0 | 55.5 | 14.8 | 70.0 | 15.9 | 35.2 |
426
- | cfcolor | 12.1 | 25.5 | 30.2 | 43.8 | 28.1 | 34.0 | 30.3 | 28.8 | 28.8 |
427
- | Habermas Machine | 33.8 | 38.6 | 36.6 | 42.3 | 15.8 | 54.5 | 14.5 | 21.5 | 13.7 |
428
- | New Yorker caption matching | 52.6 | 63.1 | 69.7 | 73.7 | 69.5 | 62.8 | 64.5 | 62.6 | 62.8 |
429
-
430
- </details>
431
-
432
- #### Models up to 1B parameters
433
-
434
- Edge 0.4B against the sub-1B entries of the live board (the jev-decision-index Space, data generated 2026-10-15): the
435
- eight highest-scoring ones, plus LiquidAI d1-omni-600M and GLiNER2.5-Decide. Sizes are the board's served
436
- parameters; models over 1B served parameters are excluded even when their name says 0.8B. Board rank is the
437
- position on the public index among the 168 board entries plus Edge 0.4B. Area scores are recomputed from each model's
438
- per-benchmark public results with the kit's aggregation and match every published index.
439
-
440
- | Model | Parameters | Public index (skill) | Board rank | Raw index | Breadth | Knowledge | Language | Retrieval | Tools | Arts | Coverage |
441
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
442
- | **Edge 0.4B** | 435M | 47.49 | 71 / 169 | 59.70 | 44.54 | 21.4 | 54.6 | 66.7 | 58.1 | 38.6 | 100.0% |
443
- | vLLM-SR d3-lite | 853M | 36.93 | 106 / 169 | 52.58 | 34.41 | 18.6 | 34.2 | 53.7 | 56.3 | 22.3 | 100.0% |
444
- | Crivo-150M | 150M | 36.39 | 107 / 169 | 52.45 | 31.50 | 11.8 | 41.8 | 52.2 | 60.7 | 10.1 | 100.0% |
445
- | Sieve 0.8B | 590M | 32.26 | 114 / 169 | 49.40 | 28.90 | 14.3 | 26.6 | 54.8 | 51.2 | 13.5 | 100.0% |
446
- | tasksource nano v4 | 149M | 30.90 | 115 / 169 | 47.86 | 26.81 | 7.8 | 37.7 | 49.4 | 43.6 | 12.8 | 100.0% |
447
- | Saina Helm 2.0 | 853M | 30.47 | 119 / 169 | 48.35 | 25.67 | 8.7 | 31.6 | 43.8 | 58.3 | 6.3 | 100.0% |
448
- | jiwo 0.8B v2 | 752M | 29.58 | 123 / 169 | 47.20 | 26.75 | 10.9 | 36.1 | 44.2 | 40.3 | 12.2 | 100.0% |
449
- | DecisionTune 1.0 | 395M | 28.85 | 125 / 169 | 46.84 | 25.43 | 11.7 | 29.9 | 45.0 | 46.5 | 5.7 | 100.0% |
450
- | vLLM-SR d3-edge | 594M | 28.82 | 126 / 169 | 46.79 | 25.44 | 11.1 | 24.1 | 53.6 | 42.7 | 11.8 | 100.0% |
451
- | d1-omni-600M | 587M | 17.90 | 146 / 169 | 37.58 | 16.11 | 6.5 | 19.3 | 35.0 | 19.5 | 6.5 | 100.0% |
452
- | GLiNER2.5-Decide | 486M | 11.48 | 155 / 169 | 33.08 | 10.13 | 2.3 | 8.3 | 25.3 | 14.8 | 9.8 | 100.0% |
453
-
454
- <details>
455
- <summary>Per-benchmark Decision Index results, models up to 1B</summary>
456
-
457
- #### Knowledge & Reasoning (models up to 1B)
458
-
459
- | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
460
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
461
- | GPQA Diamond ★ | 10.2 | 10.9 | 0.0 | **15.0** | 0.0 | 3.4 | 1.4 | 0.0 | 4.1 | 0.0 | 0.0 |
462
- | GSM8K | 2.1 | **29.9** | 2.0 | 24.0 | 7.5 | 13.5 | 7.1 | 2.0 | 21.6 | 1.1 | 0.2 |
463
- | ChessBench | **10.7** | 0.2 | 0.0 | 1.1 | 1.6 | 9.6 | 0.0 | 0.0 | 0.0 | 5.2 | 0.0 |
464
- | MuSR | **34.7** | 33.0 | 26.7 | 29.2 | 32.4 | 18.0 | 31.5 | 20.5 | 20.3 | 1.5 | 12.9 |
465
- | SATA-Bench | **24.5** | 18.6 | 0.0 | 13.0 | 8.4 | 14.7 | 21.0 | 1.7 | 10.2 | 6.2 | 0.0 |
466
- | CRUXEval | 0.0 | 0.0 | 7.3 | 0.0 | 8.1 | 0.0 | 0.0 | 5.9 | **9.8** | 6.2 | 5.1 |
467
- | CLadder | 42.2 | 22.1 | **61.0** | 6.5 | 0.6 | 3.2 | 2.9 | 44.8 | 8.1 | 0.0 | 0.2 |
468
- | HLE ★ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | **0.4** | 0.0 | **0.4** |
469
- | MMLU-Pro ★ | 20.5 | **24.0** | 3.4 | 17.8 | 5.7 | 9.8 | 20.2 | 1.7 | 13.5 | 10.1 | 5.6 |
470
- | BBH fixed-option tasks ★ | **28.1** | 22.5 | 11.6 | 20.4 | 6.8 | 16.2 | 24.4 | 9.4 | 10.6 | 17.7 | 0.2 |
471
- | WinoGrande ★ | **60.4** | 41.8 | 21.9 | 28.5 | 16.8 | 8.3 | 10.7 | 43.8 | 23.6 | 20.9 | 1.3 |
472
-
473
- #### Language Understanding (models up to 1B)
474
-
475
- | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
476
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
477
- | ContractNLI | 69.6 | 33.8 | 74.7 | 62.6 | 63.7 | **78.2** | 69.0 | 72.2 | 37.1 | 51.1 | 0.0 |
478
- | ANLI ★ | **42.6** | 24.1 | 19.0 | 15.0 | 18.7 | 4.7 | 20.8 | 0.0 | 11.3 | 4.1 | 0.0 |
479
- | HellaSwag ★ | 77.1 | 76.9 | 48.9 | 67.5 | 52.4 | 25.9 | 65.8 | **78.5** | 45.3 | 46.6 | 9.7 |
480
- | ACOS | 13.3 | 3.5 | **38.9** | 7.2 | 30.9 | 5.0 | 6.9 | 3.3 | 4.8 | 0.0 | 0.0 |
481
- | FinEntity | **86.4** | 82.5 | 76.7 | 48.9 | 62.5 | 63.5 | 72.9 | 77.7 | 71.3 | 45.5 | 50.2 |
482
- | iSarcasmEval | **37.1** | 13.7 | 0.0 | 0.0 | 0.0 | 21.0 | 4.6 | 0.0 | 12.2 | 6.7 | 13.0 |
483
- | VAST | 59.6 | 33.1 | **61.4** | 5.7 | 59.9 | 15.5 | 13.5 | 4.0 | 17.9 | 8.2 | 2.9 |
484
- | NLI4CT | **45.2** | 34.0 | 15.1 | 26.6 | 17.0 | 21.8 | 27.6 | 0.8 | 15.8 | 9.0 | 0.0 |
485
- | RAGTruth response-level hallucination | **58.6** | 0.0 | 44.3 | 0.0 | 35.5 | 55.7 | 41.1 | 28.9 | 0.0 | 0.0 | 0.0 |
486
-
487
- #### Retrieval & Classification (models up to 1B)
488
-
489
- | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
490
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
491
- | BANKING77 ★ | 90.7 | 90.2 | 90.6 | 85.5 | 88.8 | 84.4 | 60.2 | **92.1** | 89.8 | 83.5 | 65.2 |
492
- | CLINC150+OOS ★ | 92.2 | **93.9** | 91.8 | 90.5 | 86.6 | 75.9 | 81.5 | 91.8 | 91.9 | 85.2 | 60.2 |
493
- | BRIGHT ★ | 22.4 | 28.4 | 18.6 | 18.0 | 18.3 | 5.1 | **30.7** | 7.8 | 22.1 | 0.0 | 9.6 |
494
- | Amazon ESCI | **39.3** | 26.4 | 29.8 | 26.3 | 22.6 | 32.1 | 36.5 | 37.3 | 11.6 | 8.8 | 3.8 |
495
- | PhishNChips phishing decisions | **86.8** | 9.7 | 4.0 | 85.3 | 2.9 | 0.0 | 31.2 | 0.2 | 35.7 | 0.0 | 0.0 |
496
- | HoVer claim verification | 67.6 | 63.5 | **69.4** | 17.1 | 67.9 | 58.3 | 17.2 | 29.6 | 62.1 | 19.6 | 1.4 |
497
-
498
- #### Tools & Automation (models up to 1B)
499
-
500
- | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
501
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
502
- | BFCL ★ | **87.2** | 81.1 | 79.0 | 78.8 | 65.0 | 83.9 | 78.2 | 73.6 | 62.9 | 29.3 | 27.4 |
503
- | ToolRet | 47.9 | 55.5 | **55.7** | 55.6 | 55.1 | 53.2 | 55.0 | 49.7 | 50.4 | 2.6 | 28.6 |
504
- | API-Bank ★ | **82.5** | 56.1 | 29.4 | 54.0 | 25.6 | 74.7 | 17.5 | 45.2 | 39.0 | 38.8 | 5.9 |
505
- | Home appliance simulator | 12.5 | 11.4 | **79.5** | 0.0 | 0.0 | 0.0 | 8.0 | 0.0 | 0.0 | 0.0 | 0.0 |
506
- | When2Call MCQ | 49.7 | **72.8** | 62.5 | 61.6 | 71.4 | 71.2 | 39.5 | 58.7 | 57.8 | 21.0 | 11.2 |
507
-
508
- #### Arts & Human Taste (models up to 1B)
509
-
510
- | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
511
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
512
- | BPoMP | **82.4** | 43.2 | 0.0 | 12.1 | 18.9 | 0.0 | 0.7 | 18.4 | 8.9 | 0.0 | 14.0 |
513
- | Humicroedit | **27.6** | 14.7 | 4.5 | 16.6 | 0.0 | 5.6 | 7.1 | 0.0 | 6.7 | 2.3 | 1.3 |
514
- | POP909-CL | **23.1** | 0.9 | 1.2 | 0.6 | 0.8 | 0.0 | 0.0 | 0.6 | 0.4 | 0.1 | 0.9 |
515
- | cfcolor | 12.1 | 12.8 | 0.6 | 13.5 | 4.0 | 15.2 | **24.1** | 0.0 | 5.0 | 9.3 | 6.4 |
516
- | Habermas Machine | **33.8** | 9.9 | 10.1 | 14.4 | 3.3 | 0.0 | 10.4 | 8.9 | 4.3 | 7.5 | 20.8 |
517
- | New Yorker caption matching | **52.6** | 51.9 | 44.1 | 24.0 | 50.0 | 16.9 | 31.1 | 6.2 | 45.8 | 20.0 | 15.2 |
518
-
519
- </details>
520
-
521
- ### KGJevBench
522
-
523
- Decision tasks from the GLiClass benchmark suite (KGJevBench): policy decisions, instruction following,
524
- knowledge-graph walking, tool calling and routing, judging, and typed Jev-style decisions. GLiClass models were run
525
- with the suite's `run_sample_500.sh` (up to 500 examples per task, bf16); the 12-relations row uses
526
- `eval_kg_reasoning.py --mode stepwise --pad-relations 12`. The other columns are the KGJevBench comparison results for
527
- those models on the same tasks and metrics; they were not re-run here. All values ×100; the best value in each row is bold.
528
- Averages are recomputed from the cells shown, so the reference columns can differ by up to 0.3 from averages computed
529
- on unrounded scores.
530
-
531
- | Benchmark (metric) | **Edge 0.4B** | **9B** | **27B** | pplx-decider-27b | glide | Jev-1.1B | clef | d1 | clef-flash | gpt-6-luna | Kev-4B | DeBERTa |
532
- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
533
- | fast-decisions (domain avg) | 54.8 | 53.7 | 54.3 | 59.5 | 61.7 | 61.2 | 59.4 | **61.8** | 57.3 | 60.2 | 58.5 | 56.7 |
534
- | task routing (top-1 primary) | **93.3** | 88.3 | 88.3 | 82.0 | 73.0 | 74.0 | 85.0 | 75.0 | 77.3 | 53.7 | 65.7 | 68.7 |
535
- | tool calling (exact set) | **89.3** | 88.3 | 89.0 | 88.0 | 79.0 | 65.3 | 83.0 | 72.3 | 78.3 | 46.7 | 59.0 | 88.3 |
536
- | instruction following (group acc) | 86.5 | 85.6 | 87.4 | 92.8 | 94.6 | 93.7 | **95.5** | 93.7 | 91.9 | 92.8 | 82.9 | 42.3 |
537
- | KG step-by-step (path acc) | 98.3 | 97.7 | 96.3 | **98.7** | 91.0 | 95.7 | 92.7 | 97.0 | 91.0 | 90.7 | 86.7 | 67.0 |
538
- | KG step-by-step, 12 relations/step | 93.0 | 94.7 | 93.3 | **95.3** | 82.0 | 85.7 | 87.7 | 87.0 | 85.3 | 79.7 | 73.7 | 51.7 |
539
- | KG path ranking (Hits@1) | 98.7 | 98.7 | **100.0** | 95.0 | 94.0 | 87.7 | 87.0 | 81.3 | 56.0 | 92.0 | 67.7 | 50.0 |
540
- | triple relevance (F1, keyword) | **90.6** | 84.7 | 83.2 | 31.8 | 33.0 | 30.7 | 28.4 | 28.4 | 21.9 | 21.2 | 47.3 | 69.5 |
541
- | reranking (R@1) | 92.7 | 95.7 | 94.3 | 96.7 | 96.0 | 96.7 | 94.7 | 95.7 | 96.7 | **97.0** | 93.3 | 81.7 |
542
- | NLI (accuracy, yes/no) | 89.2 | 96.9 | **100.0** | 90.7 | 96.0 | 98.8 | 92.0 | 94.1 | 92.6 | 89.5 | 93.2 | 85.5 |
543
- | fact checking (acc, checkable) | 87.0 | 94.3 | 98.0 | **99.3** | 93.5 | 98.0 | 92.7 | 97.3 | 94.7 | 97.7 | 83.3 | 86.3 |
544
- | moderation rules (acc, yes/no) | 85.6 | 81.2 | 92.4 | 93.3 | **94.0** | 92.3 | 89.0 | 82.0 | 85.7 | 85.0 | 77.3 | 78.3 |
545
- | policy decisions (acc) | 64.0 | 94.0 | 96.3 | **97.3** | 97.0 | 96.7 | 95.7 | 95.3 | 84.0 | 89.7 | 81.3 | 72.0 |
546
- | logical reasoning MCQA (acc; chance 25) | 43.7 | 70.0 | 75.7 | **90.0** | 83.0 | 81.3 | 76.0 | 79.3 | 71.3 | 65.0 | 63.0 | 38.0 |
547
- | web actions (step acc) | 51.0 | 82.0 | **85.0** | 79.0 | 73.0 | 72.0 | 78.0 | 71.0 | 60.0 | 55.0 | 59.0 | 47.0 |
548
- | LogiQA (acc; chance 25) | 42.4 | 59.0 | 65.6 | 72.0 | 65.0 | **77.1** | 63.9 | 69.4 | 60.2 | 61.1 | 50.8 | 31.5 |
549
- | MedMCQA (acc; chance 25) | 34.8 | 60.2 | 67.2 | **74.6** | 67.0 | 74.5 | 69.1 | 72.5 | 66.5 | 72.3 | 54.0 | 28.0 |
550
- | OpenBookQA closed (acc; chance 25) | 75.6 | 88.2 | 89.6 | **97.0** | 93.0 | 95.2 | 95.6 | 95.0 | 93.6 | 84.8 | 82.0 | 47.0 |
551
- | CommonsenseQA (acc; chance 20) | 78.6 | 81.6 | 86.2 | 88.1 | 88.0 | 89.0 | 90.3 | 86.3 | **93.6** | 81.5 | 76.9 | 58.9 |
552
- | JevBench public (acc) | 77.9 | 82.3 | 87.4 | 88.7 | 91.0 | 85.7 | 88.7 | 86.6 | 82.3 | **91.8** | 72.3 | 65.8 |
553
- | JevBench HF gold questions (acc) | 86.8 | 86.0 | 92.4 | **92.5** | 88.0 | 91.3 | 92.4 | 90.6 | 89.3 | 91.0 | 89.6 | 88.4 |
554
- | JevJudge text (skill ×100) | -0.1 | 17.5 | 32.2 | 43.9 | **52.4** | 42.2 | 37.8 | 38.5 | 23.5 | 40.1 | 24.5 | 11.2 |
555
- | Open-Jev (agreement) | 59.6 | 75.1 | 82.4 | **89.6** | 85.9 | 78.3 | 78.3 | 81.0 | 74.1 | 78.1 | 71.2 | 57.8 |
556
- | tasksource-Jev (agreement) | 78.4 | 78.6 | 78.8 | **83.9** | 75.0 | 73.6 | 73.3 | 75.0 | 68.9 | 66.9 | 65.1 | 53.8 |
557
- | Jev Distill (agreement w/ teacher) | 51.5 | 54.8 | 61.0 | 63.7 | 57.9 | **72.7** | 62.0 | 65.1 | 62.3 | 67.0 | 57.4 | 42.7 |
558
- | Behavior (present-class F1) | 37.6 | 56.7 | 68.3 | 68.9 | **87.5** | 67.0 | 66.0 | 67.4 | 52.6 | 57.4 | 46.3 | 27.7 |
559
- | typed decisions (acc) | 49.3 | 64.2 | 68.5 | 73.9 | 71.8 | 74.1 | 71.4 | **74.2** | 70.2 | 69.3 | — | 51.6 |
560
- | agent tool decisions (macro acc) | 57.1 | 78.5 | **87.6** | 85.4 | 81.8 | 82.9 | 73.9 | 83.4 | 64.1 | 75.2 | — | 40.3 |
561
- | *Average, 26 rows all models have* | 70.8 | 78.7 | 82.5 | 82.8 | 80.4 | 79.9 | 79.0 | 78.4 | 73.5 | 73.4 | 68.5 | 57.5 |
562
- | *Average, all 28 rows* | 69.5 | 78.2 | 82.2 | 82.6 | 80.2 | 79.8 | 78.6 | 78.4 | 73.0 | 73.3 | — | 56.7 |
563
-
564
- Several KGJevBench sets are written in the formats GLiClass is trained on (for example triple relevance, task
565
- routing, and tool calling), and tasksource-Jev overlaps the training data; read those rows with that in mind.
566
-
567
- ## Training and intended use
568
-
569
- Training had three stages:
570
-
571
- 1. **Large-scale supervised training** on a mixture that recasts classification, NLI, QA, reranking,
572
- extraction, tool calling, moderation, judging, and reasoning data as decisions over candidate labels,
573
- with instructions, label descriptions where available. Single-label, multi-label, and scoring examples are mixed
574
- in one run with a focal loss.
575
- 2. **Reinforcement learning** with a PPO-style objective whose actions are the label decisions. Rewards
576
- are task metrics (F1, accuracy, recall), with a value baseline, a clipped ratio, and optional KL and entropy terms.
577
- 3. **Calibration**: with the backbone frozen, a small calibrator reads the text and label representations and logit statistics and predicts a per-pair temperature and bias, fitted by negative log-likelihood on held-out decision data.
578
-
579
- Use this model for zero-shot and instruction-following classification, scoring, reranking, natural language
580
- inference, knowledge graph and multi-step reasoning, guardrails, policy moderation, routing, and LLM-output
581
- judging. It returns label probabilities and does not generate text.
582
 
583
  ## Limitations
584
 
585
- - Label wording, instructions, domain, input length, and thresholds affect predictions.
586
- - Knowledge-heavy and multi-step reasoning tasks are the main gap to the larger models: multi-step arithmetic (GSM8K), hard science and exam questions (GPQA, HLE, MMLU-Pro, MedMCQA), logic puzzles, and long agent-trace judging remain weak spots.
587
- - Results are strongest in English; quality on other languages is lower.
588
- - Calibrated scores are fitted on held-out data and can drift on domains far from training.
589
- - Treat outputs used for safety, moderation, legal, or medical decisions as signals for review, not final verdicts.
590
 
591
- ## Citation
592
 
593
- ```bibtex
594
- @misc{stepanov2026scxrouter,
595
- title = {SCX Router: Streaming Zero-Shot Model Selection with a Decoder-KV Classifier and a Real-World Task Ontology},
596
- author = {Stepanov, Ihor and Smechov, Aleksandr and Shtopko, Mykhailo and Vodianytskyi, Dmytro and Lukashov, Oleksandr},
597
- year = {2026},
598
- eprint = {2609.02292},
599
- archivePrefix = {arXiv}
600
- }
601
- ```
 
1
  ---
2
  language:
3
  - en
4
+ license: apache-2.0
5
  library_name: gliclass
6
  pipeline_tag: zero-shot-classification
7
+ base_model: knowledgator/gliclass-v4-edge
8
+ model_name: Apex-flash
9
  tags:
10
+ - apex
11
  - gliclass
12
+ - gliclass-v4
13
  - zero-shot-classification
14
  - text-classification
15
  - multi-label-classification
16
  - instruction-following
17
  - reranking
 
 
 
 
 
18
  ---
19
+ # Apex-flash
20
 
21
+ **GLiClass 4 based decision model from the SCX Apex family.**
22
 
23
+ A compact 0.4B text decision model for classification, routing, scoring, and high-volume applications on CPU or GPU. Supply the input, candidate labels, and an optional instruction to receive label scores without generating text.
 
 
 
 
24
 
25
+ This release republishes [Knowledgator's gliclass-v4-edge](https://huggingface.co/knowledgator/gliclass-v4-edge) under the Apex name. The weights, configuration, tokenizer, and other inference assets are unchanged; SCX has simplified the model card and added the license and upstream documentation. No additional fine-tuning is claimed.
26
 
27
+ | Property | Value |
28
+ | --- | --- |
29
+ | Parameters | Approximately 0.4B |
30
+ | Inputs | Text |
31
+ | Backbone | [microsoft/deberta-v3-large](https://huggingface.co/microsoft/deberta-v3-large) |
32
+ | Framework | [GLiClass](https://github.com/Knowledgator/GLiClass) |
33
+ | License | Apache 2.0 |
34
 
35
+ ## Quick start
 
 
36
 
37
+ Use Python 3.10+ and an up-to-date GLiClass installation:
38
 
39
  ```bash
40
+ pip install -U gliclass
 
 
41
  ```
42
 
43
+ The example runs on a CUDA GPU when available and otherwise uses the CPU.
44
 
45
  ```python
46
  import torch
47
  from gliclass import GLiClassModel, ZeroShotClassificationPipeline
48
 
49
+ model_id = "scx-admin/Apex-flash"
50
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
 
51
  model = GLiClassModel.from_pretrained(model_id)
52
  pipeline = ZeroShotClassificationPipeline(
53
  model,
54
+ model_id,
55
  classification_type="multi-label",
56
  max_length=2048,
57
  device=device,
58
  )
 
 
 
 
 
59
 
 
60
  results = pipeline(
61
+ "My parcel has not arrived. Please check the delivery status.",
62
+ ["delivery issue", "refund request", "technical support"],
63
  threshold=0.5,
64
  )[0]
65
  for result in results:
66
+ print(result["label"], result["score"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ```
68
 
69
+ Pass `prompt="your instruction or policy"` to guide the decision. Use `classification_type="single-label"` for mutually exclusive choices. Multi-label results may contain more than one label or no labels above the threshold.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
  ## Limitations
72
 
73
+ Predictions depend on label wording, instructions, domain, input length, and thresholds. English is the primary language. Calibration can drift on new domains; evaluate scores and thresholds on representative data. See the [upstream model card](https://huggingface.co/knowledgator/gliclass-v4-edge) for training details, evaluations, and further limitations.
 
 
 
 
74
 
75
+ ## Attribution and license
76
 
77
+ Based on **GLiClass 4**, developed by **Knowledgator**. Original checkpoint: [knowledgator/gliclass-v4-edge](https://huggingface.co/knowledgator/gliclass-v4-edge/tree/90be5550327b138635db1f63531f9dfa15e624da), revision `90be5550327b138635db1f63531f9dfa15e624da`. Distributed under the upstream **Apache License 2.0**; see [LICENSE](LICENSE). The original model card is preserved in [UPSTREAM_README.md](UPSTREAM_README.md) and at the upstream link.
78
+
79
+ Related work: [GLiClass](https://arxiv.org/abs/2508.07662) and [SCX Router](https://arxiv.org/abs/2609.02292).
 
 
 
 
 
 
UPSTREAM_README.md ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: gliclass
5
+ pipeline_tag: zero-shot-classification
6
+ tags:
7
+ - gliclass
8
+ - deberta
9
+ - zero-shot-classification
10
+ - text-classification
11
+ - multi-label-classification
12
+ - instruction-following
13
+ - reranking
14
+ - guardrails
15
+ - content-moderation
16
+ - knowledge-graph-reasoning
17
+ license: apache-2.0
18
+ base_model: microsoft/deberta-v3-large
19
+ ---
20
+ # GLiClass v4 Edge
21
+
22
+ **Instruction-following zero-shot classification in a 0.4B encoder, built for CPUs and edge devices.**
23
+
24
+ `knowledgator/gliclass-v4-edge` is the 0.4B-parameter edge release of
25
+ [GLiClass v4](https://github.com/Knowledgator/GLiClass). The labels you pass and an
26
+ optional instruction tell it what to decide at inference time. It returns a score for
27
+ every label in one forward pass and generates no text. It reaches a Decision Index public skill of 47.5 at a median
28
+ latency of 11 ms per decision, ahead of every model up to 1B parameters on the public board (the best of them scores 36.9).
29
+
30
+
31
+ ## Usage
32
+
33
+ ```bash
34
+ pip install gliclass -U
35
+ ```
36
+
37
+ Or install from source in a Python 3.10+ environment:
38
+
39
+ ```bash
40
+ git clone https://github.com/Knowledgator/GLiClass.git
41
+ cd GLiClass
42
+ pip install -e .
43
+ ```
44
+
45
+ The following examples reuse `pipeline`:
46
+
47
+ ```python
48
+ import torch
49
+ from gliclass import GLiClassModel, ZeroShotClassificationPipeline
50
+
51
+ model_id = "knowledgator/gliclass-v4-edge"
52
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
53
+
54
+ model = GLiClassModel.from_pretrained(model_id)
55
+ pipeline = ZeroShotClassificationPipeline(
56
+ model,
57
+ model_id, # loads the tokenizer
58
+ classification_type="multi-label",
59
+ max_length=2048,
60
+ device=device,
61
+ )
62
+ ```
63
+
64
+ For a local copy, replace the model ID with the checkpoint directory.
65
+
66
+ ### Multi-label classification
67
+
68
+ ```python
69
+ results = pipeline(
70
+ "The battery lasts two days, but the screen scratches easily.",
71
+ ["battery", "display", "durability", "price", "shipping"],
72
+ threshold=0.5,
73
+ )[0]
74
+ for result in results:
75
+ print(result["label"], round(result["score"], 3))
76
+ ```
77
+
78
+ Each prediction contains `label` and `score`. Pass a list of texts and `batch_size=8` for batched inference.
79
+
80
+ Scores are calibrated on held-out data; predictions also carry `initial_score`, the uncalibrated score.
81
+
82
+ ### Single-label decisions and scoring
83
+
84
+ Use `classification_type="single-label"` to pick one answer: scores are a softmax over the labels.
85
+ To score an input, use the levels of a scale as labels and read their probabilities:
86
+
87
+ ```python
88
+ answer = pipeline(
89
+ "Our refund window is 30 days. The customer bought the item 45 days ago.",
90
+ ["refund approved", "refund denied", "escalate to a human"],
91
+ prompt="Apply the refund policy to the customer's request.",
92
+ classification_type="single-label",
93
+ )[0]
94
+ print(answer)
95
+
96
+ quality = pipeline(
97
+ "Q: What causes tides? A: Mostly the Moon's gravity, with a smaller effect from the Sun.",
98
+ ["1 - wrong", "2 - poor", "3 - partly correct", "4 - good", "5 - excellent"],
99
+ prompt="Rate the factual quality of the answer.",
100
+ classification_type="single-label",
101
+ return_hierarchical=True,
102
+ )[0]
103
+ print(quality) # every level with its probability
104
+ ```
105
+
106
+ ### Instruction following
107
+
108
+ Use `prompt` for the instruction, policy, or rubric. Labels are interpreted in light of it:
109
+
110
+ ```python
111
+ policy = (
112
+ "Flag a message only if it shares another person's contact details without consent. "
113
+ "Public business contact pages are allowed."
114
+ )
115
+ results = pipeline(
116
+ [
117
+ "You can reach our support team at help@acme.com.",
118
+ "Here is my neighbour's personal phone number: 555-0134, call her at night.",
119
+ ],
120
+ ["violates policy", "complies with policy"],
121
+ prompt=policy,
122
+ classification_type="single-label",
123
+ )
124
+ ```
125
+
126
+ Few-shot examples (`examples=[{"text": ..., "labels": [...]}]`) and hierarchical labels
127
+ (`{"sentiment": ["positive", "negative"], "topic": ["product", "service"]}`) are also supported.
128
+
129
+ ### Knowledge graph reasoning
130
+
131
+ Pass the graph as text next to the story, the question as the instruction, and the answers as labels:
132
+
133
+ ```python
134
+ graph = (
135
+ "Alice -member_of-> Finance team\n"
136
+ "Finance team -can_read-> Reports folder\n"
137
+ "Reports folder -contains-> Salaries.xlsx\n"
138
+ "Alice -explicit_deny-> Salaries.xlsx\n"
139
+ "Rule: explicit restrictions override team permissions."
140
+ )
141
+ answer = pipeline(
142
+ graph,
143
+ ["yes", "no"],
144
+ prompt="Can Alice open Salaries.xlsx?",
145
+ classification_type="single-label",
146
+ )[0]
147
+ print(answer) # [{'label': 'no', 'score': ...}]
148
+ ```
149
+
150
+ The same pattern covers multi-hop questions, agent and web-browsing steps (which link, tool, or action
151
+ comes next), and NLI (`entailment`, `neutral`, `contradiction`).
152
+
153
+ ### Reranking
154
+
155
+ ```python
156
+ query = "How do I reset a forgotten router password?"
157
+ passages = [
158
+ "Hold the reset button for 10 seconds to restore factory settings, then log in with the default password.",
159
+ "Our routers support Wi-Fi 7 and dual-band operation.",
160
+ "To change your Wi-Fi name, open the admin panel and edit the SSID field.",
161
+ ]
162
+ scores = pipeline(
163
+ passages,
164
+ [query],
165
+ prompt="Does the passage answer the query?",
166
+ threshold=0.0,
167
+ )
168
+ ranked = sorted(zip(passages, scores), key=lambda p: -p[1][0]["score"])
169
+ ```
170
+
171
+ ## Serving a Jev-style decision API
172
+
173
+ Decision engines such as Jev take a **state** (text or JSON) and a set of typed **questions**, and return a
174
+ probability for every option of every question, with no generated text. GLiClass answers the same requests
175
+ directly: each question is one GLiClass pass in which the state is the text, the question's `instructions`
176
+ are the prompt, and every option is a label. This is the setup used for the Decision Index results below.
177
+
178
+ | Question type | Request fields | GLiClass labels | Answer |
179
+ | --- | --- | --- | --- |
180
+ | `choice` | `instructions`, `criteria: {key: description}` | the option descriptions (the key when a description is missing) | `choice`, `confidence`, `probabilities` per key |
181
+ | `noul` (yes / no) | `instructions`, optional `criteria: {"true": ..., "false": ...}` | the true and false descriptions (`yes` / `no` when missing) | `noul` = P(true) |
182
+ | `score` | `instructions`, `criteria: [level 0, level 1, ...]` | the level descriptions, in order | `score` = expected level, `confidence`, `probabilities` per level |
183
+
184
+ Probabilities are a softmax over the option logits. A JSON state is rendered as `key: value` lines, with string lists as `- item` lines.
185
+
186
+ The server below exposes `POST /v1/systemone` and `GET /v1/models`, the request and response shape of
187
+ TypeSafe's System One API, so clients written for it (for example the
188
+ [WorkflowEvals](https://github.com/typesafe-ai/WorkflowEvals) runner) can point at a local GLiClass model.
189
+ It needs only `gliclass`, `fastapi`, and `uvicorn`:
190
+
191
+ ```python
192
+ # jev_api.py
193
+ import json
194
+ import os
195
+
196
+ import torch
197
+ from fastapi import FastAPI, HTTPException
198
+ from pydantic import BaseModel
199
+
200
+ from gliclass import GLiClassModel, ZeroShotClassificationPipeline
201
+
202
+ MODEL_ID = os.environ.get("MODEL", "knowledgator/gliclass-v4-edge")
203
+ MAX_LENGTH = int(os.environ.get("MAX_LENGTH", "16384"))
204
+ DEVICE = "cuda:0" if torch.cuda.is_available() else "cpu"
205
+ DTYPE = torch.bfloat16 if DEVICE != "cpu" else torch.float32
206
+
207
+ model = GLiClassModel.from_pretrained(MODEL_ID, torch_dtype=DTYPE).to(DEVICE).eval()
208
+ pipe = ZeroShotClassificationPipeline(model, MODEL_ID, max_length=10**9, classification_type="single-label",
209
+ device=DEVICE, progress_bar=False).pipe
210
+ app = FastAPI(title="GLiClass System One API")
211
+
212
+
213
+ class Request(BaseModel):
214
+ state: str | dict | list | None = None
215
+ questions: dict[str, dict]
216
+
217
+
218
+ def as_text(value):
219
+ return value if isinstance(value, str) else json.dumps(value, ensure_ascii=False)
220
+
221
+
222
+ def render_state(state):
223
+ if state in (None, "", {}, []):
224
+ return ""
225
+ if isinstance(state, str):
226
+ return state
227
+ if isinstance(state, list):
228
+ return "\n".join(f"- {as_text(item)}" for item in state)
229
+ lines = []
230
+ for key, value in state.items():
231
+ if isinstance(value, list) and all(isinstance(item, str) for item in value):
232
+ lines += [f"{key}:"] + [f"- {item}" for item in value]
233
+ else:
234
+ lines.append(f"{key}: {as_text(value)}")
235
+ return "\n".join(lines)
236
+
237
+
238
+ def options(question):
239
+ kind, criteria = question.get("type"), question.get("criteria")
240
+ if kind == "choice":
241
+ if not criteria or len(criteria) < 2:
242
+ raise HTTPException(422, "a choice question needs at least two criteria")
243
+ return list(criteria), [as_text(v) if v is not None else k for k, v in criteria.items()]
244
+ if kind == "noul":
245
+ c = criteria or {}
246
+ return ["true", "false"], [as_text(c.get("true") or "yes"), as_text(c.get("false") or "no")]
247
+ if kind == "score":
248
+ if not criteria or len(criteria) < 2:
249
+ raise HTTPException(422, "a score question needs at least two levels")
250
+ return [str(i) for i in range(len(criteria))], [as_text(c) for c in criteria]
251
+ raise HTTPException(422, f"unsupported question type {kind!r}")
252
+
253
+
254
+ @torch.no_grad()
255
+ def probabilities(text, prompt, labels):
256
+ inputs = pipe.prepare_inputs([text], labels, same_labels=True, prompt=prompt)
257
+ length = inputs["input_ids"].shape[-1]
258
+ if length > MAX_LENGTH: # refuse instead of truncating
259
+ raise HTTPException(422, f"input of {length} tokens exceeds the {MAX_LENGTH}-token limit")
260
+ logits = model(**inputs, max_num_classes=len(labels)).logits[0, : len(labels)].float()
261
+ return torch.softmax(logits, dim=-1).tolist(), length
262
+
263
+
264
+ @app.get("/v1/models")
265
+ def models():
266
+ return {"models": [{"name": MODEL_ID, "description": "GLiClass"}]}
267
+
268
+
269
+ @app.post("/v1/systemone")
270
+ def systemone(request: Request):
271
+ text, answers, tokens = render_state(request.state), {}, 0
272
+ for name, question in request.questions.items():
273
+ keys, labels = options(question)
274
+ prompt = as_text(question.get("instructions") or "") or None
275
+ probs, length = probabilities(text, prompt, labels)
276
+ tokens += length
277
+ p = dict(zip(keys, probs))
278
+ best = max(keys, key=p.get)
279
+ if question["type"] == "choice":
280
+ answers[name] = {"type": "choice", "choice": best, "confidence": p[best], "probabilities": p}
281
+ elif question["type"] == "noul":
282
+ answers[name] = {"type": "noul", "noul": p["true"]}
283
+ else:
284
+ answers[name] = {"type": "score", "score": sum(int(k) * v for k, v in p.items()),
285
+ "confidence": p[best], "probabilities": p}
286
+ return {"model": MODEL_ID, "answers": answers, "usage": {"input_tokens": tokens, "output_tokens": 0}}
287
+ ```
288
+
289
+ ```bash
290
+ pip install gliclass fastapi uvicorn
291
+ uvicorn jev_api:app --host 0.0.0.0 --port 8765
292
+ ```
293
+
294
+ ```bash
295
+ curl -s localhost:8765/v1/systemone -H 'Content-Type: application/json' -d '{
296
+ "state": {"ticket": "Checkout errors hit 12% after the 14:05 deploy.",
297
+ "facts": ["Rolling back takes two minutes.", "No incident is open yet."]},
298
+ "questions": {
299
+ "action": {"type": "choice", "instructions": "What should the on-call engineer do right now?",
300
+ "criteria": {"rollback": "Roll back to the last healthy build.",
301
+ "wait": "Watch error rates for another hour.",
302
+ "escalate": "Page the payments team lead."}},
303
+ "urgent": {"type": "noul", "instructions": "Does this need action within the next hour?",
304
+ "criteria": {"true": "Yes, customers are affected right now.", "false": "No, it can wait."}},
305
+ "severity": {"type": "score", "instructions": "Rate the incident severity.",
306
+ "criteria": ["minor", "moderate", "major", "critical"]}
307
+ }}'
308
+ ```
309
+
310
+ The response has one answer per question. This one comes from gliclass-v4-edge (rounded):
311
+
312
+ ```json
313
+ {
314
+ "model": "knowledgator/gliclass-v4-edge",
315
+ "answers": {
316
+ "action": {"type": "choice", "choice": "rollback", "confidence": 0.938, "probabilities": {"rollback": 0.938, "wait": 0.059, "escalate": 0.003}},
317
+ "urgent": {"type": "noul", "noul": 0.300},
318
+ "severity": {"type": "score", "score": 0.24, "confidence": 0.832, "probabilities": {"0": 0.832, "1": 0.124, "2": 0.013, "3": 0.031}}
319
+ },
320
+ "usage": {"input_tokens": 172, "output_tokens": 0}
321
+ }
322
+ ```
323
+
324
+ Here the edge model picks the rollback but rates the incident as minor and not urgent; check judgment-style
325
+ questions such as severity on your own data before relying on them.
326
+
327
+ - **Instructions matter.** Put the decision rule or rubric in `instructions` and give `noul` questions explicit `true` / `false` descriptions; bare yes / no labels are less reliable.
328
+ - **Throughput.** The server answers questions one at a time. For batch jobs, group questions that share a state with `pipe.prepare_inputs([text] * n, labels_per_question, same_labels=False, prompt=prompts)` and run one forward pass.
329
+ - **Long inputs** over `MAX_LENGTH` tokens are refused with HTTP 422, never truncated, as the Decision Index rules require.
330
+ - **Calibration.** For calibrated checkpoints `logits` are the calibrated logits; `uncalibrated_logits` holds the raw ones.
331
+ - The Decision Index results below come from a kit engine (`gliclass_engine.GLiClassEngine`) that applies exactly this mapping, run with `python -m decision_index run --engine gliclass_engine:GLiClassEngine --model knowledgator/gliclass-v4-edge`.
332
+
333
+ ## Reported evaluation results
334
+
335
+ Columns **Edge 0.4B**, **9B**, and **27B** are [gliclass-v4-edge](https://huggingface.co/knowledgator/gliclass-v4-edge),
336
+ [gliclass-v4-9b](https://huggingface.co/knowledgator/gliclass-v4-9b), and
337
+ [gliclass-v4-27b](https://huggingface.co/knowledgator/gliclass-v4-27b); this card is **Edge 0.4B**.
338
+
339
+ ### Decision Index 0.3
340
+
341
+ Public part of the [Decision Index](https://github.com/apolinario/decision-index) 0.3 (37 benchmarks in five
342
+ areas, 140,178 requests), scored with the kit's own scorers. Skill is chance-corrected (0 = random guessing,
343
+ 100 = perfect) and coverage-adjusted (unanswered = wrong); the public index weighs the areas 25.8 / 25.8 / 20.0 /
344
+ 18.3 / 10.0%.
345
+
346
+ GLiClass models: one pass per question through the Jev-style mapping above, on one RTX PRO 6000
347
+ (this model: bf16, `max_length=16384`, batch size 8). Edge 0.4B, 9B, and 27B take a median of 11.0, 34.0, and 73.7 ms per request. Other models: the per-benchmark public results in the kit's board snapshot, with area scores recomputed using the kit's aggregation, which reproduces each published index
348
+ exactly. The main board ranking (the Full score) also includes private tests; this table covers the public
349
+ part only.
350
+
351
+ | Model | Public index (skill) | Raw index | Breadth | Knowledge | Language | Retrieval | Tools | Arts |
352
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
353
+ | **Edge 0.4B** | 47.49 | 59.70 | 44.54 | 21.4 | 54.6 | 66.7 | 58.1 | 38.6 |
354
+ | **9B** | 55.56 | 66.10 | 53.99 | 36.6 | 61.6 | 61.6 | 74.8 | 41.5 |
355
+ | **27B** | 61.74 | 70.76 | 60.66 | 45.7 | 67.6 | 63.0 | 81.0 | 50.3 |
356
+ | Torchcast 27B | 65.10 | 73.64 | 63.86 | 46.7 | 72.0 | 67.5 | 84.6 | 54.4 |
357
+ | pplx-decider 27B | 62.25 | 71.66 | 61.52 | 52.0 | 67.5 | 61.3 | 78.9 | 47.0 |
358
+ | clef | 61.71 | 71.07 | 61.04 | 52.8 | 61.3 | 62.8 | 80.7 | 48.9 |
359
+ | GLiDE 28B | 59.06 | 69.61 | 57.96 | 45.8 | 59.7 | 58.4 | 83.6 | 48.2 |
360
+ | Jev 1.13 | 57.96 | 68.55 | 57.27 | 53.9 | 59.2 | 55.4 | 75.1 | 39.1 |
361
+ | Kev 27B | 56.69 | 67.55 | 55.91 | 45.7 | 62.6 | 55.7 | 72.6 | 42.7 |
362
+
363
+ Every benchmark, as skill (★ = gold benchmark, weight 1.2 inside its area):
364
+
365
+ <details>
366
+ <summary>Per-benchmark Decision Index results</summary>
367
+
368
+ #### Knowledge & Reasoning
369
+
370
+ | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
371
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
372
+ | GPQA Diamond ★ | 10.2 | 25.2 | 26.5 | 35.4 | 41.5 | 31.3 | 36.0 | 71.4 | 29.9 |
373
+ | GSM8K | 2.1 | 42.3 | 60.1 | 58.1 | 72.0 | 52.1 | 61.2 | 66.2 | 65.5 |
374
+ | ChessBench | 10.7 | 10.4 | 13.7 | 10.8 | 10.3 | 17.8 | 9.9 | 9.8 | 11.0 |
375
+ | MuSR | 34.7 | 38.9 | 49.7 | 48.0 | 53.5 | 74.2 | 44.8 | 46.1 | 43.8 |
376
+ | SATA-Bench | 24.5 | 26.0 | 34.4 | 13.9 | 27.2 | 32.6 | 28.6 | 25.4 | 26.9 |
377
+ | CRUXEval | 0.0 | 28.7 | 57.4 | 66.0 | 77.2 | 78.6 | 57.4 | 57.1 | 63.8 |
378
+ | CLadder | 42.2 | 54.4 | 63.8 | 49.0 | 58.6 | 88.2 | 54.9 | 45.3 | 48.3 |
379
+ | HLE ★ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 4.7 | 0.0 |
380
+ | MMLU-Pro ★ | 20.5 | 46.4 | 57.5 | 66.7 | 67.4 | 61.7 | 66.9 | 80.5 | 63.2 |
381
+ | BBH fixed-option tasks ★ | 28.1 | 55.8 | 66.9 | 72.0 | 76.8 | 61.8 | 68.6 | 89.7 | 70.8 |
382
+ | WinoGrande ★ | 60.4 | 71.4 | 73.6 | 87.7 | 84.8 | 87.1 | 71.9 | 83.9 | 76.6 |
383
+
384
+ #### Language Understanding
385
+
386
+ | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
387
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
388
+ | ContractNLI | 69.6 | 77.0 | 76.8 | 80.4 | 68.7 | 73.0 | 69.5 | 59.1 | 68.0 |
389
+ | ANLI ★ | 42.6 | 52.8 | 62.5 | 68.2 | 61.5 | 55.0 | 60.0 | 62.2 | 56.5 |
390
+ | HellaSwag ★ | 77.1 | 89.8 | 93.6 | 96.8 | 91.0 | 97.6 | 93.4 | 92.7 | 92.5 |
391
+ | ACOS | 13.3 | 28.2 | 21.3 | 55.9 | 25.9 | 31.0 | 22.1 | 27.3 | 20.8 |
392
+ | FinEntity | 86.4 | 83.3 | 92.2 | 90.0 | 93.3 | 94.2 | 88.3 | 80.8 | 91.2 |
393
+ | iSarcasmEval | 37.1 | 38.9 | 54.5 | 35.8 | 62.7 | 31.0 | 22.2 | 36.3 | 50.2 |
394
+ | VAST | 59.6 | 61.7 | 66.5 | 72.9 | 65.1 | 39.0 | 54.4 | 46.9 | 52.4 |
395
+ | NLI4CT | 45.2 | 56.9 | 71.0 | 73.2 | 70.6 | 66.9 | 69.7 | 69.0 | 67.2 |
396
+ | RAGTruth response-level hallucination | 58.6 | 62.2 | 65.8 | 71.0 | 65.0 | 57.6 | 51.4 | 51.3 | 59.8 |
397
+
398
+ #### Retrieval & Classification
399
+
400
+ | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
401
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
402
+ | BANKING77 ★ | 90.7 | 80.1 | 80.0 | 91.0 | 80.3 | 94.0 | 79.4 | 79.5 | 85.9 |
403
+ | CLINC150+OOS ★ | 92.2 | 85.0 | 88.9 | 93.4 | 91.5 | 97.4 | 87.3 | 89.2 | 86.5 |
404
+ | BRIGHT ★ | 22.4 | 31.5 | 33.3 | 44.3 | 44.4 | 40.6 | 43.6 | 40.6 | 41.7 |
405
+ | Amazon ESCI | 39.3 | 45.4 | 50.3 | 51.9 | 50.3 | 46.5 | 47.9 | 43.8 | 46.5 |
406
+ | PhishNChips phishing decisions | 86.8 | 55.8 | 47.9 | 40.7 | 46.3 | 58.7 | 37.7 | 25.1 | 24.8 |
407
+ | HoVer claim verification | 67.6 | 69.2 | 74.8 | 78.8 | 48.2 | 31.2 | 47.7 | 45.7 | 39.7 |
408
+
409
+ #### Tools & Automation
410
+
411
+ | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
412
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
413
+ | BFCL ★ | 87.2 | 94.4 | 96.2 | 96.9 | 96.2 | 97.9 | 97.0 | 94.3 | 97.0 |
414
+ | ToolRet | 47.9 | 56.4 | 60.8 | 63.5 | 62.6 | 64.3 | 63.4 | 59.9 | 63.5 |
415
+ | API-Bank ★ | 82.5 | 87.8 | 86.8 | 85.0 | 85.2 | 91.8 | 84.8 | 88.0 | 82.7 |
416
+ | Home appliance simulator | 12.5 | 58.0 | 77.3 | 89.8 | 80.7 | 80.7 | 92.0 | 52.3 | 63.6 |
417
+ | When2Call MCQ | 49.7 | 71.2 | 79.7 | 85.3 | 65.1 | 63.3 | 77.9 | 74.6 | 49.4 |
418
+
419
+ #### Arts & Human Taste
420
+
421
+ | Benchmark | **Edge 0.4B** | **9B** | **27B** | Torchcast 27B | pplx-decider 27B | clef | GLiDE 28B | Jev 1.13 | Kev 27B |
422
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
423
+ | BPoMP | 82.4 | 83.2 | 90.9 | 91.1 | 90.5 | 94.1 | 88.0 | 81.8 | 90.6 |
424
+ | Humicroedit | 27.6 | 27.0 | 28.8 | 25.2 | 22.3 | 33.1 | 21.7 | 23.7 | 24.9 |
425
+ | POP909-CL | 23.1 | 11.6 | 46.0 | 50.0 | 55.5 | 14.8 | 70.0 | 15.9 | 35.2 |
426
+ | cfcolor | 12.1 | 25.5 | 30.2 | 43.8 | 28.1 | 34.0 | 30.3 | 28.8 | 28.8 |
427
+ | Habermas Machine | 33.8 | 38.6 | 36.6 | 42.3 | 15.8 | 54.5 | 14.5 | 21.5 | 13.7 |
428
+ | New Yorker caption matching | 52.6 | 63.1 | 69.7 | 73.7 | 69.5 | 62.8 | 64.5 | 62.6 | 62.8 |
429
+
430
+ </details>
431
+
432
+ #### Models up to 1B parameters
433
+
434
+ Edge 0.4B against the sub-1B entries of the live board (the jev-decision-index Space, data generated 2026-10-15): the
435
+ eight highest-scoring ones, plus LiquidAI d1-omni-600M and GLiNER2.5-Decide. Sizes are the board's served
436
+ parameters; models over 1B served parameters are excluded even when their name says 0.8B. Board rank is the
437
+ position on the public index among the 168 board entries plus Edge 0.4B. Area scores are recomputed from each model's
438
+ per-benchmark public results with the kit's aggregation and match every published index.
439
+
440
+ | Model | Parameters | Public index (skill) | Board rank | Raw index | Breadth | Knowledge | Language | Retrieval | Tools | Arts | Coverage |
441
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
442
+ | **Edge 0.4B** | 435M | 47.49 | 71 / 169 | 59.70 | 44.54 | 21.4 | 54.6 | 66.7 | 58.1 | 38.6 | 100.0% |
443
+ | vLLM-SR d3-lite | 853M | 36.93 | 106 / 169 | 52.58 | 34.41 | 18.6 | 34.2 | 53.7 | 56.3 | 22.3 | 100.0% |
444
+ | Crivo-150M | 150M | 36.39 | 107 / 169 | 52.45 | 31.50 | 11.8 | 41.8 | 52.2 | 60.7 | 10.1 | 100.0% |
445
+ | Sieve 0.8B | 590M | 32.26 | 114 / 169 | 49.40 | 28.90 | 14.3 | 26.6 | 54.8 | 51.2 | 13.5 | 100.0% |
446
+ | tasksource nano v4 | 149M | 30.90 | 115 / 169 | 47.86 | 26.81 | 7.8 | 37.7 | 49.4 | 43.6 | 12.8 | 100.0% |
447
+ | Saina Helm 2.0 | 853M | 30.47 | 119 / 169 | 48.35 | 25.67 | 8.7 | 31.6 | 43.8 | 58.3 | 6.3 | 100.0% |
448
+ | jiwo 0.8B v2 | 752M | 29.58 | 123 / 169 | 47.20 | 26.75 | 10.9 | 36.1 | 44.2 | 40.3 | 12.2 | 100.0% |
449
+ | DecisionTune 1.0 | 395M | 28.85 | 125 / 169 | 46.84 | 25.43 | 11.7 | 29.9 | 45.0 | 46.5 | 5.7 | 100.0% |
450
+ | vLLM-SR d3-edge | 594M | 28.82 | 126 / 169 | 46.79 | 25.44 | 11.1 | 24.1 | 53.6 | 42.7 | 11.8 | 100.0% |
451
+ | d1-omni-600M | 587M | 17.90 | 146 / 169 | 37.58 | 16.11 | 6.5 | 19.3 | 35.0 | 19.5 | 6.5 | 100.0% |
452
+ | GLiNER2.5-Decide | 486M | 11.48 | 155 / 169 | 33.08 | 10.13 | 2.3 | 8.3 | 25.3 | 14.8 | 9.8 | 100.0% |
453
+
454
+ <details>
455
+ <summary>Per-benchmark Decision Index results, models up to 1B</summary>
456
+
457
+ #### Knowledge & Reasoning (models up to 1B)
458
+
459
+ | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
460
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
461
+ | GPQA Diamond ★ | 10.2 | 10.9 | 0.0 | **15.0** | 0.0 | 3.4 | 1.4 | 0.0 | 4.1 | 0.0 | 0.0 |
462
+ | GSM8K | 2.1 | **29.9** | 2.0 | 24.0 | 7.5 | 13.5 | 7.1 | 2.0 | 21.6 | 1.1 | 0.2 |
463
+ | ChessBench | **10.7** | 0.2 | 0.0 | 1.1 | 1.6 | 9.6 | 0.0 | 0.0 | 0.0 | 5.2 | 0.0 |
464
+ | MuSR | **34.7** | 33.0 | 26.7 | 29.2 | 32.4 | 18.0 | 31.5 | 20.5 | 20.3 | 1.5 | 12.9 |
465
+ | SATA-Bench | **24.5** | 18.6 | 0.0 | 13.0 | 8.4 | 14.7 | 21.0 | 1.7 | 10.2 | 6.2 | 0.0 |
466
+ | CRUXEval | 0.0 | 0.0 | 7.3 | 0.0 | 8.1 | 0.0 | 0.0 | 5.9 | **9.8** | 6.2 | 5.1 |
467
+ | CLadder | 42.2 | 22.1 | **61.0** | 6.5 | 0.6 | 3.2 | 2.9 | 44.8 | 8.1 | 0.0 | 0.2 |
468
+ | HLE ★ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | **0.4** | 0.0 | **0.4** |
469
+ | MMLU-Pro ★ | 20.5 | **24.0** | 3.4 | 17.8 | 5.7 | 9.8 | 20.2 | 1.7 | 13.5 | 10.1 | 5.6 |
470
+ | BBH fixed-option tasks ★ | **28.1** | 22.5 | 11.6 | 20.4 | 6.8 | 16.2 | 24.4 | 9.4 | 10.6 | 17.7 | 0.2 |
471
+ | WinoGrande ★ | **60.4** | 41.8 | 21.9 | 28.5 | 16.8 | 8.3 | 10.7 | 43.8 | 23.6 | 20.9 | 1.3 |
472
+
473
+ #### Language Understanding (models up to 1B)
474
+
475
+ | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
476
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
477
+ | ContractNLI | 69.6 | 33.8 | 74.7 | 62.6 | 63.7 | **78.2** | 69.0 | 72.2 | 37.1 | 51.1 | 0.0 |
478
+ | ANLI ★ | **42.6** | 24.1 | 19.0 | 15.0 | 18.7 | 4.7 | 20.8 | 0.0 | 11.3 | 4.1 | 0.0 |
479
+ | HellaSwag ★ | 77.1 | 76.9 | 48.9 | 67.5 | 52.4 | 25.9 | 65.8 | **78.5** | 45.3 | 46.6 | 9.7 |
480
+ | ACOS | 13.3 | 3.5 | **38.9** | 7.2 | 30.9 | 5.0 | 6.9 | 3.3 | 4.8 | 0.0 | 0.0 |
481
+ | FinEntity | **86.4** | 82.5 | 76.7 | 48.9 | 62.5 | 63.5 | 72.9 | 77.7 | 71.3 | 45.5 | 50.2 |
482
+ | iSarcasmEval | **37.1** | 13.7 | 0.0 | 0.0 | 0.0 | 21.0 | 4.6 | 0.0 | 12.2 | 6.7 | 13.0 |
483
+ | VAST | 59.6 | 33.1 | **61.4** | 5.7 | 59.9 | 15.5 | 13.5 | 4.0 | 17.9 | 8.2 | 2.9 |
484
+ | NLI4CT | **45.2** | 34.0 | 15.1 | 26.6 | 17.0 | 21.8 | 27.6 | 0.8 | 15.8 | 9.0 | 0.0 |
485
+ | RAGTruth response-level hallucination | **58.6** | 0.0 | 44.3 | 0.0 | 35.5 | 55.7 | 41.1 | 28.9 | 0.0 | 0.0 | 0.0 |
486
+
487
+ #### Retrieval & Classification (models up to 1B)
488
+
489
+ | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
490
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
491
+ | BANKING77 ★ | 90.7 | 90.2 | 90.6 | 85.5 | 88.8 | 84.4 | 60.2 | **92.1** | 89.8 | 83.5 | 65.2 |
492
+ | CLINC150+OOS ★ | 92.2 | **93.9** | 91.8 | 90.5 | 86.6 | 75.9 | 81.5 | 91.8 | 91.9 | 85.2 | 60.2 |
493
+ | BRIGHT ★ | 22.4 | 28.4 | 18.6 | 18.0 | 18.3 | 5.1 | **30.7** | 7.8 | 22.1 | 0.0 | 9.6 |
494
+ | Amazon ESCI | **39.3** | 26.4 | 29.8 | 26.3 | 22.6 | 32.1 | 36.5 | 37.3 | 11.6 | 8.8 | 3.8 |
495
+ | PhishNChips phishing decisions | **86.8** | 9.7 | 4.0 | 85.3 | 2.9 | 0.0 | 31.2 | 0.2 | 35.7 | 0.0 | 0.0 |
496
+ | HoVer claim verification | 67.6 | 63.5 | **69.4** | 17.1 | 67.9 | 58.3 | 17.2 | 29.6 | 62.1 | 19.6 | 1.4 |
497
+
498
+ #### Tools & Automation (models up to 1B)
499
+
500
+ | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
501
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
502
+ | BFCL ★ | **87.2** | 81.1 | 79.0 | 78.8 | 65.0 | 83.9 | 78.2 | 73.6 | 62.9 | 29.3 | 27.4 |
503
+ | ToolRet | 47.9 | 55.5 | **55.7** | 55.6 | 55.1 | 53.2 | 55.0 | 49.7 | 50.4 | 2.6 | 28.6 |
504
+ | API-Bank ★ | **82.5** | 56.1 | 29.4 | 54.0 | 25.6 | 74.7 | 17.5 | 45.2 | 39.0 | 38.8 | 5.9 |
505
+ | Home appliance simulator | 12.5 | 11.4 | **79.5** | 0.0 | 0.0 | 0.0 | 8.0 | 0.0 | 0.0 | 0.0 | 0.0 |
506
+ | When2Call MCQ | 49.7 | **72.8** | 62.5 | 61.6 | 71.4 | 71.2 | 39.5 | 58.7 | 57.8 | 21.0 | 11.2 |
507
+
508
+ #### Arts & Human Taste (models up to 1B)
509
+
510
+ | Benchmark | **Edge 0.4B** | vLLM-SR d3-lite | Crivo-150M | Sieve 0.8B | tasksource nano v4 | Saina Helm 2.0 | jiwo 0.8B v2 | DecisionTune 1.0 | vLLM-SR d3-edge | d1-omni-600M | GLiNER2.5-Decide |
511
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
512
+ | BPoMP | **82.4** | 43.2 | 0.0 | 12.1 | 18.9 | 0.0 | 0.7 | 18.4 | 8.9 | 0.0 | 14.0 |
513
+ | Humicroedit | **27.6** | 14.7 | 4.5 | 16.6 | 0.0 | 5.6 | 7.1 | 0.0 | 6.7 | 2.3 | 1.3 |
514
+ | POP909-CL | **23.1** | 0.9 | 1.2 | 0.6 | 0.8 | 0.0 | 0.0 | 0.6 | 0.4 | 0.1 | 0.9 |
515
+ | cfcolor | 12.1 | 12.8 | 0.6 | 13.5 | 4.0 | 15.2 | **24.1** | 0.0 | 5.0 | 9.3 | 6.4 |
516
+ | Habermas Machine | **33.8** | 9.9 | 10.1 | 14.4 | 3.3 | 0.0 | 10.4 | 8.9 | 4.3 | 7.5 | 20.8 |
517
+ | New Yorker caption matching | **52.6** | 51.9 | 44.1 | 24.0 | 50.0 | 16.9 | 31.1 | 6.2 | 45.8 | 20.0 | 15.2 |
518
+
519
+ </details>
520
+
521
+ ### KGJevBench
522
+
523
+ Decision tasks from the GLiClass benchmark suite (KGJevBench): policy decisions, instruction following,
524
+ knowledge-graph walking, tool calling and routing, judging, and typed Jev-style decisions. GLiClass models were run
525
+ with the suite's `run_sample_500.sh` (up to 500 examples per task, bf16); the 12-relations row uses
526
+ `eval_kg_reasoning.py --mode stepwise --pad-relations 12`. The other columns are the KGJevBench comparison results for
527
+ those models on the same tasks and metrics; they were not re-run here. All values ×100; the best value in each row is bold.
528
+ Averages are recomputed from the cells shown, so the reference columns can differ by up to 0.3 from averages computed
529
+ on unrounded scores.
530
+
531
+ | Benchmark (metric) | **Edge 0.4B** | **9B** | **27B** | pplx-decider-27b | glide | Jev-1.1B | clef | d1 | clef-flash | gpt-6-luna | Kev-4B | DeBERTa |
532
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
533
+ | fast-decisions (domain avg) | 54.8 | 53.7 | 54.3 | 59.5 | 61.7 | 61.2 | 59.4 | **61.8** | 57.3 | 60.2 | 58.5 | 56.7 |
534
+ | task routing (top-1 primary) | **93.3** | 88.3 | 88.3 | 82.0 | 73.0 | 74.0 | 85.0 | 75.0 | 77.3 | 53.7 | 65.7 | 68.7 |
535
+ | tool calling (exact set) | **89.3** | 88.3 | 89.0 | 88.0 | 79.0 | 65.3 | 83.0 | 72.3 | 78.3 | 46.7 | 59.0 | 88.3 |
536
+ | instruction following (group acc) | 86.5 | 85.6 | 87.4 | 92.8 | 94.6 | 93.7 | **95.5** | 93.7 | 91.9 | 92.8 | 82.9 | 42.3 |
537
+ | KG step-by-step (path acc) | 98.3 | 97.7 | 96.3 | **98.7** | 91.0 | 95.7 | 92.7 | 97.0 | 91.0 | 90.7 | 86.7 | 67.0 |
538
+ | KG step-by-step, 12 relations/step | 93.0 | 94.7 | 93.3 | **95.3** | 82.0 | 85.7 | 87.7 | 87.0 | 85.3 | 79.7 | 73.7 | 51.7 |
539
+ | KG path ranking (Hits@1) | 98.7 | 98.7 | **100.0** | 95.0 | 94.0 | 87.7 | 87.0 | 81.3 | 56.0 | 92.0 | 67.7 | 50.0 |
540
+ | triple relevance (F1, keyword) | **90.6** | 84.7 | 83.2 | 31.8 | 33.0 | 30.7 | 28.4 | 28.4 | 21.9 | 21.2 | 47.3 | 69.5 |
541
+ | reranking (R@1) | 92.7 | 95.7 | 94.3 | 96.7 | 96.0 | 96.7 | 94.7 | 95.7 | 96.7 | **97.0** | 93.3 | 81.7 |
542
+ | NLI (accuracy, yes/no) | 89.2 | 96.9 | **100.0** | 90.7 | 96.0 | 98.8 | 92.0 | 94.1 | 92.6 | 89.5 | 93.2 | 85.5 |
543
+ | fact checking (acc, checkable) | 87.0 | 94.3 | 98.0 | **99.3** | 93.5 | 98.0 | 92.7 | 97.3 | 94.7 | 97.7 | 83.3 | 86.3 |
544
+ | moderation rules (acc, yes/no) | 85.6 | 81.2 | 92.4 | 93.3 | **94.0** | 92.3 | 89.0 | 82.0 | 85.7 | 85.0 | 77.3 | 78.3 |
545
+ | policy decisions (acc) | 64.0 | 94.0 | 96.3 | **97.3** | 97.0 | 96.7 | 95.7 | 95.3 | 84.0 | 89.7 | 81.3 | 72.0 |
546
+ | logical reasoning MCQA (acc; chance 25) | 43.7 | 70.0 | 75.7 | **90.0** | 83.0 | 81.3 | 76.0 | 79.3 | 71.3 | 65.0 | 63.0 | 38.0 |
547
+ | web actions (step acc) | 51.0 | 82.0 | **85.0** | 79.0 | 73.0 | 72.0 | 78.0 | 71.0 | 60.0 | 55.0 | 59.0 | 47.0 |
548
+ | LogiQA (acc; chance 25) | 42.4 | 59.0 | 65.6 | 72.0 | 65.0 | **77.1** | 63.9 | 69.4 | 60.2 | 61.1 | 50.8 | 31.5 |
549
+ | MedMCQA (acc; chance 25) | 34.8 | 60.2 | 67.2 | **74.6** | 67.0 | 74.5 | 69.1 | 72.5 | 66.5 | 72.3 | 54.0 | 28.0 |
550
+ | OpenBookQA closed (acc; chance 25) | 75.6 | 88.2 | 89.6 | **97.0** | 93.0 | 95.2 | 95.6 | 95.0 | 93.6 | 84.8 | 82.0 | 47.0 |
551
+ | CommonsenseQA (acc; chance 20) | 78.6 | 81.6 | 86.2 | 88.1 | 88.0 | 89.0 | 90.3 | 86.3 | **93.6** | 81.5 | 76.9 | 58.9 |
552
+ | JevBench public (acc) | 77.9 | 82.3 | 87.4 | 88.7 | 91.0 | 85.7 | 88.7 | 86.6 | 82.3 | **91.8** | 72.3 | 65.8 |
553
+ | JevBench HF gold questions (acc) | 86.8 | 86.0 | 92.4 | **92.5** | 88.0 | 91.3 | 92.4 | 90.6 | 89.3 | 91.0 | 89.6 | 88.4 |
554
+ | JevJudge text (skill ×100) | -0.1 | 17.5 | 32.2 | 43.9 | **52.4** | 42.2 | 37.8 | 38.5 | 23.5 | 40.1 | 24.5 | 11.2 |
555
+ | Open-Jev (agreement) | 59.6 | 75.1 | 82.4 | **89.6** | 85.9 | 78.3 | 78.3 | 81.0 | 74.1 | 78.1 | 71.2 | 57.8 |
556
+ | tasksource-Jev (agreement) | 78.4 | 78.6 | 78.8 | **83.9** | 75.0 | 73.6 | 73.3 | 75.0 | 68.9 | 66.9 | 65.1 | 53.8 |
557
+ | Jev Distill (agreement w/ teacher) | 51.5 | 54.8 | 61.0 | 63.7 | 57.9 | **72.7** | 62.0 | 65.1 | 62.3 | 67.0 | 57.4 | 42.7 |
558
+ | Behavior (present-class F1) | 37.6 | 56.7 | 68.3 | 68.9 | **87.5** | 67.0 | 66.0 | 67.4 | 52.6 | 57.4 | 46.3 | 27.7 |
559
+ | typed decisions (acc) | 49.3 | 64.2 | 68.5 | 73.9 | 71.8 | 74.1 | 71.4 | **74.2** | 70.2 | 69.3 | — | 51.6 |
560
+ | agent tool decisions (macro acc) | 57.1 | 78.5 | **87.6** | 85.4 | 81.8 | 82.9 | 73.9 | 83.4 | 64.1 | 75.2 | — | 40.3 |
561
+ | *Average, 26 rows all models have* | 70.8 | 78.7 | 82.5 | 82.8 | 80.4 | 79.9 | 79.0 | 78.4 | 73.5 | 73.4 | 68.5 | 57.5 |
562
+ | *Average, all 28 rows* | 69.5 | 78.2 | 82.2 | 82.6 | 80.2 | 79.8 | 78.6 | 78.4 | 73.0 | 73.3 | — | 56.7 |
563
+
564
+ Several KGJevBench sets are written in the formats GLiClass is trained on (for example triple relevance, task
565
+ routing, and tool calling), and tasksource-Jev overlaps the training data; read those rows with that in mind.
566
+
567
+ ## Training and intended use
568
+
569
+ Training had three stages:
570
+
571
+ 1. **Large-scale supervised training** on a mixture that recasts classification, NLI, QA, reranking,
572
+ extraction, tool calling, moderation, judging, and reasoning data as decisions over candidate labels,
573
+ with instructions, label descriptions where available. Single-label, multi-label, and scoring examples are mixed
574
+ in one run with a focal loss.
575
+ 2. **Reinforcement learning** with a PPO-style objective whose actions are the label decisions. Rewards
576
+ are task metrics (F1, accuracy, recall), with a value baseline, a clipped ratio, and optional KL and entropy terms.
577
+ 3. **Calibration**: with the backbone frozen, a small calibrator reads the text and label representations and logit statistics and predicts a per-pair temperature and bias, fitted by negative log-likelihood on held-out decision data.
578
+
579
+ Use this model for zero-shot and instruction-following classification, scoring, reranking, natural language
580
+ inference, knowledge graph and multi-step reasoning, guardrails, policy moderation, routing, and LLM-output
581
+ judging. It returns label probabilities and does not generate text.
582
+
583
+ ## Limitations
584
+
585
+ - Label wording, instructions, domain, input length, and thresholds affect predictions.
586
+ - Knowledge-heavy and multi-step reasoning tasks are the main gap to the larger models: multi-step arithmetic (GSM8K), hard science and exam questions (GPQA, HLE, MMLU-Pro, MedMCQA), logic puzzles, and long agent-trace judging remain weak spots.
587
+ - Results are strongest in English; quality on other languages is lower.
588
+ - Calibrated scores are fitted on held-out data and can drift on domains far from training.
589
+ - Treat outputs used for safety, moderation, legal, or medical decisions as signals for review, not final verdicts.
590
+
591
+ ## Citation
592
+
593
+ ```bibtex
594
+ @misc{stepanov2026scxrouter,
595
+ title = {SCX Router: Streaming Zero-Shot Model Selection with a Decoder-KV Classifier and a Real-World Task Ontology},
596
+ author = {Stepanov, Ihor and Smechov, Aleksandr and Shtopko, Mykhailo and Vodianytskyi, Dmytro and Lukashov, Oleksandr},
597
+ year = {2026},
598
+ eprint = {2609.02292},
599
+ archivePrefix = {arXiv}
600
+ }
601
+ ```