Home · Berk Studio · AI Model Designer

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.

ONNX · SafeTensors · GGUFMX integer (block=32)Determinism 1–5Gemma-2 offline
Screens

Inside the panel

Graph editor, data panel, determinism setting, generated code and validation.

Model

Op catalog and templates

  • ✓34 ops in 12 families — I/O (Input, Output, Softmax), Import, MLP (Dense), Activation (ReLU, Tanh, Sigmoid), Merge (Add, Concat), CNN (Conv2d: stride, valid/same padding; Pool: max/average; Flatten), Sequence, Transformer, Norm (LayerNorm, BatchNorm), Exact math, Parallel, local LLM (Tokenizer, RMSNorm, RoPE, GeGLU, Softcap, Gemma2 layer, Gemma inference)
  • ✓Import — ONNX, SafeTensors, GGUF nodes
  • ✓6 templates — MLP classifier, residual MLP, 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)
Data

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; binary (0/1) columns can be skipped when scaling (optional setting in the assistant tool, off by default)
  • ✓Leakage audit — every transform computed on the whole data before the split (imputation, outlier handling, scaling, class balancing) is listed as leakage; deduplication is written as a separate note; the list is part of the .berkveri contract
  • ✓Degenerate-training diagnosis — constant features, a single class, a feature equal to the label and class imbalance in the training data are checked first; the cause is looked for in the data before the architecture
  • ✓Synthetic data and samples — seeded synthetic data is generated with 8 defect types and a defect manifest is written; the quality audit catches all of these defects; ONNX, SafeTensors and GGUF import samples are generated
  • ✓Split and export — train/val/test (stratified, seeded); data manifest; .berkveri data↔model contract (schema hash)
  • ✓Model↔data fit — feature count ↔ input shape, class count ↔ output units; the same shape rule as training is used; a continuous target is recognised as regression
Generation and validation

Determinism, quantization, code

  • ✓Determinism 1–5 — levels 4–5: evidence-producing portable-exact path; cross-platform bit-identity measured at kernel level (table below); a training file or inference artifact carries this claim only for compositions that have a measurement record (below)
  • ✓Quantization — MX block-scaled integer (block=32, mx_ic_carpim), int8 and QDQ (affine) options; per-feature calibration range
  • ✓Inference code — BERK forward pass from the graph; deterministic training code — seeded initialisation, bit-exact SGD; MLP, CNN, RNN/LSTM/GRU, merge (Add/Concat) and attention/encoder families; learning-rate schedules, stride > 1 and same-padding convolution, CNN with average pooling, seeded dropout, MLP with BatchNorm, Adam and regression (the learning-rate schedule, stride > 1, same padding, dropout and average-pooling paths need ai package 1.3.0; cell rule below)
  • ✓The determinism cell is written per composition — the cross-platform bit-identity claim (the top level of the determinism cell) is carried only by compositions in the measurement-record table: MLP (SGD, constant learning rate, no dropout and no BatchNorm), CNN (stride 1, valid padding, max pooling or none; single- or multi-channel input), RNN/LSTM/GRU (single layer and stacked), merge and attention/encoder chains; the basis is the kernel-level measurement and the library's certification declaration. Models trained with strided convolution, same padding, average pooling, BatchNorm, dropout, a learning-rate schedule, Adam or regression are marked same-ISA × float-std (bit-identical on repeat on the same processor architecture); the reason is written with the composition's name
  • ✓Training decisions with exact arithmetic — best epoch, patience and early stopping are decided on a loss computed with the exact forward pass and the portable logarithm (kf_ln); on equal loss the first epoch is kept; the training report states which quantity the decision used. On the BatchNorm-MLP and regression paths the decision is not exact (these paths are same-ISA). Two runs with the same seed on the same machine gave bit-identical results (57 cases measured); a run cut off by the time budget carries no repeatability claim
  • ✓Real validation — build/run with berk.exe + ai:: stdlib, PASS/FAIL; two goldens: closed form (zero weights) and a library-independent reference (non-zero weights; MLP, CNN, RNN/LSTM/GRU, attention, encoder, merge); ai library version check before compiling; training run with loss before/after
  • ✓AI assistant — 62 tools; headless graph session (MCP); undo/redo of graph changes, a sandbox (byte-identical restore), run status and cancel, artifact inspector, independent ONNX golden generation, synthetic data, import samples and fault injection in the sandbox only
