Skip to main content
Glama

Estimate local model memory

modelfinder_estimate_memory
Read-onlyIdempotent

Estimate local model memory from parameter count and precision, adding KV cache for context length and concurrency. Compare total against available GPU memory to choose a model or size hardware.

Instructions

Estimate the memory needed to run an open-weight model locally: weights at a given precision plus KV cache for a context length and concurrency (standard MHA/GQA attention only), with headroom against available memory. Use when choosing a local model or GPU. Give all four of layers, kv_heads, head_dim and context to include the KV cache; without them only weights are counted. Read-only and local: no network calls, no files written. Returns weights_gib, total_gib, headroom_gib and caveats.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "params_b": "<params_b>",
      "bits": "<bits>"
    },
    "name": "modelfinder_estimate_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
bitsYesEffective bits per weight: 16, 8, about 4.5 for common 4-bit formats.
layersNonum_hidden_layers from the model config.
contextNoContext tokens per sequence actually used.
kv_bitsNoKV cache precision in bits.
head_dimNohead_dim, or hidden_size / num_attention_heads.
kv_headsNonum_key_value_heads (or num_attention_heads if absent).
params_bYesTotal stored parameters in billions (for MoE, all experts).
concurrencyNoSequences served at once.
overhead_pctNoAllowance on top, in percent.
available_gibNoGPU or unified memory available, in GiB.
response_formatNomarkdown (default) for a readable summary, json for the full machine-readable result.markdown

Output Schema

NameRequiredDescriptionDefault
caveatsYes
total_gibYes
weights_gibYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.5

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive and openWorldHint=false, so the description only needs to add beyond that — and it does, calling out 'no network calls, no files written' and the important limitation of 'standard MHA/GQA attention only'. Listing the return fields is somewhat redundant given an output schema exists, so it falls short of the top score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense sentences that are front-loaded with the core operation and follow with the scoping rule, safety statement and return values. Nothing is filler, though the trailing list of return fields duplicates information already available in the output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter tool with full schema coverage, annotations and an output schema, the description supplies everything left open: the KV-cache parameter coupling, the attention-mechanism limitation, the local/offline behavior, and the shape of the result. An agent can select and invoke this confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description adds genuine cross-parameter meaning: layers, kv_heads, head_dim and context must all be supplied together to include the KV cache, otherwise only weights are counted. That dependency is not expressed in the schema and directly affects how an agent should fill in optional parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource — estimating memory for a local open-weight model — and enumerates the components counted (weights at a precision plus KV cache for a context length and concurrency). This is clearly distinct from the sibling modelfinder_estimate_cost, which is about cost rather than hardware memory.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states 'Use when choosing a local model or GPU', giving a concrete decision context. It does not explicitly name or exclude an alternative sibling, but the use case is unambiguous enough that an agent would not confuse it with the eval or cost tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.