muthuishere commited on
Commit
6eacb9d
·
verified ·
1 Parent(s): 0098fc0

OpenJevX v0.5.2: model folder (8-bit ONNX, config, tokenizer), fine-tune checkpoint, card

Browse files
README.md CHANGED
@@ -3,7 +3,7 @@ license: apache-2.0
3
  base_model: convaiinnovations/laya
4
  tags: [decision-model, onnx, classification, jevx]
5
  ---
6
- # OpenJevX v0.5.0
7
 
8
  A small, CPU-first decision model: yes/no, pick-one and 0–N rating questions about a state (JSON or text),
9
  answered on a laptop CPU. **It is meant to run in a container next to your own services**:
@@ -16,7 +16,7 @@ one container, the model inside, your requests never leave your machine.
16
  **The model is a folder:** `openjevx.w8.onnx` (8-bit weight-only, 598 MB; activations stay float, so answers
17
  don't depend on what else is in the request) + `config.json` (this model's own calibration temperatures) +
18
  `tokenizer.json`. The other files are the trainable checkpoint for fine-tuning further: `model.safetensors`,
19
- `encoder/`, `tokenizer/`, `rl_agent_config.json`. Older versions: git revision `v0.4.0`.
20
 
21
  ## Run it in a container (recommended)
22
 
@@ -40,13 +40,15 @@ curl -s http://127.0.0.1:21118/v1/systemone -d '{
40
 
41
  Each answer has `probabilities` and a `confidence`; `noul` gives P(true), `choice` the picked key, `score` the
42
  expected level. The container also serves a live dashboard on `/` and runnable examples on `/recipes`.
43
- Prefer a plain binary? macOS (Apple Silicon), Linux and Windows builds of the v0.5.1 server (ONNX Runtime 1.29)
44
- are on the [release page](https://github.com/muthuishere/openjevx/releases/latest).
 
45
 
46
  ## Or in Python
47
 
48
- Same answers as the server (a port of its prompt layout, markers, temperature and softmax; checked against the
49
- server on the same model: identical probabilities).
 
50
 
51
  ```bash
52
  pip install onnxruntime tokenizers huggingface_hub
@@ -64,51 +66,58 @@ jev = openjevx.OpenJevX() # downloads openjevx.w8.onnx + tokenizer.json + conf
64
  print(jev.decide({"age": 17}, {
65
  "adult": {"type": "noul", "instructions": "Is this person an adult (18 or older)?"},
66
  }))
67
- # {'answers': {'adult': {'type': 'noul', 'noul': 0.04, ...}}} (v0.5.0; about 0.04)
68
  ```
69
 
70
  `openjevx.py` is a single file (also in the GitHub repo under `python/`); copy it into your project if you
71
  prefer. Request and answer shapes match `POST /v1/systemone`.
72
 
73
- ## Release gate (v0.5.0)
74
 
75
  The model folder on the Go server, on CPU. The gate sets share **no state** with training.
76
  "Right and confident" = right AND past jevx's default thresholds (yes >= 0.8, no <= 0.2, choice/score >= 0.6).
 
77
 
78
  | Gate set | Accuracy | Right and confident | Confidently wrong |
79
  |---|---|---|---|
80
- | Everyday basics (463) | 96.3% | 96.3% | 3.0% |
81
- | Rule-checking basics (300) | 94.7% | 94.3% | 3.7% |
 
 
 
82
 
83
- **Known miss:** confidently wrong is 3.0–3.7% on the basics gates, against our 2% target. It was accepted for this
84
- release; the fix is planned for the next model release. The rest of the gate (held-out test sets, logs gate, 13 fundamentals) is
85
- still being scored and will be added here.
 
86
 
87
  **Latency** (v0.5.1 server, ONNX Runtime 1.29, CPU only, Apple M5 Pro, p50 end to end): 22 ms for a short
88
- request (36 tokens), 85 ms for a typical one (164 tokens), 540 ms near the 1024-token limit. Cold start is about
 
89
  1 s once per process. ONNX Runtime 1.29 or newer is needed for this speed: it keeps the 8-bit weights 8-bit
90
  (`MatMulNBits`); in Python, `pip install -U onnxruntime`.
91
 
92
- ## What v0.5.0 was trained on
93
 
94
- 734,795 decisions (408,505 rows). Labels come from evaluating rules or from real outcomes, never from another model's guesses.
95
 
96
  | Area | Decisions | Share |
97
  |---|---|---|
98
- | Rule-checking across 38 business domains (retail pricing, recruiting, real estate, CI/CD, insurance claims, pharmacy stock, HR payroll, gaming, ...) | 200,139 | 27.2% |
99
- | Software-work roles (developers, testers, tech leads, managers, operations, everyone, agent checks) | 183,543 | 25.0% |
100
- | tasksource decision corpus | 146,567 | 19.9% |
101
- | Public sets with real labels (CVE fixes from bigvul, defect detection, code search, ms_marco relevance, HDFS and BGL operator log alerts) | 104,990 | 14.3% |
102
- | Log triage: application (Java/Python/Node/Go/nginx), database (Postgres/MySQL, real SQLSTATE codes), frontend (browser/Sentry) | 60,001 | 8.2% |
103
- | Everyday basics (driving licence age, store hours, parcel late, discount thresholds, fever, bag weight, ...) | 30,405 | 4.1% |
 
104
  | Public typed-decisions | 9,150 | 1.2% |
105
 
106
- Run: one RTX 4090 on Vast.ai, 734,145 decisions after packaging, one full pass in 2.4 h at ~88 items/s, about $1.10 in total. Leakage-checked (22,592 test questions removed); every row checked against the trainer before renting.
107
 
108
  ## Using it with jevx
109
 
110
  jevx caches answers by model name. After upgrading, run `jevx cache clear`, or use a versioned
111
- model name in your profile (for example `--model openjevx-v0.5.0`).
112
 
113
  ## Fine-tune further
114
 
@@ -116,4 +125,4 @@ The whole pipeline (data generators, leakage check, one-job GPU training that re
116
  release gate) is in the GitHub repo under
117
  [`finetuning/`](https://github.com/muthuishere/openjevx/tree/main/finetuning). No training data is published.
118
 
119
- The trainable checkpoint is also available as one archive: [openjevx-finetune-v0.5.0.tar.gz](https://pub-8da821f06ff747cda688f8267ed2aa96.r2.dev/openjevx-finetune-v0.5.0.tar.gz).
 
3
  base_model: convaiinnovations/laya
4
  tags: [decision-model, onnx, classification, jevx]
5
  ---
6
+ # OpenJevX v0.5.2
7
 
8
  A small, CPU-first decision model: yes/no, pick-one and 0–N rating questions about a state (JSON or text),
9
  answered on a laptop CPU. **It is meant to run in a container next to your own services**:
 
16
  **The model is a folder:** `openjevx.w8.onnx` (8-bit weight-only, 598 MB; activations stay float, so answers
17
  don't depend on what else is in the request) + `config.json` (this model's own calibration temperatures) +
18
  `tokenizer.json`. The other files are the trainable checkpoint for fine-tuning further: `model.safetensors`,
19
+ `encoder/`, `tokenizer/`, `rl_agent_config.json`. Older versions: git revisions `v0.5.0` and `v0.4.0`.
20
 
21
  ## Run it in a container (recommended)
22
 
 
40
 
41
  Each answer has `probabilities` and a `confidence`; `noul` gives P(true), `choice` the picked key, `score` the
42
  expected level. The container also serves a live dashboard on `/` and runnable examples on `/recipes`.
43
+ Prefer a plain binary? macOS (Apple Silicon), Linux and Windows builds of the v0.5.2 server (ONNX Runtime 1.29)
44
+ are on the [release page](https://github.com/muthuishere/openjevx/releases/latest). The server can also load this
45
+ model folder straight from S3 (`OPENJEVX_MODEL=s3://bucket/prefix/`); see the GitHub README.
46
 
47
  ## Or in Python
48
 
49
+ Same answers as the server (a port of its prompt layout, markers, input length, temperature and softmax). Checked
50
+ against the server on the same model: probabilities agree to within about 0.005; the rest is ONNX Runtime versions
51
+ rounding differently.
52
 
53
  ```bash
54
  pip install onnxruntime tokenizers huggingface_hub
 
66
  print(jev.decide({"age": 17}, {
67
  "adult": {"type": "noul", "instructions": "Is this person an adult (18 or older)?"},
68
  }))
69
+ # {'answers': {'adult': {'type': 'noul', 'noul': 0.08, ...}}} (about 0.08)
70
  ```
71
 
72
  `openjevx.py` is a single file (also in the GitHub repo under `python/`); copy it into your project if you
73
  prefer. Request and answer shapes match `POST /v1/systemone`.
74
 
75
+ ## Release gate
76
 
77
  The model folder on the Go server, on CPU. The gate sets share **no state** with training.
78
  "Right and confident" = right AND past jevx's default thresholds (yes >= 0.8, no <= 0.2, choice/score >= 0.6).
79
+ Limits for the basics gates: right and confident >= 90%, confidently wrong <= 2%.
80
 
81
  | Gate set | Accuracy | Right and confident | Confidently wrong |
82
  |---|---|---|---|
83
+ | Everyday basics (463) | 99.1% | 98.7% | 0.9% |
84
+ | Rule-checking basics (300) | 100% | 100% | 0.0% |
85
+ | Held-out rule-checking (11,949) | 98.9% | 98.8% | 1.0% |
86
+ | Held-out software-work roles (9,159) | 98.5% | 97.8% | 1.0% |
87
+ | Logs gate (900) | 92.0% | 91.9% | 7.8% |
88
 
89
+ The 13 fundamentals through the jevx CLI with default thresholds: 13/13.
90
+
91
+ **Known misses:** on log triage it is confidently wrong 7.8% of the time, and on real public incident postmortems
92
+ (102 questions) 20.6%. Check those answers.
93
 
94
  **Latency** (v0.5.1 server, ONNX Runtime 1.29, CPU only, Apple M5 Pro, p50 end to end): 22 ms for a short
95
+ request (36 tokens), 85 ms for a typical one (164 tokens), 540 ms for a long one (912 tokens). Inputs are cut at 512 tokens (`max_len` in
96
+ `config.json`, the length this model was trained at). Cold start is about
97
  1 s once per process. ONNX Runtime 1.29 or newer is needed for this speed: it keeps the 8-bit weights 8-bit
98
  (`MatMulNBits`); in Python, `pip install -U onnxruntime`.
99
 
100
+ ## What v0.5.2 was trained on
101
 
102
+ 791,889 decisions (465,583 rows). Labels come from evaluating rules or from real outcomes, never from another model's guesses.
103
 
104
  | Area | Decisions | Share |
105
  |---|---|---|
106
+ | Rule-checking across 38 business domains (retail pricing, recruiting, real estate, CI/CD, insurance claims, pharmacy stock, HR payroll, gaming, ...) | 200,155 | 25.3% |
107
+ | Software-work roles (developers, testers, tech leads, managers, operations, everyone, agent checks) | 183,543 | 23.2% |
108
+ | tasksource decision corpus | 146,567 | 18.5% |
109
+ | Public sets with real labels (CVE fixes from bigvul, defect detection, code search, ms_marco relevance, HDFS and BGL operator log alerts) | 104,990 | 13.3% |
110
+ | Rule-reading drills: everyday rules with many thresholds, decimals, dates over 2020-2035, quarter-hour meetings, opening hours, missing/equal/contains checks | 75,321 | 9.5% |
111
+ | Log triage: application (Java/Python/Node/Go/nginx), database (Postgres/MySQL, real SQLSTATE codes), frontend (browser/Sentry) | 60,001 | 7.6% |
112
+ | Everyday basics (driving licence age, store hours, parcel late, discount thresholds, fever, bag weight, ...) | 12,162 | 1.5% |
113
  | Public typed-decisions | 9,150 | 1.2% |
114
 
115
+ Run: one RTX 4090 on Vast.ai, 791,239 decisions after packaging, one full pass in 2.5 h at ~87 items/s, about $1.25. Leakage-checked (22,576 test questions removed); every row checked against the trainer before renting.
116
 
117
  ## Using it with jevx
118
 
119
  jevx caches answers by model name. After upgrading, run `jevx cache clear`, or use a versioned
120
+ model name in your profile (for example `--model openjevx-v0.5.2`).
121
 
122
  ## Fine-tune further
123
 
 
125
  release gate) is in the GitHub repo under
126
  [`finetuning/`](https://github.com/muthuishere/openjevx/tree/main/finetuning). No training data is published.
127
 
128
+ The trainable checkpoint is also available as one archive: [openjevx-finetune-v0.5.2.tar.gz](https://pub-8da821f06ff747cda688f8267ed2aa96.r2.dev/openjevx-finetune-v0.5.2.tar.gz).
config.json CHANGED
@@ -1,12 +1,12 @@
1
  {
2
  "name": "openjevx",
3
- "version": "0.5.0",
4
  "temperature": {
5
- "choice": 1.220432996749878,
6
- "score": 1.161743402481079,
7
- "noul": 1.2535336017608643
8
  },
9
- "max_len": 1024,
10
  "head_max": 256,
11
  "special_ids": {
12
  "cls": 50281,
@@ -16,5 +16,5 @@
16
  },
17
  "quantization": "8-bit weight-only",
18
  "base_model": "convaiinnovations/laya",
19
- "sha256": "109b2b1d3717ff9038da811d84f538262fc9d9bc1f958967d437e837f507e294"
20
  }
 
1
  {
2
  "name": "openjevx",
3
+ "version": "0.5.2",
4
  "temperature": {
5
+ "choice": 1.1505310535430908,
6
+ "score": 1.1315456628799438,
7
+ "noul": 1.1007894277572632
8
  },
9
+ "max_len": 512,
10
  "head_max": 256,
11
  "special_ids": {
12
  "cls": 50281,
 
16
  },
17
  "quantization": "8-bit weight-only",
18
  "base_model": "convaiinnovations/laya",
19
+ "sha256": "fa1520c22876ba6a98f2b080b55c302e8f7ffbcf7630a1ff05d759bb21a18410"
20
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:82d90be1947a6a2f393b115cc5c1e1dca9ed37c82cbea392b0ef1bdd17138760
3
  size 842609220
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f40ae2d9d1105d4b13f7d4dadc820d6451499076e57d2bf55c5d898d9a4e160
3
  size 842609220
openjevx.py CHANGED
@@ -22,7 +22,7 @@ from tokenizers import Tokenizer
22
 
23
  REPO = "muthuishere/openjevx"
24
  CLS, SEP, MASK = 50281, 50282, 50284
25
- MAX_LEN, HEAD_MAX = 1024, 256
26
 
27
 
28
  def _criterion(v):
@@ -51,7 +51,9 @@ class OpenJevX:
51
  model = model or hf_hub_download(REPO, "openjevx.w8.onnx")
52
  tokenizer = tokenizer or hf_hub_download(REPO, "tokenizer.json")
53
  config = config or hf_hub_download(REPO, "config.json") # this model's own calibration temperatures
54
- t = json.load(open(config))["temperature"]
 
 
55
  self.temperature = {0: t["choice"], 1: t["score"], 2: t["noul"]}
56
  self.tok = Tokenizer.from_file(tokenizer)
57
  self.session = ort.InferenceSession(model, providers=providers or ["CPUExecutionProvider"])
@@ -63,19 +65,19 @@ class OpenJevX:
63
  qtype, keys, options = _parse(q)
64
  head = self._enc(q["type"] + " question: " + q["instructions"].replace("[MASK]", " "))
65
  opts = [[MASK] + self._enc(" " + o.replace("[MASK]", " "))[:48] for o in options]
66
- budget = HEAD_MAX - sum(map(len, opts))
67
  if budget < 16:
68
- per = max(4, (HEAD_MAX - 16) // max(1, len(opts)))
69
  opts = [o[:per] for o in opts]
70
- budget = HEAD_MAX - sum(map(len, opts))
71
  head = head[:max(8, budget)]
72
  ids, markers = [CLS] + head + [SEP], []
73
  for o in opts:
74
  markers.append(len(ids))
75
  ids += o
76
  ids.append(SEP)
77
- ids += state_ids[:max(0, MAX_LEN - len(ids) - 1)] + [SEP]
78
- return ids[:MAX_LEN], [m for m in markers if m < MAX_LEN], qtype, keys
79
 
80
  def decide(self, state, questions):
81
  """state: dict/list (sent as JSON) or str; questions: {id: {type, instructions, criteria}}."""
 
22
 
23
  REPO = "muthuishere/openjevx"
24
  CLS, SEP, MASK = 50281, 50282, 50284
25
+ MAX_LEN, HEAD_MAX = 1024, 256 # used only when config.json has no max_len / head_max (as the server does)
26
 
27
 
28
  def _criterion(v):
 
51
  model = model or hf_hub_download(REPO, "openjevx.w8.onnx")
52
  tokenizer = tokenizer or hf_hub_download(REPO, "tokenizer.json")
53
  config = config or hf_hub_download(REPO, "config.json") # this model's own calibration temperatures
54
+ cfg = json.load(open(config))
55
+ t = cfg["temperature"]
56
+ self.max_len, self.head_max = cfg.get("max_len") or MAX_LEN, cfg.get("head_max") or HEAD_MAX
57
  self.temperature = {0: t["choice"], 1: t["score"], 2: t["noul"]}
58
  self.tok = Tokenizer.from_file(tokenizer)
59
  self.session = ort.InferenceSession(model, providers=providers or ["CPUExecutionProvider"])
 
65
  qtype, keys, options = _parse(q)
66
  head = self._enc(q["type"] + " question: " + q["instructions"].replace("[MASK]", " "))
67
  opts = [[MASK] + self._enc(" " + o.replace("[MASK]", " "))[:48] for o in options]
68
+ budget = self.head_max - sum(map(len, opts))
69
  if budget < 16:
70
+ per = max(4, (self.head_max - 16) // max(1, len(opts)))
71
  opts = [o[:per] for o in opts]
72
+ budget = self.head_max - sum(map(len, opts))
73
  head = head[:max(8, budget)]
74
  ids, markers = [CLS] + head + [SEP], []
75
  for o in opts:
76
  markers.append(len(ids))
77
  ids += o
78
  ids.append(SEP)
79
+ ids += state_ids[:max(0, self.max_len - len(ids) - 1)] + [SEP]
80
+ return ids[:self.max_len], [m for m in markers if m < self.max_len], qtype, keys
81
 
82
  def decide(self, state, questions):
83
  """state: dict/list (sent as JSON) or str; questions: {id: {type, instructions, criteria}}."""
openjevx.w8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:109b2b1d3717ff9038da811d84f538262fc9d9bc1f958967d437e837f507e294
3
  size 598046561
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa1520c22876ba6a98f2b080b55c302e8f7ffbcf7630a1ff05d759bb21a18410
3
  size 598046561
openjevx.w8.onnx.sha256 CHANGED
@@ -1 +1 @@
1
- 109b2b1d3717ff9038da811d84f538262fc9d9bc1f958967d437e837f507e294 openjevx.w8.onnx
 
1
+ fa1520c22876ba6a98f2b080b55c302e8f7ffbcf7630a1ff05d759bb21a18410 openjevx.w8.onnx
rl_agent_config.json CHANGED
@@ -11,9 +11,9 @@
11
  "amp_dtype": "bf16",
12
  "model_name": "openjevx",
13
  "temperature": [
14
- 1.220432996749878,
15
- 1.161743402481079,
16
- 1.2535336017608643
17
  ],
18
  "training": {
19
  "updates": 7313,
 
11
  "amp_dtype": "bf16",
12
  "model_name": "openjevx",
13
  "temperature": [
14
+ 1.1505310535430908,
15
+ 1.1315456628799438,
16
+ 1.1007894277572632
17
  ],
18
  "training": {
19
  "updates": 7313,