Training and export

Run verdict, ONNX, library

  • ✓Run verdict — the verdict of every training run (valid / degenerate / partial) is stored in the model file as a DURUM line; the model of a degenerate or half-finished run does not count as trained in build-validation, ONNX export and quantization; for a degenerate or partial run the file's cell drops to tolerant × float-std and the report says so
  • ✓Degeneracy check — chance level (label entropy), collapse to a single class, NaN/∞ loss and zero gradient
  • ✓Trained ONNX export — MLP, MLP with BatchNorm and with dropout, regression, merge (Add/Concat) and CNN families; for CNN: Conv · MaxPool/AveragePool · Flatten · Gemm · Softmax, stride, same padding and multi-channel input, F32 and F64; the largest difference against onnxruntime is 5.96e-8 and onnx.checker accepts the file. An F64 CNN file is valid, but onnxruntime on CPU has no DOUBLE Conv kernel, so a session cannot be created there. QDQ export covers the Dense chain only
  • ✓Export that is rejected — there is no trained ONNX export for the RNN/LSTM/GRU, embedding, attention and encoder families; it is rejected by name (the product's ONNX interpreter does not execute these ops, so the file could not be validated)
  • ✓Independent ONNX golden — the golden is produced with the product's own ONNX reader and an independent reference; against onnxruntime the F32 difference is at most 6e-8 and the QDQ integer outputs matched exactly
  • ✓Training options — an unused training option is not silently ignored but reported by name; sequence training applies val.csv/test.csv and the time budget
  • ✓ai package 1.3.0 (2026-11-23, signed, published) — .berkmodel run-verdict functions (bm_status, bm_set_status, bm_status_check …), training-path record (bm_set_path, bm_scope_rank, bm_cell_level), CNN functions with average pooling (cnn2_step_avg_exact, cnn3_step_avg_exact …); 15 new functions, API of 1422 functions, test suite of 125 files
Local LLM

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-HATA and 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 strategySHA-256 of the 8-token outputEqual
Serial (single-threaded)450D6349…47F5✓
Parallel (multi-threaded)450D6349…47F5✓
Parallel + KV cache450D6349…47F5✓
Parallel + KV cache off450D6349…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 strategySHA-256 of the 8-step logit digest chainEqual
Parallel + KV cacheBC565258…1F3D✓
Serial + KV cacheBC565258…1F3D✓
Parallel + KV cache offBC565258…1F3D✓
Serial + KV cache offBC565258…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.

Proof

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.

Measurementx86-64 interpreterx86-64 native codeCortex-M7 (STM32F746)Equal
2Sum · Neumaier · fixed-tree308753817430875381743087538174✓
Tree sum (N=64)198475537419847553741984755374✓
Mat-vec (8×8)160002225716000222571600022257✓
MLP 8→16→8→4 logits347169769834716976983471697698✓
MLP argmax decisions201915226220191522622019152262✓
exp · sigmoid · tanh297896276129789627612978962761✓
Softmax291847870291847870291847870✓
COMBINED218586912821858691282185869128✓

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.

Scope note: Training runs on the CPU through berk.exe. Average pooling is not trained together with stride > 1 (it is rejected by name); same padding combined with stride > 1 or an even kernel, and per-channel BatchNorm in CNNs, are not included. There is no ONNX export for the RNN/LSTM/GRU, embedding, attention and encoder families. The cross-platform bit-identity claim is carried only by compositions with a measurement record and rests on the kernel-level measurement; no measurement of trained model files was made on a second platform, ARM included. There is no cross-platform measurement for the CNN with average pooling or for the run-verdict functions either. GPU/distributed training, experiment tracking and deployment (serving/packaging) tools are not included.

AI Model Designer — $12/mo

3-day free trial, 14-day no-questions refund; free for 365 days for students and educators.

Buy → Education license