← Back to directory

Estimate the GPU memory needed to serve a model: weights by quantization, KV cac...

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

Overview

Estimate the GPU memory needed to serve a model: weights by quantization, KV cache by context and batch, compute buffer and overhead, each with its formula, plus a fit check.

Protocol x402 (POST)
Price $0.0030
Payment Asset USD Coin
Payment Network eip155:8453
Category uncategorized
Provider denk
Source bazaar
Indexed 2026-11-20 16:11:02

Health

Status unknown
Latency (p50) —
Uptime (30d) —
Reliability Score —
Last Checked Never
Last Healthy Never
Consecutive Failures 0

x402 Payment Validation

Payment Requirements —
Asset Verified —
Facilitator —

Input Schema

{ "body": { "context_tokens": 8192, "gpu": "rtx-4090", "head_dim": 128, "n_kv_heads": 8, "n_layers": 32, "params_b": 8.03, "quant": "Q4_K_M" }, "bodyType": "json", "method": "POST", "type": "http" }

Output Schema

{ "example": { "limitations": [ "Estimate by formula; real usage depends on the inference engine, its allocator and settings.", "Sliding-window and hybrid attention models need less KV cache than estimated (upper bound).", "Mixture-of-experts models must hold all experts in memory; this is included because the total parameter count is used." ], "result": { "assumptions": [ "GiB = 2^30 bytes; vendor memory sizes in \"GB\" are treated as GiB.", "Compute buffer and overhead are rough llama.cpp-style assumptions, not measurements.", "Bits per weight: llama.cpp tools/quantize/README.md (measured on Llama-3.1-8B)." ], "components_gib": { "compute_buffer": null, "kv_cache": 1, "overhead": 0.5, "weights": 4.575 }, "fit": { "capacity_gib": 24, "fits": true, "free_gib": 17.925, "gpu": "NVIDIA GeForce RTX 4090", "gpu_source": "https://images.nvidia.com/aem-dam/Solutions/geforce/ada/nvidia-ada-gpu-architecture.pdf (Appendix A)", "memory_gib_per_gpu": 24, "n_gpus": 1 }, "formulas": { "compute_buffer": "ubatch × (vocab_size + 4 × hidden_size) × 4 bytes", "kv_cache": "2 × n_layers × n_kv_heads × head_dim × context × batch × bytes_per_element", "overhead": "overhead_gib × n_gpus", "weights": "parameters × bits_per_weight / 8" }, "kv_cache_bytes_per_token": 131072, "model": { "attention": "mha", "head_dim": 128, "hidden_size": null, "n_kv_heads": 8, "n_layers": 32, "parameters": 8029999999.999999, "source": "input", "vocab_size": null }, "notes": [ "Compute buffer not estimated: vocab_size and hidden_size are unknown." ], "settings": { "batch": 1, "bits_per_weight": 4.8944, "bits_source": "llama.cpp tools/quantize/README.md (measured on Llama-3.1-8B)", "context_tokens": 8192, "kv_bytes_per_element": 2, "kv_cache_type": "f16", "quant": "Q4_K_M", "ubatch": 512 }, "total_gb": 6.523, "total_gib": 6.075 }, "service": "vram-estimate", "status": "success" }, "type": "json" }