Skip to content
HALOWERK

Denkwerk

vram estimate

Disclosed formulas: weights = parameters × bits per weight / 8 (llama.cpp file types use the effective bits measured on Llama-3.1-8B in tools/quantize/README.md, commit ad1b88c; data types FP32/FP16/FP8/INT8/INT4 their width); KV cache = 2 × layers × KV heads × head dimension × context × batch × bytes per element of the cache type (MLA models: layers × (kv_lora_rank + rope dim) × context × batch); compute buffer = ubatch × (vocabulary + 4 × hidden size) × 4 bytes as a llama.cpp-style.

POST https://denk.halowerk.com/v1/vram-estimate

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
hf_modelstringNoHugging Face model id; config.json and the safetensors parameter count are read from the Hub.
params_bnumberNoTotal parameters in billions (overrides the Hub value).
n_layersintegerNoNumber of transformer layers.
n_headsintegerNoAttention (query) heads.
n_kv_headsintegerNoKey/value heads (GQA); defaults to n_heads.
head_dimintegerNoDimension per head; defaults to hidden_size / n_heads.
hidden_sizeintegerNoModel width.
vocab_sizeintegerNoVocabulary size (for the compute buffer).
quantstringNollama.cpp file type (e.g. Q4_K_M) or data type FP32, FP16, BF16, FP8, INT8, INT4.
bits_per_weightnumberNoOverrides quant, e.g. 4.25 for INT4 with group size 128.
context_tokensintegerNo
batchintegerNoConcurrent sequences with their own KV cache.
kv_cache_typestringNo
ubatchintegerNoMicro-batch size for the compute buffer (llama.cpp default 512).
overhead_gibnumberNoFixed runtime overhead per GPU (CUDA context, allocator) – an assumption.
gpustringNoGPU for the fit check.
vram_gibnumberNoUsable memory per GPU in GiB (instead of gpu).
n_gpusintegerNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "hf_model": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,95}/[A-Za-z0-9][A-Za-z0-9._-]{0,95}$",
      "description": "Hugging Face model id; config.json and the safetensors parameter count are read from the Hub."
    },
    "params_b": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 5000,
      "description": "Total parameters in billions (overrides the Hub value)."
    },
    "n_layers": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000,
      "description": "Number of transformer layers."
    },
    "n_heads": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1024,
      "description": "Attention (query) heads."
    },
    "n_kv_heads": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1024,
      "description": "Key/value heads (GQA); defaults to n_heads."
    },
    "head_dim": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4096,
      "description": "Dimension per head; defaults to hidden_size / n_heads."
    },
    "hidden_size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 131072,
      "description": "Model width."
    },
    "vocab_size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2000000,
      "description": "Vocabulary size (for the compute buffer)."
    },
    "quant": {
      "type": "string",
      "enum": [
        "F32",
        "F16",
        "BF16",
        "Q8_0",
        "Q6_K",
        "Q5_K_M",
        "Q5_K_S",
        "Q5_1",
        "Q5_0",
        "Q4_K_M",
        "Q4_K_S",
        "Q4_1",
        "Q4_0",
        "Q3_K_L",
        "Q3_K_M",
        "Q3_K_S",
        "Q2_K",
        "Q2_K_S",
        "IQ4_NL",
        "IQ4_XS",
        "IQ3_M",
        "IQ3_S",
        "IQ3_XS",
        "IQ3_XXS",
        "IQ2_M",
        "IQ2_S",
        "IQ2_XS",
        "IQ2_XXS",
        "IQ1_M",
        "IQ1_S",
        "FP32",
        "FP16",
        "FP8",
        "INT8",
        "INT4"
      ],
      "default": "F16",
      "description": "llama.cpp file type (e.g. Q4_K_M) or data type FP32, FP16, BF16, FP8, INT8, INT4."
    },
    "bits_per_weight": {
      "type": "number",
      "minimum": 1,
      "maximum": 32,
      "description": "Overrides quant, e.g. 4.25 for INT4 with group size 128."
    },
    "context_tokens": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4194304,
      "default": 4096
    },
    "batch": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4096,
      "default": 1,
      "description": "Concurrent sequences with their own KV cache."
    },
    "kv_cache_type": {
      "type": "string",
      "enum": [
        "f32",
        "f16",
        "bf16",
        "fp8",
        "q8_0",
        "q5_1",
        "q5_0",
        "q4_1",
        "q4_0",
        "iq4_nl"
      ],
      "default": "f16"
    },
    "ubatch": {
      "type": "integer",
      "minimum": 1,
      "maximum": 65536,
      "default": 512,
      "description": "Micro-batch size for the compute buffer (llama.cpp default 512)."
    },
    "overhead_gib": {
      "type": "number",
      "minimum": 0,
      "maximum": 64,
      "default": 0.5,
      "description": "Fixed runtime overhead per GPU (CUDA context, allocator) – an assumption."
    },
    "gpu": {
      "type": "string",
      "enum": [
        "h100-sxm",
        "h100-nvl",
        "h200-sxm",
        "h200-nvl",
        "a100-80gb-sxm",
        "a100-80gb-pcie",
        "a100-40gb-sxm",
        "a100-40gb-pcie",
        "l40s",
        "l40",
        "l4",
        "a10",
        "t4",
        "rtx-a6000",
        "rtx-4090",
        "rtx-3090",
        "apple-m2-ultra",
        "apple-m4-max",
        "apple-m4-pro"
      ],
      "description": "GPU for the fit check."
    },
    "vram_gib": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 100000,
      "description": "Usable memory per GPU in GiB (instead of gpu)."
    },
    "n_gpus": {
      "type": "integer",
      "minimum": 1,
      "maximum": 64,
      "default": 1
    }
  }
}

Open original schema

Published input example

{
  "params_b": 8.03,
  "n_layers": 32,
  "n_kv_heads": 8,
  "head_dim": 128,
  "quant": "Q4_K_M",
  "context_tokens": 8192,
  "gpu": "rtx-4090"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →