"Running AI" covers two needs that call for very different servers. An app that calls a model through an API is sized like any web application; a model running on the server itself is sized by its memory first. This guide separates the two cases, gives the footprint of common models and shows how to calculate it.
Most applications that "use AI" (assistants, agents, summaries, data extraction, document search) call a model hosted by its provider, through an API. The computing happens there; your server builds the request, waits for the answer and processes it. It is sized like any web application: by its language, its database and its number of concurrent users.
The other case is a model running on the server itself, with Ollama, llama.cpp or a Python library. The reasons are familiar: data that stays on your own infrastructure, a fixed cost whatever the number of requests, background processing of large volumes, a specialised model. Here the whole model has to fit in memory, and it sets the size.
| What the server does | The deciding resource | Starting point |
|---|---|---|
| Calls a model through an API (assistant, agent, chatbot) | Application memory | 2 vCPUs, 4 GB |
| Also computes embeddings and queries a vector database (pgvector) | Memory for vectors and their index | 2 to 4 vCPUs, 6 to 8 GB |
| Runs a small 1 to 4 billion parameter model for background jobs | Memory, then CPU | 4 vCPUs, 8 GB |
| Runs a 7 to 8 billion parameter model for a few users | Memory and its bandwidth | 6 to 8 vCPUs, 16 GB |
| Runs a 12 to 14 billion parameter model with long context | Memory | 8 vCPUs, 24 GB |
A call to a hosted model takes from one to several tens of seconds, especially when the answer is streamed. During that time your server computes almost nothing: it waits. What matters is its ability to keep many requests waiting without blocking the rest:
proxy_read_timeout).The memory to plan for is that of the application and its database: 4 GB covers a Python or Node.js app with PostgreSQL at launch. A common setup, a Next.js front end, a FastAPI backend and a PostgreSQL database calling a model through an API, fits in 6 to 8 GB, front-end build included.
An app that searches your documents (RAG, retrieval-augmented generation) turns each passage into a vector, then finds the ones closest to a question. Two things to size:
pgvector’s halfvec type stores each dimension in 2 bytes instead of 4: half the memory, with search quality that stays very close.
A language model is a file of weights, loaded entirely into memory to answer. Its size depends on the number of parameters and on quantisation, the precision each weight is stored at. The GGUF format used by llama.cpp and Ollama offers quantisations from 2 to 16 bits; Q4_K_M, at around 4 bits, is the usual trade-off between size and quality.
| Model size | Examples | 4-bit (Q4_K_M) | 8-bit (Q8_0) | 16-bit |
|---|---|---|---|---|
| 1 to 3 billion parameters | Llama 3.2 3B, Qwen2.5 3B | 1 to 2 GB | 1.3 to 3.5 GB | 2.5 to 6.5 GB |
| 7 to 8 billion | Mistral 7B, Llama 3.1 8B, Qwen2.5 7B | 4.4 to 5 GB | 7.7 to 8.5 GB | 14.5 to 16 GB |
| 12 to 14 billion | Mistral Nemo 12B, Qwen2.5 14B | 7.5 to 9 GB | 13 to 16 GB | 25 to 30 GB |
| 32 billion | Qwen2.5 32B | about 20 GB | about 35 GB | about 65 GB |
| 70 billion | Llama 3.3 70B | about 43 GB | about 75 GB | about 140 GB |
On top of the weights come two more items:
Worked example. Llama 3.1 8B at 4 bits, two concurrent 8,000-token conversations and a small application: 5 GB of model, 2 GB of context, 2 GB for the app and the OS, so 9 GB, and about 12 GB with 25% headroom.
To produce each token, the model reads all of its weights from memory. On CPU, generation speed is therefore bounded by memory bandwidth more than by core count: a 5 GB model on a machine that reads 25 GB per second tops out around 5 tokens per second, before any computation is counted.
Two phases behave differently:
In practice, on a few vCPUs, a 7 to 8 billion parameter model at 4 bits produces a few tokens per second. That is comfortable for background work (sorting messages, extracting fields from documents, summarising overnight what came in during the day) and for an internal assistant. Interactive use at scale, and models with tens of billions of parameters, run on GPUs.
Measure to be sure: llama-bench, shipped with llama.cpp, reports the speed of both phases on your server, for your model.
llama-bench -m model-Q4_K_M.gguf -p 512 -n 128
A model takes roughly as much disk as memory: 5 GB for an 8 billion parameter model at 4 bits. Leave room for two or three models or versions, vector indexes, source documents and the database. An NVMe SSD loads a model in seconds when the service starts, which counts every time it restarts.
As a rule of thumb: 50 GB for an app that calls a model through an API, 80 to 120 GB once a model and its documents live on the server.
With Ollama, getting started takes two commands:
curl -fsSL https://ollama.com/install.sh | sh
ollama run llama3.1:8b
By default Ollama listens on 127.0.0.1:11434, which means only from the server itself. Keep it that way: its API has no authentication, and an instance left open to the internet serves anyone, on your resources. Your application, on the same server, talks to it locally; if another server needs it, go through a proxy that authenticates requests, or a private network.
Then set the context size (num_ctx) to what your requests actually need: it is what makes memory grow, conversation by conversation.
VPS Pro runs on Intel Xeon processors, ECC memory and mirrored NVMe SSDs, with root access to install Ollama, llama.cpp, pgvector or your own stack. Full-Stack Assistance is included: tell us about your project, API or model on the server, and we recommend the size, then we diagnose every question and tell you what to do, from the operating system down to your application code.
Yes. llama.cpp and Ollama run quantised models on CPU. A 7 to 8 billion parameter model at 4 bits needs about 5 GB of memory and produces a few tokens per second on a few vCPUs, which suits background jobs and internal assistants.
About 5 GB for the model at 4-bit quantisation (Q4_K_M), plus 1 GB per 8,000-token conversation, plus the application and the operating system. An 8 GB server runs the model on its own; 16 GB leaves room for the app, the database and several conversations.
An API gives access to the most capable models with no special server, at a cost per request. A model on your server keeps data in-house and fixes the cost, with a more compact model. Many applications combine both: embeddings and sorting on the server, writing through an API.
About 50 GB for an app that calls a model through an API. Once a model lives on the server, plan for 80 to 120 GB: an 8 billion parameter model at 4 bits weighs 5 GB, and you often keep several versions, along with documents and their vector indexes.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.