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

SLM model package and adapter ABI

A deployable package contract for local model breeding: SLM headers, tokenizer identity, tensor layouts, quantization modes, adapter deltas, and eval sidecars.

Research statusImplementation synthesis from TinyRustLM source Publication statePublished Reviewed byMichael Kappel Source reports4

Direct answer

A model-breeding package needs an ABI, not just a filename. In this site, the .slm package and adapter ABI define the minimum identity needed to decide whether a model can be loaded, whether an adapter can attach, whether a merge is valid, and whether an evaluation result belongs to the exact artifact being released.

Required package identity

FieldWhy it matters
model_magic and versionPrevents accidental parsing of the wrong binary format.
model_type and architecture dimensionsConfirms the runtime knows how to execute the artifact.
tokenizer offset, length, and checksumEnsures prompt/token interpretation matches the adapter and eval cases.
tensor directory offset and tensor countProvides the index of named tensors and their storage layout.
tensor dtype and quantization block sizeChooses the correct matvec path and memory profile.
tensor-layout checksumMakes adapter compatibility checkable.
model checksumAnchors lineage, diagnostics, release packets, and rollback.

Adapter-delta identity

The uploaded runtime uses three adapter-delta package families:

MagicPayloadUse case
ADP1Dense f32 deltasSmall test adapters or full tensor experiments.
ASP1Sparse f32 index/delta pairsCompact changes where only a minority of weights move.
ALR1Low-rank f32 factorsLoRA-like descendants and compact task overlays.

Every adapter must match the loaded model identity. The compatibility check is an engineering expression of lineage integrity.

pseudocode
FUNCTION validate_adapter_against_model(adapter, model)
    REQUIRE adapter.tensor_count == model.tensor_count
    REQUIRE adapter.flags == model.flags
    REQUIRE adapter.parameter_count == model.parameter_count
    REQUIRE adapter.tensor_layout_checksum == model.tensor_layout_checksum
    REQUIRE adapter.tokenizer_checksum == model.tokenizer_checksum

    FOR each tensor_payload IN adapter.payloads
        REQUIRE tensor_payload.tensor_identity == model.tensor_identity
        REQUIRE tensor_payload.values_are_finite
        REQUIRE tensor_payload.shape_matches_model_tensor
    END FOR

    RETURN OK
END FUNCTION

Eval sidecar contract

A release packet should not say “better” without naming the evidence.

pseudocode
STRUCT EvalSidecar
    model_digest
    adapter_digest
    source_kind
    evaluator_id
    eval_cases_digest
    evaluation_scope
    cases_passed
    cases_failed
    decision
    generated_at_utc
END STRUCT

The sidecar does not replace human review. It gives review a stable target: this exact model, this exact adapter stack, this exact eval file, this exact runtime, and this exact result.

Why this belongs on the site

The ABI turns metaphor into build discipline. Parentage becomes hashes. Compatibility becomes checksums. Fitness becomes eval sidecars. Resource closure becomes diagnostics. Release becomes alias movement with rollback.

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.