🚀 One API for every frontier model on FastInfra

Browse models

Transparent per-token pricing → compare providers on FastInfra

View pricing

OpenAI-compatible chat completions → start in minutes

Read the docs

⚡ Server Auction → Enterprise bare metal from $78.15/mo (173 in stock)

Browse deals

Cloud VPS for AI backends: sizing, setup and cost for the server that sits in front of the model

A cloud VPS for AI backends is the ordinary Linux server that handles authentication, rate limiting, retrieval, prompt assembly and streaming between your users and the model API; it needs modest CPU and RAM and reliable network, not a GPU. On FastInfra CPU Cloud, 25 plans are billed per minute from $0.0104/hr (about $6.47/month always on). This guide covers sizing by concurrency, the setup that holds up in production, and how to keep the bill proportional to use.

What the backend actually does

Between a browser and an LLM there is a service that holds the API key, checks the user's session, enforces per-user limits, pulls context from a database or vector store, assembles the prompt, calls the model and relays the stream back. None of that is compute-heavy; the server spends most of its time waiting on sockets. That has two consequences for sizing: CPU matters less than the number of connections you can hold open, and memory per connection (the buffered stream plus request state) sets the ceiling. The CPU Cloud plans are the right class of machine for this; GPUs belong on the model side.

Sizing by concurrency

Starting points for an I/O-bound AI API server
Concurrent active streamsvCPURAMNotes
Up to 501–22 GBSide projects, internal tools, staging
50–30024 GBMost production SaaS features; one Node or Uvicorn process per vCPU
300–1,00048 GBAdd a local Redis for rate limits and session cache
1,000+2 × (4 vCPU / 8 GB)—Two servers behind a load balancer for redundancy before going bigger

A streamed completion occupies a connection for the whole generation (seconds to a minute), so "concurrent" means users mid-answer, not requests per second. Memory per open stream is small (tens of kilobytes) unless you buffer whole responses; relay chunks as they arrive. The live plan list with current prices is below.

Cloud VPS plans on FastInfra CPU Cloud (lowest-priced region per plan)
PlanvCPURAMDisk$/hour$/month
CPX 1122 GB40 GB$0.0104$6.47
CX 2324 GB40 GB$0.0113$7.01
CAX1124 GB40 GB$0.0121$7.55
CX 3348 GB80 GB$0.0173$10.79
CPX 2134 GB80 GB$0.0191$11.87
CAX2148 GB80 GB$0.0216$13.49
CPX 1212 GB40 GB$0.0234$14.57
CX 43816 GB160 GB$0.032$19.97
CPX 3148 GB160 GB$0.0355$22.13
CPX 2224 GB80 GB$0.0398$24.83
CAX31816 GB160 GB$0.0432$26.99
CX 531632 GB320 GB$0.0606$37.79

Why per-minute billing suits this workload

Production servers run all month, but the servers around them do not: staging, per-branch preview environments, load-test targets and one-off migration boxes live for hours. With per-minute billing a preview environment that exists for a four-hour review costs four hours, and the cheapest plan runs at $0.0104 per hour. The discipline is the same as with GPU pods: create from a script, destroy from the same script. The always-on production figure for the smallest plan is about $6.47 per month, which sets a floor for the architecture: at that price there is no reason to co-host your database and your API on one box.

A setup that holds up

  1. Image. Ubuntu 24.04 LTS or Debian 12; both are offered at deploy time. Pick LTS and enable unattended security upgrades.
  2. Access. SSH keys only, password login off, a non-root deploy user, and ufw allowing 22, 80 and 443.
  3. Runtime. Docker with Compose, one container per service: API, reverse proxy, optional Redis. Pin image tags.
  4. Reverse proxy. Caddy or Nginx terminating TLS, forwarding to the API with buffering disabled on the streaming routes so server-sent events pass through immediately.
  5. Secrets. The FastInfra API key in an environment file readable only by the deploy user; never in the image.
  6. Observability. Structured request logs with the model id, token usage from the usage block and time to first token; ship them off-box.

Disable proxy buffering deliberately: with buffering on, Nginx holds the entire streamed response and the user sees nothing until the model finishes, which defeats streaming.

Latency: where the time goes

A typical streamed request spends 50–200 ms in your backend (auth, retrieval, prompt assembly), then waits on the model API for time to first token, then relays tokens as they arrive. The model dominates. Placing the VPS near your users minimises the round trips you control: TLS handshake, the first request byte, and the chunk relay. Keeping a connection pool warm to the API host removes a handshake per request. Beyond that, latency improvements come from the model choice on the pricing page, not from a larger server.

Scaling up versus out

The first bottleneck is usually the single process, not the machine: run one worker per vCPU (Gunicorn with Uvicorn workers, or Node cluster mode) before resizing. The second is redundancy: two small servers behind a load balancer survive a reboot; one large server does not. Move state out of the box early — sessions and rate-limit counters in Redis, documents in a managed or dedicated database server — so that adding a second API node is a config change.

A cost sketch

Production: two 2 vCPU / 4 GB nodes always on. Staging: one node, business hours only (about 220 hours). Preview environments: ten per month at four hours each. The variable items add up to roughly a third of one always-on node, and the whole stack stays far below the cost of a single idle GPU hour per day. The CPU cloud guides cluster continues with hardening and sizing for specific runtimes.

Deploying and updating without downtime

With Docker Compose on the VPS, a zero-downtime deploy is a pull and a rolling restart: start the new API container on a second port, point the reverse proxy at it, then stop the old one. Health-check the new container by making a real request to a free-tier model through it, so the deploy verifies the FastInfra key, network path and streaming relay in one go rather than just that the process started. Keep the previous image tag so a rollback is one command.

Secrets rotate the same way: create a new API key in the console, update the environment file, roll the container, then delete the old key. Because the API accepts any active key for the account, the rotation is invisible to users. Schedule it, and schedule OS patching with unattended upgrades, so the security work on the box is routine rather than remembered.

Frequently asked questions

Do I need a GPU server to build an AI application?

No. The application server calls the model API over HTTPS and never runs the model. A small CPU VPS handles authentication, retrieval, prompt assembly and streaming; GPUs are only needed if you host the model yourself.

How many users can a 2 vCPU / 4 GB VPS serve?

For an I/O-bound API that relays streamed completions, a few hundred concurrent active streams, which usually corresponds to thousands of daily active users. Measure open connections and memory under a load test to confirm.

Which operating systems are available?

Ubuntu 24.04 LTS, Ubuntu 22.04 LTS and Debian 12 are offered at deploy time. Choose an LTS release and enable unattended security upgrades.

Is per-minute billing more expensive than a monthly plan if I run 24×7?

Running continuously costs the hourly rate times roughly 730 hours. The pricing is designed so the always-on monthly figure is in line with a monthly plan while short-lived servers cost only the minutes they exist.

Should the database live on the same VPS?

Not in production. Keep the API node stateless so you can add a second one, and put PostgreSQL or your vector store on its own server, managed service or dedicated machine with proper storage.

Last reviewed October 16, 2026 by FastInfra. Prices and counts on this page are refreshed from the live catalog on every load.