Skip to main content
Glama

llm-infra-calc banner

llm-infra-calc

Open LLM pricing/GPU registry, zero-dependency CLI, and MCP server for VRAM + KV-cache sizing, cloud API vs. self-hosted break-even, and PostgreSQL pgvector HNSW RAM estimation.

Back-of-the-envelope math is built on transparent JSON presets in data/ so your terminal, coding agents, and PRs stay in sync with real hardware and frontier API pricing.


Quick CLI Usage (Zero Install)

# 1. Size GPU + VRAM including KV-cache concurrency & Ollama vs. vLLM guidance
npx github:adamblansett/llm-infra-calc vram --model qwen-3-32b --quant q4_k_m --context 16384 --concurrency 12

# 2. Compare frontier API spend (with prompt caching) vs. dedicated GPU rent
npx github:adamblansett/llm-infra-calc api-cost --model claude-sonnet-4-5 --reqs 10000 --in 3000 --out 400 --cache 60

# 3. Estimate RAG chunks, pgvector HNSW RAM residency, and managed vector DB hosting
npx github:adamblansett/llm-infra-calc rag --docs 10000 --pages 10 --dims 1536 --queries 500000

# 4. List all supported models, quantizations, and GPU tiers
npx github:adamblansett/llm-infra-calc list

Related MCP server: OptimToken MCP

Use as an MCP Server (Claude Code, Cursor, Codex)

{
  "mcpServers": {
    "llm-infra-calc": {
      "command": "npx",
      "args": ["-y", "--package=github:adamblansett/llm-infra-calc", "llm-infra-calc-mcp"]
    }
  }
}

Exposed MCP Tools

Tool

What It Calculates

size_llm_gpu

Model weights + KV-cache under concurrent streams + CUDA overhead, GPU tier selection, payback months, Ollama vs. vLLM threshold

compare_api_vs_self_hosted

Monthly API cost with prompt cache hit rates (Claude Sonnet/Haiku 4.5, GPT-5/mini, Gemini 2.5 Pro/Flash, DeepSeek V3.2) + daily break-even volume

estimate_rag_pgvector

Total chunks, raw float32 size, pgvector HNSW RAM (~1.65x), ingestion embedding spend, and pgvector vs. managed vector DB hosting

list_llm_registry

Returns all open JSON presets (data/models-api.json, data/models-open.json, data/gpus.json)


Interactive Web Calculators & Architecture Help

Community PRs adding new open-weight models, GPU pricing tiers, or API updates in data/ are welcome—see CONTRIBUTING.md.

MIT © 2026 Adam Blansett

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables AI agents to compare AI model pricing plans, run cost scenarios, find break-even points, and get plan recommendations using TokenLens data.
      4
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to fetch live, dated prices for LLM models and cloud compute instances across providers, compare and recommend models, and estimate monthly costs based on workload-specific token shapes and constraints.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to list and compare LLM API prices per million tokens, rank the cheapest models by context and keyword, look up GPU rental rates per hour by provider, and estimate self-hosting cost per million tokens against API pricing. Pricing data comes from OpenRouter's public models endpoint plus a dated GPU price CSV, with source URLs and explicit notes when data is missing.
      5
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables agents to look up verified model retirement and deprecation dates with sources across Anthropic, OpenAI, Gemini, Bedrock and Mistral, analyze a local usage/cost export to explain spend drivers, and compare benchmark numbers with savings estimates and a drafted free-pilot request. Runs read-only and offline-capable, requiring no key, account, or telemetry.
      9
      MIT