Architecture Advanced 3 minute read Updated 2026-06-28 UTC

TinyRustLM browser runtime architecture

How the uploaded Rust runtime source grounds ModelBreeder theory in local model packages, quantized tensors, adapter deltas, diagnostics, eval sidecars, and raw WebAssembly exports.

Research statusImplementation synthesis from uploaded Rust runtime source files Publication statePublished Reviewed byMichael Kappel Source reports5

Direct answer

TinyRustLM is the concrete runtime anchor for the ModelBreeder browser-local story. It shows how a file-backed site can teach a path toward local model experimentation without a server database: model bytes are loaded into a Rust/WASM runtime, a custom .slm header declares model identity, tensor layouts are validated, adapters bind to model identity, generation runs locally, diagnostics report resource behavior, and eval sidecars record quality evidence.

The uploaded Rust source turns model-breeding vocabulary into package identity, adapter compatibility, local generation, diagnostics, eval evidence, and release packets.

Why this matters to ModelBreeder theory

Before this source drop, the site described local-first model ecologies mostly as architecture. The Rust files make the architecture tangible:

Theory conceptRuntime surface
Model packageSLM1 header, tokenizer section, tensor directory, tensor bytes, checksum.
Compatibilityparameter count, tensor-layout checksum, tokenizer checksum, flags, tensor count.
Descendantadapter-delta package applied to a loaded parent.
Evaluation evidencelocal eval case file plus quality-gate sidecar.
Resource ledgerdiagnostics with token counts, token rate, scratch use, KV cache, quantization mode, and adapter count.
Local sovereigntyraw WASM exports for browser execution without remote inference.

Runtime layers

  1. Model parser. The .slm parser validates magic, version, header length, tensor ranges, tensor directory, tokenizer offsets, tensor data offsets, dimensions, dtype, and checksum.
  2. Tensor store. Loaded tensors can use f32, q8_0, or q4_0 storage. Matvec operations use native storage when possible and copy/dequantize only when required.
  3. Tokenizer. The runtime supports a phase-one byte tokenizer and a custom BPE tokenizer with byte fallback.
  4. Generation state. The runtime keeps model, KV cache, tokenizer, token buffers, diagnostics, sampling config, scratch arena, and logits together.
  5. Adapter ABI. Adapter packages can be raw dense, sparse, or low-rank delta formats. Each is validated against expected model identity before mutation.
  6. Evaluation runner. Local cases are exact-match and produce sidecars, giving the site a simple model for evidence-bearing release packets.
  7. WASM exports. The browser boundary exposes model load, adapter validation, adapter apply, generation, sampling config, result access, diagnostics access, and memory allocation.

Pseudocode: local runtime experiment

pseudocode
PROCEDURE run_local_descendant_experiment(model_bytes, adapter_bytes, eval_cases)
    runtime <- INIT_RUNTIME()

    model_result <- runtime.LOAD_MODEL(model_bytes)
    IF model_result != OK THEN
        RETURN REJECT("model package failed parser", model_result)
    END IF

    adapter_result <- runtime.VALIDATE_ADAPTER_DELTA(adapter_bytes)
    IF adapter_result != OK THEN
        RETURN REJECT("adapter does not match parent identity", adapter_result)
    END IF

    runtime.APPLY_ADAPTER_DELTA(adapter_bytes)
    evidence <- RUN_EVAL_CASES(runtime, eval_cases)
    diagnostics <- READ_DIAGNOSTICS(runtime)

    RETURN BUILD_RELEASE_PACKET(
        parent_model_digest = HASH(model_bytes),
        adapter_digest = HASH(adapter_bytes),
        eval_evidence = evidence,
        diagnostics = diagnostics
    )
END PROCEDURE

What the runtime does not imply

A local runtime is not automatically a safe or production-ready system. It is an execution substrate. ModelBreeder still requires package identity, frozen eval cases, diagnostics, lineage, scorecards, release packets, and human review for consequential use.

Implementation implication

The next site milestone should add mock .slm package metadata, sample adapter manifests, sample eval-case files, and a generated release packet so readers can see the full loop without downloading real model weights.

Source reports used for this guide

These reports are preserved verbatim in the site archive. The guide above is an editorial synthesis and may narrow, qualify, or reorganize claims from the source material.