tokcalc MCP Server

v0.3.4
io.github.stevecrates489-commits/tokcalc Checked 3 days ago Published 1 month ago

LLM serving capacity planner: VRAM, KV cache, GPU topology, latency, and cost.

A 89/100 Discovery passed License not confirmed AI & MLCloud

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.

ParameterTypeDescription
gpu *stringCanonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown.
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
batchSizeinteger
cacheHitRatenumberFraction of requests that hit the prefix cache (0–1).
cachePrefixTokensintegerReusable prefix length (system prompt + RAG context) that is cached across requests.
contextTokensintegerFull 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.
continuousBatchingboolean
continuousBatchingMultipliernumber
enginestring
gpuCountinteger
kvQuantizationstringKV 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.
outputTokensinteger
promptTokensinteger
quantizationstring
reasoningTokensinteger
speculativeBoostnumberSpeculative decoding speedup multiplier (default 2.0 when useSpeculative is true).
useSpeculativebooleanModel 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.

ParameterTypeDescription
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
batchSizeinteger
gpuCountinteger
gpusarrayRestrict comparison to specific GPU IDs (e.g. ['h100-sxm','h200-sxm']). Use list_gpus first to find IDs.
limitinteger
outputTokensinteger
promptTokensinteger
quantizationstring
sortBystring

recommend_topology

Recommend feasible GPU/topology designs including tensor parallelism and context parallel (RingAttention) when needed.

ParameterTypeDescription
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
batchSizeinteger
contextTokensintegerContext length to size the KV cache for. Must not exceed the model's maxContext — call list_models to check.
quantizationstring

estimate_api_vs_self_host

Compare monthly token-based API costs with self-hosted GPU infrastructure under stated utilization assumptions.

ParameterTypeDescription
gpu *stringCanonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown.
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
apiInputPricenumber
apiModelstring
apiOutputPricenumber
gpuCountinteger
inputTokensinteger
outputTokensinteger
quantizationstring
requestsPerDayinteger
utilizationnumber

list_models

List tokcalc-supported model IDs and metadata. Use before estimating if the requested model is ambiguous or unknown.

ParameterTypeDescription
categorystring
familystringFilter by model family (e.g. 'Llama', 'Qwen')
isMoEboolean

list_gpus

List GPU and cloud SKU IDs, memory, bandwidth, pricing, and categories.

ParameterTypeDescription
categorystring
minVramGbnumber
vendorstringFilter 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.

ParameterTypeDescription
gpuModelstringFilter by GPU model substring (e.g. 'H100', 'H200', 'A100')
scenariostringFilter by MLPerf scenario
workloadstringFilter 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.

ParameterTypeDescription
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
batchSizeintegerConcurrent requests the config must hold simultaneously.
contextTokensintegerContext length the workload must serve.
maxCostPerMillionnumberHard ceiling on $/M output tokens. Configs above it are excluded.
maxTtftMsnumberHard ceiling on time-to-first-token in ms. Configs above it are excluded.
minTokensPerSecondnumberMinimum aggregate tok/s the config must deliver at the given batchSize.
quantizationstring
requestsPerDayintegerExpected daily request volume (drives the monthly cost estimate).
sortBystring

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.

ParameterTypeDescription
gpu *stringCanonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown.
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
apiInputPricenumber
apiModelstring
apiOutputPricenumber
batchSizeinteger
continuousBatchingboolean
continuousBatchingMultipliernumber
enginestring
gpuCountinteger
outputTokensinteger
promptTokensinteger
quantizationstring
reasoningTokensinteger
requestsPerDayinteger

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.

ParameterTypeDescription
modelId *stringtokcalc model ID (e.g. 'qwen3-32b'). Call list_models first if unknown.
forceRefreshbooleanBypass the 24h cache and re-fetch from HuggingFace.
hfRepostringHuggingFace 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.

ParameterTypeDescription
gpu *stringCanonical tokcalc GPU ID (e.g. 'h100-sxm'). Call list_gpus first if unknown.
model *stringCanonical tokcalc model ID (e.g. 'llama3-8b'). Call list_models first if unknown.
observed *objectMeasured values from your serving run (vLLM logs, benchmark harness, etc.). At least one field.
batchSizeinteger
enginestring
gpuCountinteger
notesstring
outputTokensinteger
promptTokensinteger
quantizationstring
sourcestringWhere the measurement came from (e.g. 'vllm bench_serving, 2026-09-28').