Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Sizing CPU, Memory & Storage for Agentic AI Servers

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Agentic AI workloads—autonomous agents that plan, use tools, and iterate—stress servers differently than simple chatbots or batch inference. This guide walks you through sizing CPU cores, RAM, and storage for an on-premises or dedicated agentic AI server, covering the key bottlenecks and how to avoid them.

What You'll Need

  • Your expected workload profile: number of concurrent agents, average request rate, and typical task complexity.
  • Model details: parameter count (e.g., 7B, 70B), quantization level (FP16, INT8, INT4), and context window length.
  • Tool-calling frequency: how often agents invoke external APIs, search, or code execution.
  • Storage performance requirements: whether you need fast model loading, high-throughput logging, or large vector databases.

Step-by-Step

  1. Estimate the model memory footprint. For a dense transformer model, memory ≈ (parameters × bytes per parameter) + (context length × layers × hidden size × 2 bytes) + overhead. For a 70B model in FP16, that's ~140 GB just for weights. Use this as your baseline.
  2. Add memory for inference overhead. KV cache, activations, and framework overhead typically add 20–40% to the weight memory. For a 70B model, plan for 170–200 GB total GPU memory, or use CPU offloading if you have limited GPUs.
  3. Size CPU cores for orchestration and preprocessing. Agentic loops involve tokenization, tool-call parsing, and scheduling. A rule of thumb: 4–8 CPU cores per concurrent agent, plus 2–4 cores for the inference server itself. For 20 concurrent agents, start with 32–64 cores.
  4. Allocate system RAM for CPU offloading and data. If you offload layers to CPU (common with models >70B on single-node setups), you need RAM equal to the offloaded weights plus 20% overhead. Also reserve 8–16 GB for the OS, 4–8 GB for the inference framework, and 2–4 GB per agent for tool execution contexts.
  5. Choose storage for model weights. Use NVMe SSDs for the model directory to minimize cold-start load times. A 70B FP16 model is ~140 GB; loading from a 3.5 GB/s NVMe takes ~40 seconds, versus minutes from a SATA SSD.
  6. Plan storage for logs and traces. Agentic systems generate verbose logs—each step, tool call, and thought. Estimate 1–5 MB per agent task. If you process 10,000 tasks/day, that's 10–50 GB/day. Use high-capacity HDDs or SSDs for this, separate from the model drive.
  7. Size vector database storage if used. For retrieval-augmented agents, estimate embedding size (e.g., 1,536 floats per chunk for OpenAI-style embeddings, ~6 KB per chunk) times the number of chunks. Add 50% overhead for indexes and metadata. A 1M-chunk store needs roughly 6–10 GB.
  8. Account for multi-agent concurrency. If agents run in parallel, multiply CPU and RAM estimates by the concurrency factor. But remember, the inference server (GPU) is often the bottleneck—size CPU/RAM to keep it fed, not to exceed it.
  9. Use a sizing formula. Start with: Total CPU cores = (concurrent agents × 4) + (inference server cores). Total RAM = (offloaded weights × 1.2) + (agents × 2 GB) + 16 GB. Storage = model size + (tasks/day × avg log size × retention days) + vector DB size.
  10. Validate with a proof-of-concept. Before buying, run a load test with your actual model and agent framework. Measure CPU utilization, memory pressure, and storage I/O. Adjust your estimates based on real data.

Common Mistakes

  • Underestimating KV cache memory. Long context windows (32k+ tokens) can double memory usage. Always size for the maximum context length you plan to support.
  • Ignoring CPU bottlenecks. Agentic loops are CPU-heavy due to tokenization and JSON parsing. A powerful GPU can sit idle if CPUs are pegged.
  • Using HDDs for model storage. Cold starts become painfully slow. Always use NVMe for model weights.
  • Forgetting swap space. If RAM is tight, the OS will swap, causing severe latency. Plan for at least 8 GB swap as a safety net.
  • Overprovisioning storage for logs. Logs can grow exponentially if not rotated. Set up log rotation and retention policies before you run out of space.

Tips

  • Use quantization to reduce memory. INT4 quantization can cut model memory by 4x, but may degrade output quality—test with your tasks.
  • Consider CPU offloading for models larger than GPU memory. It's slower but allows running 70B+ models on a single node.
  • Monitor with tools like nvidia-smi, htop, and iostat during the proof-of-concept to identify real bottlenecks.
  • For multi-node setups, factor in network bandwidth for tensor parallelism—InfiniBand or 100GbE is recommended.
  • Keep the OS and model on separate drives to avoid I/O contention.

Troubleshooting

  • Out-of-memory errors: Reduce batch size, lower context length, or enable memory-efficient attention (e.g., FlashAttention). If persistent, add RAM or use CPU offloading.
  • High CPU usage with low GPU utilization: Your tokenizer or tool-call parser is likely the bottleneck. Optimize the agent loop, use a faster tokenizer (e.g., HuggingFace's fast tokenizers), or increase CPU cores.
  • Slow model loading: Enable model caching, use mmap for weight loading, or pre-load the model at server start. If using HDD, move to NVMe.
  • Storage fills up unexpectedly: Check log rotation settings, and set up alerts for disk usage. Purge old vector indexes and logs.
  • Latency spikes under load: Check for swap usage, disk I/O wait, and network bottlenecks. Scale horizontally or increase resources.

Frequently Asked Questions

Q: Can I run agentic AI on CPU only?
A: Yes, for small models (≤7B) with quantization, but latency will be high. For production, GPUs are recommended.

Q: How much RAM do I need for a 7B model?
A: In FP16, ~14 GB for weights plus ~4-8 GB for overhead. With INT4, ~4 GB for weights.

Q: What's the best storage type for vector databases?
A: NVMe SSD for performance. HDDs work for small datasets but will bottleneck as the index grows.

Q: Should I size for peak or average load?
A: Size for peak, but use autoscaling if possible. Under-provisioning causes crashes; over-provisioning wastes money.

Q: How do I estimate the number of concurrent agents I can support?
A: Divide your GPU memory by the per-request memory footprint. For a 70B model on 4×A100 (320 GB), you might support 10-20 concurrent agents with 4k context.

Q: Is CPU offloading worth it?
A: It allows running larger models, but adds latency. Use it for batch processing or when GPU memory is insufficient.