Use the sizeof.ai estimate API

Reproduce a memory estimate and handle uncertainty explicitly in your own tools.

Reviewed 2026-09-08 · Advanced

Start with an explicit testnet request

The public estimate endpoint describes model memory; it does not run the model or generate text. This example targets testnet, where the platform features are being validated.

Use the canonical owner/repository identifier. context uses 1024-token steps, vram is in GiB, and quant is a supported calculator identifier. q4_k_m is an estimate configuration, not a claim that the repository includes a verified GGUF artifact.

curl --fail-with-body --get "https://testnet.sizeof.ai/api/v1/estimate" \
  --data-urlencode "model=Qwen/Qwen2.5-1.5B-Instruct" \
  --data-urlencode "quant=q4_k_m" \
  --data-urlencode "context=4096" \
  --data-urlencode "vram=16"

Read the result state before the number

The response uses schema sizeof-estimate/v1. result.state can be estimate, lower-bound, or unavailable. Only an ordinary estimate can carry a normal fit classification. A lower bound does not establish that the model fits.

Keep evidence, provenance, configuration, generatedAt, and the disclaimer with exported results. Distinguish published artifact weight sizes from hypothetical precision estimates. Null values are unknown or inapplicable, not zero.

Make failure visible to callers

Check HTTP status before parsing a success payload. Invalid or duplicate parameters are rejected; upstream problems should remain visible rather than being turned into an empty success. Public estimates reject stale metadata rather than quietly publishing an outdated fit.

Cache responsibly, avoid retry loops, and use a small bounded retry only for transient failures. No availability guarantee or unlimited free quota is implied. For a real deployment decision, verify on the target hardware and runtime.

Original sources