"""Jev-Style-2B-Decision-v3: typed decisions with MLX on Apple silicon (bf16 / 8-bit, --precision). Self-contained runtime for chaoliangUNSW/Jev-Style-2B-Decision-v3 (Apache-2.0). No dependency on any training code: rendering (protocol "macjev-render-v2-long-options"), block-causal attention, the verdict readout and calibration are implemented below and reproduce the reference implementation used for evaluation (see release_config.json -> "runtime_parity"). Needs mlx, mlx-lm==0.31.3 (pinned, see the MLX backend section), tokenizers and numpy. Calibration: probabilities use the ONE global temperature of readout_config.json (temperatures.global); temperature=... (CLI --temperature, JSONL "temperature") overrides it (1.0 = uncalibrated scores). Unlike the 0.8B v3 runtime there is no --category (no group temperatures) and no --head-max (no question/options cap: only the 25,600-token total budget applies). Python: from jev_style_decision_mlx import JevStyleDecisionMLX m = JevStyleDecisionMLX(".", precision="bf16") # or "8bit" m.decide("", "Which action?", options={"click": "press it", "wait": None}) m.score_many("", [q1, q2, ...]) # state computed once, reused for every question """ # ---------------------------------------------------------------------------------------------- # Shared core (byte-identical in jev_style_decision.py, jev_style_decision_gguf.py and jev_style_decision_mlx.py): # input rendering (v2), verdict readout, calibration, budgets, errors, manifest check, CLI/JSONL. # # Input layout ("macjev-render-v2-long-options", layout "sb"; token segments are encoded separately # and concatenated, so slot positions are exact): # # state prefix State:\n\n\n # short form Question []: \nOptions:\n # (question + -