API Token Sizing & Local Hardware Formulas

Switch seamlessly between cloud API budgeting and local self-hosted GPU sizing above. When comparing cloud plans, remember output tokens typically cost 3×–5× more than input tokens, while prompt caching cuts repeated context cost sharply.

  • English vs CJK Tokens: English averages ~1.33 tokens per word (~4 characters per token), whereas dense Chinese/Japanese text averages ~1.4–1.6 tokens per character depending on tokenizer vocabulary.
  • Local VRAM Sizing Rule of Thumb: A 4-bit quantized model (GGUF Q4_K_M / INT4) occupies roughly 0.6 GB × Billion Params for model weights, plus dynamic KV Cache memory that grows quickly at 32K–64K context windows.

Frequently Asked Questions

How accurate is the local GPU VRAM estimator for Ollama and vLLM?

It models parameter bit-width overhead plus quantization metadata and context KV Cache scaling, helping you judge whether 12 GB (RTX 3060), 16 GB (RTX 4080), 24 GB+ (RTX 4090), or Apple Silicon Unified Memory provides smooth headroom.

How much does prompt caching save on long-context workflows?

With shared system instructions or repository prefixes, verified cached input pricing across OpenAI, Anthropic, and DeepSeek often drops by 75%–95% on cached tokens. Toggle the 50% cache option above to simulate typical savings.