Skip to content

skainet-plan: model-footprint analysis for GGUF, safetensors and ONNX with a fits-in-RAM verdict #1169

Description

@michalharakal

There is no quick way to check whether a model will fit on an embedded device with limited memory and compute before a whole day is invested in converting it.

Goal

A standalone Kotlin/JVM CLI (extending skainet-apps/skainet-plan, the existing footprint tool) that:

  • analyzes GGUF, safetensors and ONNX model files from the header/metadata only — no payload load, seconds not hours;
  • reports the actual resident size of the model weights (as stored, and — where the format carries encodings — as they would be held after form resolution);
  • renders a verdict against a usable-RAM limit of ~2.1 GB (the embedded-device budget): fits / does not fit, with the margin and the planner's suggestions where they apply.

Notes

  • GGUF already works end to end (StreamingGGUFReader.planInput → resolveWeightForms → profile.plan().render()); the new work is the safetensors and ONNX front ends plus the budget flag/verdict ergonomics.
  • safetensors: the header is a JSON table of names/dtypes/shapes at the file start — header-only sizing is cheap.
  • ONNX: weights live in graph initializers; enumeration must avoid materializing tensor data.
  • No architecture metadata exists in safetensors/ONNX, so KV-cache/forward estimates are GGUF-only; for the other formats the verdict is weights + headroom, stated as such.

Acceptance

  • skainet-plan <file> auto-detects the format and prints the weights table + total + verdict for all three formats.
  • A budget flag (default ~2.1 GB for the embedded-device scenario, overridable) drives the fits/doesn't-fit line.
  • Header-only: analyzing a multi-GB file completes in seconds and never reads tensor payloads.
  • Tests per format with synthetic fixtures.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions