qev 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. qev-0.2.0/.gitignore +41 -0
  2. qev-0.2.0/CHANGELOG.md +32 -0
  3. qev-0.2.0/LICENSE +201 -0
  4. qev-0.2.0/MODEL_CARD.md +314 -0
  5. qev-0.2.0/NOTICE +71 -0
  6. qev-0.2.0/PKG-INFO +271 -0
  7. qev-0.2.0/README.md +236 -0
  8. qev-0.2.0/SUPPORT.md +13 -0
  9. qev-0.2.0/docs/API.md +69 -0
  10. qev-0.2.0/docs/ARCHITECTURE.md +35 -0
  11. qev-0.2.0/docs/MODEL_SIZE.md +46 -0
  12. qev-0.2.0/docs/PLAYGROUND.md +90 -0
  13. qev-0.2.0/examples/request.json +10 -0
  14. qev-0.2.0/pyproject.toml +79 -0
  15. qev-0.2.0/src/qev/__init__.py +28 -0
  16. qev-0.2.0/src/qev/__main__.py +5 -0
  17. qev-0.2.0/src/qev/cli.py +130 -0
  18. qev-0.2.0/src/qev/community.py +10 -0
  19. qev-0.2.0/src/qev/download.py +118 -0
  20. qev-0.2.0/src/qev/playground/__init__.py +1 -0
  21. qev-0.2.0/src/qev/playground/app.py +243 -0
  22. qev-0.2.0/src/qev/playground/engine.py +121 -0
  23. qev-0.2.0/src/qev/playground/presets.json +270 -0
  24. qev-0.2.0/src/qev/playground/samples/LICENSE.txt +21 -0
  25. qev-0.2.0/src/qev/playground/samples/README.md +21 -0
  26. qev-0.2.0/src/qev/playground/samples/provenance.json +75 -0
  27. qev-0.2.0/src/qev/playground/samples/sample-01.jpg +0 -0
  28. qev-0.2.0/src/qev/playground/samples/sample-02.jpg +0 -0
  29. qev-0.2.0/src/qev/playground/samples/sample-03.jpg +0 -0
  30. qev-0.2.0/src/qev/playground/samples/sample-04.jpg +0 -0
  31. qev-0.2.0/src/qev/playground/samples/sample-05.jpg +0 -0
  32. qev-0.2.0/src/qev/playground/samples/sample-06.jpg +0 -0
  33. qev-0.2.0/src/qev/runtime.py +69 -0
  34. qev-0.2.0/src/veyra/__init__.py +3 -0
  35. qev-0.2.0/src/veyra/augment_data.py +133 -0
  36. qev-0.2.0/src/veyra/average_adapters.py +54 -0
  37. qev-0.2.0/src/veyra/backbone.py +167 -0
  38. qev-0.2.0/src/veyra/benchmark.py +136 -0
  39. qev-0.2.0/src/veyra/binding_head.py +32 -0
  40. qev-0.2.0/src/veyra/build_data.py +383 -0
  41. qev-0.2.0/src/veyra/calibrate.py +130 -0
  42. qev-0.2.0/src/veyra/candidates.py +60 -0
  43. qev-0.2.0/src/veyra/checkpoint.py +82 -0
  44. qev-0.2.0/src/veyra/cli.py +171 -0
  45. qev-0.2.0/src/veyra/constants.py +5 -0
  46. qev-0.2.0/src/veyra/data.py +110 -0
  47. qev-0.2.0/src/veyra/decision_metrics.py +126 -0
  48. qev-0.2.0/src/veyra/evaluate.py +108 -0
  49. qev-0.2.0/src/veyra/evidence_data.py +228 -0
  50. qev-0.2.0/src/veyra/features.py +195 -0
  51. qev-0.2.0/src/veyra/head.py +99 -0
  52. qev-0.2.0/src/veyra/interventions.py +169 -0
  53. qev-0.2.0/src/veyra/model.py +84 -0
  54. qev-0.2.0/src/veyra/option_model.py +432 -0
  55. qev-0.2.0/src/veyra/packing.py +100 -0
  56. qev-0.2.0/src/veyra/policy_data.py +255 -0
  57. qev-0.2.0/src/veyra/policy_refresh.py +181 -0
  58. qev-0.2.0/src/veyra/probability.py +72 -0
  59. qev-0.2.0/src/veyra/proper_learning.py +100 -0
  60. qev-0.2.0/src/veyra/reasoning_workspace.py +32 -0
  61. qev-0.2.0/src/veyra/release_gate.py +146 -0
  62. qev-0.2.0/src/veyra/replay.py +90 -0
  63. qev-0.2.0/src/veyra/schema.py +86 -0
  64. qev-0.2.0/src/veyra/server.py +57 -0
  65. qev-0.2.0/src/veyra/synthetic_audit.py +66 -0
  66. qev-0.2.0/src/veyra/training.py +191 -0
  67. qev-0.2.0/src/veyra/transfer_learning.py +84 -0
  68. qev-0.2.0/src/veyra/workflow_consistency.py +107 -0
  69. qev-0.2.0/src/veyra/workflow_facts.py +54 -0
  70. qev-0.2.0/src/veyra/workflow_learning.py +108 -0
  71. qev-0.2.0/src/veyra/workflow_release_gate.py +85 -0
