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

  • ✓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)
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
  • ✓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
Generation and validation

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)
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 on the deterministic MLP/CNN path; 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