What VPS do you need for AI? API calls or a model on the server

"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.

Published on 22 October 2026 By 10 minute read

All guides

In short

  1. First question: is the model called through an API (OpenAI, Anthropic, Mistral, Gemini) or run on your server? All the sizing follows from that.
  2. With an API, the server orchestrates: it is sized like a web app, and 4 GB of memory is often enough at launch.
  3. On the server, the model has to fit in memory: roughly 0.6 GB per billion parameters at 4-bit quantisation, plus the conversation context.
  4. On CPU, generation speed follows memory bandwidth: a model half the size answers about twice as fast.
  5. Embeddings, vector search, transcription and small classification models run very well on CPU.
  6. Keep the port of Ollama, or of any model server, closed to the internet: your application is the only thing that should talk to it.

Two needs, two server sizes

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 doesThe deciding resourceStarting point
Calls a model through an API (assistant, agent, chatbot)Application memory2 vCPUs, 4 GB
Also computes embeddings and queries a vector database (pgvector)Memory for vectors and their index2 to 4 vCPUs, 6 to 8 GB
Runs a small 1 to 4 billion parameter model for background jobsMemory, then CPU4 vCPUs, 8 GB
Runs a 7 to 8 billion parameter model for a few usersMemory and its bandwidth6 to 8 vCPUs, 16 GB
Runs a 12 to 14 billion parameter model with long contextMemory8 vCPUs, 24 GB

Through an API: size the application, not the model

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:

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 model on the server: memory comes first

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 sizeExamples4-bit (Q4_K_M)8-bit (Q8_0)16-bit
1 to 3 billion parametersLlama 3.2 3B, Qwen2.5 3B1 to 2 GB1.3 to 3.5 GB2.5 to 6.5 GB
7 to 8 billionMistral 7B, Llama 3.1 8B, Qwen2.5 7B4.4 to 5 GB7.7 to 8.5 GB14.5 to 16 GB
12 to 14 billionMistral Nemo 12B, Qwen2.5 14B7.5 to 9 GB13 to 16 GB25 to 30 GB
32 billionQwen2.5 32Babout 20 GBabout 35 GBabout 65 GB
70 billionLlama 3.3 70Babout 43 GBabout 75 GBabout 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.

On CPU: what sets the speed

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.

Terminal (llama.cpp): 512 prompt tokens, 128 generated tokens
llama-bench -m model-Q4_K_M.gguf -p 512 -n 128

Disk: models, versions, vectors

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.

Setting it up safely

With Ollama, getting started takes two commands:

Terminal
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.

A server sized for your AI project

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.

Explore VPS Pro

Frequently asked questions

Can you run an LLM without a GPU?

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.

How much RAM for Llama 3.1 8B or Mistral 7B?

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.

API or self-hosted model: which should I choose?

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.

How much disk does an AI server need?

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.

Contact us