tokcalc MCP Server
v0.3.4LLM serving capacity planner: VRAM, KV cache, GPU topology, latency, and cost.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
estimate_capacity
Estimate whether an LLM-serving configuration fits in memory and can meet throughput and latency targets. Returns VRAM/KV-cache breakdown, throughput and latency ranges, concurrency, cost, confidence, assumptions, and sources.
| Parameter | Type | Description |
|---|---|---|
gpu * | string | Canonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown. |
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
batchSize | integer | |
cacheHitRate | number | Fraction of requests that hit the prefix cache (0–1). |
cachePrefixTokens | integer | Reusable prefix length (system prompt + RAG context) that is cached across requests. |
contextTokens | integer | Full context length for KV cache computation (e.g., 8192 for RAG). If omitted, KV is computed for promptTokens only. Must not exceed the model's maxContext — call list_models to check. |
continuousBatching | boolean | |
continuousBatchingMultiplier | number | |
engine | string | |
gpuCount | integer | |
kvQuantization | string | KV cache dtype: fp16 (2 B/value), int8 (1 B) or int4 (0.5 B). Lower precision quarters KV size — decisive at 128K+ context. vLLM supports --kv-cache-dtype fp8; llama.cpp q8_0/q4_0. |
outputTokens | integer | |
promptTokens | integer | |
quantization | string | |
reasoningTokens | integer | |
speculativeBoost | number | Speculative decoding speedup multiplier (default 2.0 when useSpeculative is true). |
useSpeculative | boolean | Model speculative decoding (draft model accepts ~2x tokens per step). |
compare_gpus
Compare supported GPU or cloud SKU options for the same LLM workload. Use before recommending hardware.
| Parameter | Type | Description |
|---|---|---|
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
batchSize | integer | |
gpuCount | integer | |
gpus | array | Restrict comparison to specific GPU IDs (e.g. ['h100-sxm','h200-sxm']). Use list_gpus first to find IDs. |
limit | integer | |
outputTokens | integer | |
promptTokens | integer | |
quantization | string | |
sortBy | string |
recommend_topology
Recommend feasible GPU/topology designs including tensor parallelism and context parallel (RingAttention) when needed.
| Parameter | Type | Description |
|---|---|---|
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
batchSize | integer | |
contextTokens | integer | Context length to size the KV cache for. Must not exceed the model's maxContext — call list_models to check. |
quantization | string |
estimate_api_vs_self_host
Compare monthly token-based API costs with self-hosted GPU infrastructure under stated utilization assumptions.
| Parameter | Type | Description |
|---|---|---|
gpu * | string | Canonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown. |
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
apiInputPrice | number | |
apiModel | string | |
apiOutputPrice | number | |
gpuCount | integer | |
inputTokens | integer | |
outputTokens | integer | |
quantization | string | |
requestsPerDay | integer | |
utilization | number |
list_models
List tokcalc-supported model IDs and metadata. Use before estimating if the requested model is ambiguous or unknown.
| Parameter | Type | Description |
|---|---|---|
category | string | |
family | string | Filter by model family (e.g. 'Llama', 'Qwen') |
isMoE | boolean |
list_gpus
List GPU and cloud SKU IDs, memory, bandwidth, pricing, and categories.
| Parameter | Type | Description |
|---|---|---|
category | string | |
minVramGb | number | |
vendor | string | Filter by vendor (e.g. 'NVIDIA', 'AMD') |
get_mlperf_benchmarks
Retrieve curated MLPerf Inference v4.1 LLM benchmark reference configurations. Throughput is computed by tokcalc formulas (confidence_tier=derived). Use to cross-validate theoretical estimates against audited system configurations.
| Parameter | Type | Description |
|---|---|---|
gpuModel | string | Filter by GPU model substring (e.g. 'H100', 'H200', 'A100') |
scenario | string | Filter by MLPerf scenario |
workload | string | Filter by model ID substring (e.g. 'llama3-70b', 'llama3-8b') |
find_config_for_slo
INVERSE planner: given model + context + traffic volume + optional TTFT/cost/throughput ceilings, search every GPU × topology (1/2/4/8 GPUs) and return feasible configurations ranked by cost, throughput, or value. Use when the user knows their SLOs but not the hardware.
| Parameter | Type | Description |
|---|---|---|
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
batchSize | integer | Concurrent requests the config must hold simultaneously. |
contextTokens | integer | Context length the workload must serve. |
maxCostPerMillion | number | Hard ceiling on $/M output tokens. Configs above it are excluded. |
maxTtftMs | number | Hard ceiling on time-to-first-token in ms. Configs above it are excluded. |
minTokensPerSecond | number | Minimum aggregate tok/s the config must deliver at the given batchSize. |
quantization | string | |
requestsPerDay | integer | Expected daily request volume (drives the monthly cost estimate). |
sortBy | string |
plan_deployment
One-call deployment decision brief for a specific config: memory breakdown with KV headroom, performance, rig cost, blended build-vs-buy with break-even, concrete risks (no-NVLink TP, tight headroom, long context), and next steps. Chains what would otherwise take 4 separate tool calls.
| Parameter | Type | Description |
|---|---|---|
gpu * | string | Canonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown. |
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
apiInputPrice | number | |
apiModel | string | |
apiOutputPrice | number | |
batchSize | integer | |
continuousBatching | boolean | |
continuousBatchingMultiplier | number | |
engine | string | |
gpuCount | integer | |
outputTokens | integer | |
promptTokens | integer | |
quantization | string | |
reasoningTokens | integer | |
requestsPerDay | integer |
fetch_model_spec
Fetch a model's real config.json from HuggingFace and diff it against tokcalc's catalog (layers, KV heads, head_dim, vocab, max context). Catches catalog drift before it corrupts KV-cache math. Cached 24h locally; use forceRefresh to re-fetch. Works offline via cache fallback.
| Parameter | Type | Description |
|---|---|---|
modelId * | string | tokcalc model ID (e.g. 'qwen3-32b'). Call list_models first if unknown. |
forceRefresh | boolean | Bypass the 24h cache and re-fetch from HuggingFace. |
hfRepo | string | HuggingFace repo override (e.g. 'Qwen/Qwen3-32B'). Guessed from the catalog when omitted. |
record_measured
Record a real-world measurement (observed tok/s, TTFT, ITL) for a model+GPU+quantization cell. Compares against the model's prediction, stores a measured/predicted ratio, and future estimate_capacity / find_config_for_slo results for that cell are annotated with your calibration. The estimator improves as you use it.
| Parameter | Type | Description |
|---|---|---|
gpu * | string | Canonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown. |
model * | string | Canonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown. |
observed * | object | Measured values from your serving run (vLLM logs, benchmark harness, etc.). At least one field. |
batchSize | integer | |
engine | string | |
gpuCount | integer | |
notes | string | |
outputTokens | integer | |
promptTokens | integer | |
quantization | string | |
source | string | Where the measurement came from (e.g. 'vllm bench_serving, 2026-09-28'). |