AI Model Designer — graph, data, determinism
Build a model as a visual graph, prepare the data, choose the determinism level; inference and deterministic training code are generated and validated with the real berk.exe.
Inside the panel
Graph editor, data panel, determinism setting, generated code and validation.





Op catalog and templates
- ✓Op families — I/O (Input, Output, Softmax), MLP (Dense), Activation (ReLU, Tanh, Sigmoid), CNN (Conv2d, Pool, Flatten), Norm (LayerNorm, BatchNorm), Transformer, local LLM (Tokenizer, RMSNorm, RoPE, GeGLU, Softcap, Gemma2 layer, Gemma inference)
- ✓Import — ONNX, SafeTensors, GGUF nodes
- ✓5 templates — MLP classifier, CNN image, Transformer sequence, Regression, Gemma-2 (GGUF) offline inference
- ✓Hyperparameters — node selection, input shape/type, only parameters defined for the op (unknown keys are rejected)
Preparation and contract
- ✓Loading — CSV/TSV/JSON; profile (type, missing %, statistics, class balance)
- ✓Quality audit — missing values, duplicates, constant columns, high cardinality/leakage, mixed types, outliers
- ✓Transforms — imputation, deduplication, type conversion, column drop, scaling (minmax/standard/robust), categorical encoding (one-hot/label), class balancing, outlier handling
- ✓Split and export — train/val/test (stratified, seeded); data manifest;
.berkveridata↔model contract (schema hash) - ✓Model↔data fit — feature count ↔ input shape, class count ↔ output units
Determinism, quantization, code
- ✓Determinism 1–5 — levels 4–5: evidence-producing portable-exact path; cross-platform bit-identity measured (table below)
- ✓Quantization — MX block-scaled integer (block=32,
mx_ic_carpim); per-feature calibration range - ✓Inference code — BERK forward pass from the graph; deterministic training code — seeded initialisation, bit-exact SGD (MLP/CNN)
- ✓Real validation — build/run with berk.exe + ai:: stdlib, PASS/FAIL; training run with loss before/after
- ✓AI assistant — 52 tools; headless graph session (MCP)
Gemma-2 from GGUF — fully offline
Drop a GGUF import plus a Gemma Inference node on the graph and the panel emits a runnable BERK program. The kernel lives inside berk.exe: no external runtime, no network, no API.
- ✓Pipeline —
gguf_dosya_ac→gguf_tokenize→gemma_ornekle→gguf_detokenize→gguf_dosya_kapat, with the Gemma-2 chat template assembled for you - ✓K-quant — native streaming reader with on-demand dequantisation (Q2_K–Q8_K); tokenizer and kernel read the same file
- ✓Honesty gates — missing file, corrupt file or
general.architecture ≠ gemma2→MODEL-HATAand exit code 2. No fabricated answer is ever produced. - ✓Determinism splits on temperature — temperature 0: greedy, canonical, bit-identical (determinism cell: same-binary × float-std). Temperature > 0: seed-dependent; reproducible with the same seed but not canonical (seeded randomness, not an axis of the cell) — and the generated code says so in its own header
- ✓No silent runs — every step prints as it happens, the stop reason (
end_of_turn/eos) is named, and the expected runtime is stated up front
| Execution strategy | SHA-256 of the 8-token output | Equal |
|---|---|---|
| Serial (single-threaded) | 450D6349…47F5 | ✓ |
| Parallel (multi-threaded) | 450D6349…47F5 | ✓ |
| Parallel + KV cache | 450D6349…47F5 | ✓ |
| Parallel + KV cache off | 450D6349…47F5 | ✓ |
gemma-2-2b-it Q4_K_M · greedy mode (temperature 0) · same prompt. Four different execution strategies, one and the same output. Each strategy also produced the identical result across two independent runs. Optimisation does not break the proof.
| Integer kernel · execution strategy | SHA-256 of the 8-step logit digest chain | Equal |
|---|---|---|
| Parallel + KV cache | BC565258…1F3D | ✓ |
| Serial + KV cache | BC565258…1F3D | ✓ |
| Parallel + KV cache off | BC565258…1F3D | ✓ |
| Serial + KV cache off | BC565258…1F3D | ✓ |
Same model and prompt; 8-bit integer activations, a group scale of 32. This path produces numbers that differ from the f64 path, so its digest differs too; within itself the result does not depend on the strategy. The digest covers the bits of every logit at every step, not just the chosen token.
Speed and quality — measured, not oversold. Same prompt, 8 tokens, greedy: the default f64 path 626.9 / 631.7 s, the integer kernel 6.9 / 7 s (two runs; about 90×). Most of the speed-up was gained without giving up determinism. Measured on CPU only (no GPU): Intel Core i7-9750H @ 2.60 GHz, 8 GB RAM, parallel + KV cache; the numbers belong to that machine.
The integer kernel runs with 8-bit integer activations and produces numbers that differ from the f64 path: on the same prefix its token choice agrees with f64 on 79 of 80 decisions (98.75%; 10 prompts × 8 tokens, temperature 0). The path is opt-in (BERK_LLM_YOL environment variable); its cross-platform bit-identity is not yet measured. Method and all measurements: AI Framework document, Section 16.
Roadmap — a target, not a capability. A path selector and SHA indicator in Studio, a small-language-model (SLM) training lab and a GPU-ready speed path are not yet available. When the speed path lands it will be declared in the determinism cell as tolerant × float-std: GPU kernels do not keep a fixed reduction order, so the same model lives under two declarations. A “trains large LLMs” claim is not written until it is measured on hardware.
Cross-platform bit-identity — measured
One source file; three different execution engines: a tree-walking interpreter, LLVM-compiled native x86-64 code, and bare-metal ARM Cortex-M7. All eight fingerprints are identical.
| Measurement | x86-64 interpreter | x86-64 native code | Cortex-M7 (STM32F746) | Equal |
|---|---|---|---|---|
| 2Sum · Neumaier · fixed-tree | 3087538174 | 3087538174 | 3087538174 | ✓ |
| Tree sum (N=64) | 1984755374 | 1984755374 | 1984755374 | ✓ |
| Mat-vec (8×8) | 1600022257 | 1600022257 | 1600022257 | ✓ |
| MLP 8→16→8→4 logits | 3471697698 | 3471697698 | 3471697698 | ✓ |
| MLP argmax decisions | 2019152262 | 2019152262 | 2019152262 | ✓ |
| exp · sigmoid · tanh | 2978962761 | 2978962761 | 2978962761 | ✓ |
| Softmax | 291847870 | 291847870 | 291847870 | ✓ |
| COMBINED | 2185869128 | 2185869128 | 2185869128 | ✓ |
FNV-1a/32 fingerprints. Every double is decomposed losslessly into ±m·2^e before hashing — never formatted as text, so rounding in the output cannot hide a difference. Subnormal arithmetic (2−1074) is included, and none of the three platforms flushes subnormals to zero.
On the board, double-precision arithmetic runs entirely in software — the STM32F746 FPU is single-precision only. On the PC it runs on SSE2 hardware instructions. So this table does not say “the same code ran twice”; it says the IEEE-754 contract held across two independent implementations.