qev-0.2.0/.gitignore ADDED
@@ -0,0 +1,41 @@
1
+ # Python environments and generated files
2
+ .venv/
3
+ venv/
4
+ __pycache__/
5
+ *.py[cod]
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ htmlcov/
12
+ build/
13
+ dist/
14
+
15
+ # Credentials and local settings
16
+ .env
17
+ .env.*
18
+ !.env.example
19
+ *.local.json
20
+ .vscode/
21
+ .idea/
22
+
23
+ # Local datasets, model weights, and experiment outputs
24
+ /data/
25
+ /datasets/
26
+ /checkpoints/
27
+ /runs/
28
+ /outputs/
29
+ /wandb/
30
+ /logs/
31
+ /.cache/
32
+ *.safetensors
33
+ *.pt
34
+ *.pth
35
+ *.ckpt
36
+ *.onnx
37
+ *.log
38
+
39
+ # OS metadata
40
+ .DS_Store
41
+ Thumbs.db
qev-0.2.0/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # Release history
2
+
3
+ ## 0.2.0 — SDK and local playground
4
+
5
+ - Bundled the English playground, six licensed photos and all preset files in the wheel.
6
+ - Added `qev playground` and `qev.load()` with pinned model preparation on first use.
7
+ - Added persistent caches, offline operation and automatic CUDA/CPU selection.
8
+ - Kept `qev predict`, `qev serve`, `qev download` and the low-level `QEV.load` API.
9
+ - Added voluntary GitHub Star and support links; browser opening requires `--open`.
10
+ - Preserved the QEV 0.1.1 learned model, calibration and all 38 inference modules.
11
+
12
+ ## 0.1.1 — QEV packaging release
13
+
14
+ - Renamed the public GitHub project, Hugging Face model and dataset to QEV / qev-data.
15
+ - Added the `qev` Python package, `QEV` interface and checkpoint-aware download command.
16
+ - Prepared a PyPI wheel and source distribution with a GitHub Trusted Publisher workflow.
17
+ - Documented measured tensor dtypes, stored adaptation size and exact backbone counts.
18
+ - Cancelled public Space creation; retained the existing local playground source.
19
+ - Preserved the trained weights, calibration, 38 inference modules and dataset records.
20
+ - Preserved prior publication evidence under `release/history/0.1.0/`.
21
+
22
+ ## 0.1.0 — Qwen3.5 Classification research release
23
+
24
+ - Renamed the public project from Veyra to Qwen3.5 Classification and explicitly attributed Qwen3.5-2B.
25
+ - Preserved the selected v13 adaptation weights, calibrated manifest and original runtime.
26
+ - Added the `qwen3_5_classification` Python facade and `qwen3.5-classification` inference command.
27
+ - Curated English release documentation, source-specific dataset licensing and clean public commits.
28
+ - Preserved numerical success/failure evidence, including the unsuccessful 2048/image-cell study.
29
+ - Archived personal Korean documents and original development history privately.
30
+
31
+ This is the final snapshot of the current Qwen-based research line. Version 0.1.0 denotes
32
+ the renamed distribution, not a reset of training or an assertion of production readiness.
qev-0.2.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,314 @@
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.5-2B
4
+ base_model_relation: adapter
5
+ library_name: pytorch
6
+ language:
7
+ - en
8
+ - ko
9
+ tags:
10
+ - multimodal
11
+ - dynamic-classification
12
+ - qwen3_5
13
+ - calibrated-decisions
14
+ - custom-runtime
15
+ datasets:
16
+ - ken-jo/qev-data
17
+ - LocalLLaMA/typed-decisions
18
+ - stanfordnlp/snli
19
+ - PolyAI/banking77
20
+ - AI-Lab-Makerere/beans
21
+ - garythung/trashnet
22
+ inference: false
23
+ ---
24
+
25
+ # QEV
26
+
27
+ **Your evidence. Your criteria. A decision with probabilities.**
28
+
29
+ QEV is an open multimodal decision model inspired by
30
+ [LAYA](https://huggingface.co/convaiinnovations/laya), combining request-defined typed
31
+ decisions with the text and vision backbone of
32
+ [Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B).
33
+ Provide text, an image, or both, plus the choices or criteria you want evaluated.
34
+ Receive probabilities and a structured answer in one batched backbone forward.
35
+
36
+ [Training data](https://huggingface.co/datasets/ken-jo/qev-data)
37
+
38
+ ## At a glance
39
+
40
+ | | QEV 0.1.1 |
41
+ | --- | --- |
42
+ | Evidence | Text, one photo, or text and a photo together |
43
+ | Decision types | `choice`, ordered `score`, and true/false `noul` |
44
+ | Request limits | 1-4 questions; 2-16 choice/score candidates; 2,048 processed tokens |
45
+ | Inference | One batched backbone forward; zero generated answer tokens |
46
+ | Base model | Qwen3.5-2B, with its vision encoder frozen |
47
+ | Full model / adaptation | 2.213B merged parameters / 7.992M stored adapter and head parameters |
48
+ | Precision | BF16 backbone and FP32 readouts on CUDA |
49
+ | License | Apache-2.0 for code and adaptation; source-specific dataset licenses |
50
+
51
+ Model version **0.1.1**, final Qwen-based research snapshot; Python SDK **0.2.0**. Previously developed as Veyra
52
+ Workflow Recovery v13. This release changes the public identity and packaging, not the
53
+ learned weights, candidate encoding, calibration or inference mathematics.
54
+ QEV is independently maintained. Its design draws on LAYA's typed decision interface;
55
+ its neural backbone and vision encoder come from Qwen3.5-2B. No LAYA checkpoint is
56
+ merged into the weights. The released training recipe is supervised adaptation and
57
+ calibration; it is not an RLCD-trained compact model.
58
+
59
+ ## What it returns
60
+
61
+ | Primitive | Define in the request | Receive |
62
+ | --- | --- | --- |
63
+ | `choice` | Candidate names and descriptions | A probability for each candidate and a selected name |
64
+ | `score` | Ordered descriptions, such as severity levels | Level probabilities and the expected zero-based level |
65
+ | `noul` | A yes/no proposition | The probability that the proposition is true |
66
+
67
+ All three include confidence and an abstention signal. Candidate definitions can change
68
+ between requests. The output is computed directly from decision heads, so inference does
69
+ not generate an answer sentence or a JSON string that needs parsing.
70
+
71
+ ## One photo, three decisions
72
+
73
+ Recognize a material, apply your own handling policy, and evaluate a proposition in the
74
+ same request. The example below is an existing release verification fixture with its
75
+ actual recorded output.
76
+
77
+ <img src="https://huggingface.co/ken-jo/qev/resolve/main/examples/photograph/item.jpg" alt="TrashNet verification photograph of a plastic bottle" width="420" />
78
+
79
+ | Question | Definition supplied with the request | QEV's recorded answer |
80
+ | --- | --- | --- |
81
+ | `choice` | Choose among cardboard, glass, metal, paper, plastic and trash | Plastic (`c4`), probability **0.9361** |
82
+ | `score` | Band 0: glass/plastic; band 1: metal/trash; band 2: cardboard/paper | Expected level **0.4254** on the 0-2 scale; most likely band 0, probability **0.6978** |
83
+ | `noul` | Does the item belong to glass, paper or plastic? | Probability true **0.7903** |
84
+
85
+ All three answers were accepted by the released abstention policy. They used one batched
86
+ forward and generated zero answer tokens. An expected level is a weighted average over
87
+ the ordered levels. The probability on a single fixture is not an accuracy measurement.
88
+
89
+ [Exact request](https://huggingface.co/ken-jo/qev/blob/main/examples/photograph/request.json)
90
+ · [Full recorded response](https://huggingface.co/ken-jo/qev/blob/main/examples/photograph/response.json)
91
+ · [Reproduction and provenance](https://github.com/ken-jo/qev/tree/main/examples/photograph)
92
+
93
+ Photo: TrashNet, Gary Thung, MIT. Image bytes and the original verification question
94
+ definitions are preserved. This previously inspected example illustrates the interface;
95
+ aggregate performance is reported below.
96
+
97
+ ## Quickstart
98
+
99
+ Use Python 3.12 and the custom QEV runtime from the
100
+ [release page](https://github.com/ken-jo/qev/releases). The checkpoint consists of an
101
+ adaptation and decision heads; its Qwen backbone is downloaded separately.
102
+
103
+ ```sh
104
+ python -m pip install https://huggingface.co/ken-jo/qev/resolve/main/runtime/qev-0.2.0-py3-none-any.whl
105
+ qev playground
106
+ ```
107
+
108
+ ```python
109
+ from pathlib import Path
110
+ from qev import load, DecisionRequest
111
+
112
+ model = load() # Prepares the pinned weights on first use.
113
+ request = DecisionRequest.model_validate({
114
+ "state": {"text": "I was charged twice. Please refund the duplicate payment."},
115
+ "questions": {
116
+ "department": {
117
+ "type": "choice",
118
+ "instructions": "Which team should handle this request?",
119
+ "criteria": {"billing": "Payments and refunds", "technical": "Software faults"},
120
+ }
121
+ },
122
+ })
123
+ result = model.predict(request)
124
+ print(result["answers"]["department"])
125
+ ```
126
+
127
+ Recorded output for this request, shortened:
128
+
129
+ ```json
130
+ {
131
+ "type": "choice",
132
+ "choice": "billing",
133
+ "probabilities": {"billing": 0.974044, "technical": 0.025956},
134
+ "confidence": 0.974044,
135
+ "abstained": false
136
+ }
137
+ ```
138
+
139
+ For a photo, set `state.images` to `[{"path": "item.jpg"}]`, describe the visual decision
140
+ in the question, and call `model.predict(request, Path("images").resolve())`. The image
141
+ path is resolved under that directory. Text can supply context or a policy for the same image.
142
+ Use the [API guide](https://github.com/ken-jo/qev/blob/main/docs/API.md) for score and noul
143
+ schemas and the local HTTP server.
144
+
145
+ The SDK includes the English playground and six sample photographs. `qev playground`
146
+ opens a local server at http://127.0.0.1:7860. First use downloads about 4.6 GB of model
147
+ files; subsequent launches use the persistent cache. Use `--offline` for a prepared cache.
148
+
149
+ ## Base and modifications
150
+
151
+ - Base: [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B), revision
152
+ `15852e8c16360a2fea060d615a32b45270f8a8fc`.
153
+ - Frozen vision encoder; 24 stored language-layer LoRA adapters, rank 8, alpha 16.
154
+ - 2,048-dimensional hidden states; 16-position option readout, four internal reasoning
155
+ slots and a rank-64 condition-modulated binding head.
156
+ - Final recovery updates only adapters in language layers 18-23 and existing readout/
157
+ binding parameters. All 24 stored adapter layers merge for inference in BF16.
158
+ - Stored adaptation/readout: 7,992,384 parameters; 32,009,800-byte safetensors file.
159
+ - Runtime backbone: 2,213,241,664 parameters (331,416,576 vision; 1,881,825,088 language).
160
+ - Storage format: safetensors. Adaptation/readout tensors are FP32. GPU inference uses
161
+ BF16 backbone weights and FP32 readouts; CPU inference uses FP32.
162
+ - LoRA contributes 7,815,168 stored parameters, merged into existing weights at inference.
163
+ The remaining 177,216 readout/binding parameters stay separate; merged inference has
164
+ 2,213,418,880 parameters. The upstream 4.55 GB download also includes unused MTP tensors.
165
+ - One batched backbone forward per request; zero autoregressively generated answer tokens.
166
+ Questions are encoded as separate batch entries, so adding questions still costs compute.
167
+
168
+ Candidate descriptions define meanings at request time. The 16 output positions are
169
+ temporary option positions, not 16 fixed semantic classes. Choice descriptions are
170
+ canonically sorted; ordered score levels retain their order. The whole model still uses
171
+ the Qwen multimodal architecture. There is no claim of a newly invented base network.
172
+
173
+ ## Inputs and outputs
174
+
175
+ Text and/or one image; 1-4 questions; choice/score with 2-16 alternatives, or a binary
176
+ noul proposition. Processed token budget: 2,048. Image preprocessing uses 65,536-262,144
177
+ pixels and 32-pixel alignment. This budget does not establish a minimum reliable resolution
178
+ for small text, tiny objects or spatial tasks.
179
+
180
+ Returns probabilities, selected label/expected score/probability true, and abstention.
181
+ Probabilities are estimates; a direction probability in a game is not a game-win probability.
182
+ The trained prompt marker `VeyraResult:` and internal `veyra` package remain unchanged.
183
+
184
+ ## QEV and LAYA: matched text evaluation
185
+
186
+ All three frozen models answered the same English inputs on an RTX 4060 Ti 8 GB.
187
+ Weights, prompts and temperatures were not tuned on this evaluation.
188
+
189
+ | Test | Questions | LAYA English | LAYA Typed Decisions | QEV 0.1.1 |
190
+ | --- | ---: | ---: | ---: | ---: |
191
+ | Official typed-decisions | 2,000 | 36.05% | 76.95% | 77.00% |
192
+ | AG News, 4 candidates | 400 | 95.00% | 95.25% | 82.50% |
193
+ | DAIR Emotion, 6 candidates | 400 | 58.75% | 60.00% | 50.25% |
194
+
195
+ ![Accuracy on identical inputs](https://huggingface.co/ken-jo/qev/resolve/main/release-comparison/accuracy.png)
196
+
197
+ Typed-decisions is an adapted, previously inspected benchmark for QEV and LAYA's
198
+ specialist. QEV's one-question advantage is not evidence of superiority: the paired 95%
199
+ interval is -1.85 to +1.95 percentage points. News and emotion have no QEV task-specific
200
+ adaptation in the audited release sources, making them task-held-out zero-shot tests
201
+ for QEV. Upstream pretraining overlap is unknown. LAYA reports news in its training
202
+ mix and emotion held out, so the training exposure is not identical.
203
+
204
+ | typed-decisions metric | LAYA Typed Decisions | QEV 0.1.1 | Better direction |
205
+ | --- | ---: | ---: | --- |
206
+ | Brier against soft targets | 0.06149 | 0.07460 | Lower |
207
+ | NLL / soft-target cross-entropy | 0.88445 | 0.90894 | Lower |
208
+ | ECE, 15 bins | 21.67% | 25.19% | Lower |
209
+ | Ordinal expectation MAE | 0.24251 | 0.30366 | Lower |
210
+ | Resident SDK p50 | 23.71 ms | 77.70 ms | Lower |
211
+ | Resident SDK p95 | 30.06 ms | 97.70 ms | Lower |
212
+
213
+ The specialist has better probability quality on this benchmark and is faster here.
214
+ Both LAYA English checkpoints are reported as 421M parameters; QEV uses 2.213B after
215
+ merging adapters. Timings are serial, one question per call after warmup; loading,
216
+ network transport and queueing are excluded. All state, instruction and option
217
+ truncation counts are zero. These measurements do not establish parity with LAYA's
218
+ multilingual router or a live JEV service.
219
+
220
+ [Full comparison, source revisions and zero-shot definitions](https://github.com/ken-jo/qev/blob/main/docs/LAYA_COMPARISON.md)
221
+ · [Machine-readable evidence](https://github.com/ken-jo/qev/tree/main/reports/release-comparison)
222
+
223
+ ## Accuracy and the decisions accepted
224
+
225
+ QEV reports an abstention flag from its released fitted policy. An application can route
226
+ flagged requests for review. The table shows both the whole evaluation and the portion
227
+ accepted by that policy, with no threshold retuning for these measurements.
228
+
229
+ | Evaluation | Accuracy on all questions | Questions accepted | Accuracy among accepted questions |
230
+ | --- | ---: | ---: | ---: |
231
+ | Typed-decisions, 2,000 questions | 77.00% | 30.80% | 94.32% |
232
+ | AG News, 400 questions | 82.50% | 98.00% | 83.16% |
233
+ | DAIR Emotion, 400 questions | 50.25% | 63.75% | 60.78% |
234
+
235
+ Coverage and reliability change substantially across tasks. The 94.32% figure applies
236
+ only to the accepted typed-decisions subset. It is not the accuracy of all requests or
237
+ a guarantee for a new workflow. The `abstained` field is a policy decision based on model
238
+ confidence; QEV does not return a separately trained `unknown_probability` class.
239
+
240
+ ## Separate image and workflow evaluation
241
+
242
+ | Fresh final metric | Veyra Foundation v11 (Qwen3.5-2B) | QEV 0.1.1 (Workflow Recovery v13) |
243
+ | --- | ---: | ---: |
244
+ | Authored workflow accuracy, 1,440 questions / 480 groups | 44.31% | 69.38% |
245
+ | CIFAR-10 guard, 600 questions | 95.17% | 95.83% |
246
+ | SNLI, 450 questions | 86.00% | 87.78% |
247
+ | BANKING77 sampled 8-candidate, 462 questions | 84.20% | 85.50% |
248
+ | Uncertainty NLL, 480 groups (lower is better) | 1.003285 | 0.899093 |
249
+ | Squared conditional-distribution error (lower is better) | 0.323918 | 0.245122 |
250
+ | Expected 0/1/5 cost at 80% coverage (lower is better) | 1.786584 | 1.011177 |
251
+
252
+ Workflow improvement has a paired group-bootstrap 95% interval of +20.07 to +30.14
253
+ percentage points. The three new families are equipment reservation, supplier onboarding
254
+ and travel reimbursement. They are procedural tasks, not broad production business cases.
255
+
256
+ Previously inspected regressions: official typed-decisions 77.00% over 2,000 questions;
257
+ legacy synthetic text 91.16% and image 97.77%. The official benchmark's actual answer
258
+ coverage is 30.80%, with 94.32% accuracy among accepted answers. These are not independent
259
+ final sets or an overall claim of 90%+ real-world accuracy. The model trained on the recorded
260
+ typed-decisions training partition; teacher-agreement annotations are not observed outcomes.
261
+
262
+ Resident local HTTP photo p95: **114.94 ms** on RTX 4060 Ti 8 GB, 40 distinct serial
263
+ photographs after three warmups, one image/question and six candidates. Feature caching
264
+ is disabled. Loading, WAN and concurrent traffic are excluded. No matched JEV speed
265
+ or accuracy comparison was run.
266
+
267
+ ## Limitations and negative results
268
+
269
+ - Final overall ECE is 12.58%, worse than Veyra Foundation v11's 6.80%.
270
+ - Final overall accepted expected error is 20.49% at 88.99% coverage. For uncertain
271
+ requests it is 45.57% at 52.50% coverage. Fitted abstention is not a shifted-domain guarantee.
272
+ - 72 exploratory 2048 games produced no 2048 wins. Engine-assisted variants supplied legal
273
+ directions or deterministic next boards; their results must not be credited to pure vision.
274
+ - A balanced seven-choice board-cell diagnostic scored image 5/28 (17.86%) and text
275
+ 21/28 (75%). This measures narrow digit/location binding, not general photograph accuracy.
276
+ - Photographic transfer covers limited datasets. OCR, localization, object relations,
277
+ temporal reasoning, safety-critical use and broad Korean task quality are not established.
278
+ - Public benchmark overlap in Qwen pretraining cannot be ruled out. Near-duplicate grouping
279
+ only detects the documented image similarities; it cannot prove distinct physical objects.
280
+
281
+ ## Training and licensing
282
+
283
+ Supervised decision/distribution training and staged LoRA adaptation were used. Five
284
+ probability-learning variants, including RLOO, were compared at the earlier head stage;
285
+ cross-entropy was selected there. This checkpoint is not described as a successful new
286
+ reinforcement-learning algorithm. Later recovery uses soft cross-entropy with parent KL
287
+ replay. The selected final recovery consumed 4,533 additional questions and 567 optimizer
288
+ steps (half of the declared one-pass schedule), selected on development data before new final
289
+ evaluation. Calibration and abstention use separate recorded groups.
290
+
291
+ Code/adaptation weights are Apache-2.0; dataset material retains its separate per-source
292
+ licenses. The model package includes one MIT-licensed verification photograph with its
293
+ source notice and request. Training corpus snapshots are published separately, with
294
+ CIFAR-10 excluded pending redistribution rights. Read the repository's data and training
295
+ documentation.
296
+
297
+ ## Integrity and loading
298
+
299
+ - Weights SHA-256: `84b57aeeb987f73416ac0f796150957d1c5beb1ed373733053e46438f77a8fee`
300
+ - Manifest SHA-256: `d83f9910196c6e801658ca3816c3d2bd4a849ba3da6ff059a0edf7c6028e898d`
301
+
302
+ The package contains a calibrated manifest, adaptation weights and a custom runtime wheel.
303
+ Qwen backbone weights must be downloaded separately at the pinned revision. Install the
304
+ wheel from `runtime/`, then run `qev playground`, `qev predict`, or use the Python
305
+ `load()` API in the [repository](https://github.com/ken-jo/qev). A standard Transformers
306
+ auto-model loader cannot directly load this custom adapter/head layout.
307
+
308
+ Historical stage flags in the unchanged manifest record when those stages were run.
309
+ The exact-model acceptance report and publication verification are separate evidence;
310
+ packaging does not retroactively alter a stage's provenance.
311
+
312
+ ---
313
+
314
+ [GitHub: ken-jo/qev](https://github.com/ken-jo/qev)
qev-0.2.0/NOTICE ADDED
@@ -0,0 +1,71 @@
1
+ QEV (formerly Veyra)
2
+ Copyright 2026 QEV contributors
3
+ Copyright 2026 Veyra contributors
4
+
5
+ QEV is an independent open-source research project for dynamic typed
6
+ decisions over images and text.
7
+
8
+ The backbone is Qwen/Qwen3.5-2B, published by the Qwen team under Apache-2.0.
9
+ Model weights are not included in this repository and retain their upstream
10
+ license and attribution requirements.
11
+ https://huggingface.co/Qwen/Qwen3.5-2B
12
+
13
+ The design takes inspiration from LAYA's typed decision interfaces and
14
+ candidate scoring. No LAYA source code or model weights are included in
15
+ this implementation.
16
+ https://github.com/NandhaKishorM/laya
17
+
18
+ TypeSafe JEV's public API is a reference for typed question and answer
19
+ contracts. This repository does not contain JEV source code or weights.
20
+ https://api.typesafe.ai/openapi.json
21
+
22
+ Starter head training uses the MIT-licensed Beans dataset from AIR Lab,
23
+ Makerere University. Its copyright and permission notice are preserved in
24
+ docs/data-licenses/beans-MIT.txt. Dataset images are downloaded separately.
25
+ https://github.com/AI-Lab-Makerere/ibean
26
+
27
+ Foundation training also uses the following separately licensed datasets.
28
+ Original records and photographs are not redistributed with the model package.
29
+
30
+ TrashNet: Gary Thung and Mindy Yang, MIT.
31
+ Kaggle redistribution: vminhkhoi/trashnet, version 1. Image/class byte hashes
32
+ were matched against the original-author dataset before split construction.
33
+ The original notice is preserved in docs/data-licenses/trashnet-MIT.txt.
34
+ https://github.com/garythung/trashnet
35
+ https://www.kaggle.com/datasets/vminhkhoi/trashnet
36
+
37
+ SNLI: Stanford Natural Language Inference corpus, Stanford NLP Group,
38
+ Samuel R. Bowman et al. (2015), CC-BY-SA-4.0.
39
+ Selected premise/hypothesis pairs were converted into dynamic decision views;
40
+ derived dataset material retains the applicable share-alike requirements.
41
+ https://nlp.stanford.edu/projects/snli/
42
+ https://huggingface.co/datasets/stanfordnlp/snli
43
+ https://creativecommons.org/licenses/by-sa/4.0/
44
+
45
+ BANKING77: PolyAI, Casanueva et al. (2020), CC-BY-4.0.
46
+ Utterances and category names were converted into sampled eight-candidate
47
+ questions and request-specific policy views; this is not the standard 77-way
48
+ evaluation. Attribution and source revisions accompany the data protocol.
49
+ https://github.com/PolyAI-LDN/task-specific-datasets
50
+ https://huggingface.co/datasets/PolyAI/banking77
51
+ https://creativecommons.org/licenses/by/4.0/
52
+
53
+ CC-BY-4.0 and CC-BY-SA-4.0 legal texts in docs/data-licenses were obtained
54
+ from the SPDX license-list-data text distribution. In the Hugging Face
55
+ package these notices are under data-licenses/ instead of docs/data-licenses/.
56
+
57
+ The LocalLLaMA/typed-decisions dataset is used for an external text benchmark.
58
+ Its Apache-2.0 teacher-agreement targets are not objective ground-truth labels.
59
+ https://huggingface.co/datasets/LocalLLaMA/typed-decisions
60
+
61
+ Workflow v12 additionally adapts on the recorded training partition of that
62
+ dataset; development, calibration and official test remain separate. Newly
63
+ generated workflow tasks are controlled procedural examples, not recorded
64
+ business outcomes. Their conditional probabilities follow their stated model.
65
+
66
+ CIFAR-10: Alex Krizhevsky, Vinod Nair and Geoffrey Hinton.
67
+ Used only as a 32-by-32 image transfer evaluation guard in Workflow v12.
68
+ The uoft-cs/cifar10 dataset card marks the license as unknown. No CIFAR-10
69
+ images are redistributed. This does not establish permission for redistribution.
70
+ https://www.cs.toronto.edu/~kriz/cifar.html
71
+ https://huggingface.co/datasets/uoft-cs/cifar10