Independent testing Checked regularly Curated self-hosting guides 5 VPS providers tested

comparison

Best VPS for AI Tools: API Agents vs Local Models

Compare Contabo, Hetzner and DigitalOcean for Dify, Open WebUI and Ollama based on inference location, GPU needs, persistent data and backups.

Last verified:

The best VPS for an AI tool depends on one question: does the server run the model, or only the application around it?

If Dify or Open WebUI calls an external model API, a normal CPU VPS can host the web app, database, vector store and workers. If Ollama runs the model locally, model size and context length determine the required GPU memory. Those are different purchases and should not share one generic ranking.

This comparison uses current product documentation. It does not claim that we ran a controlled provider benchmark. The Contabo, Hetzner and DigitalOcean links are affiliate links. SelfHostVPS may receive a commission if you order through them, at no additional cost to you. Compensation does not change the criteria below.

Quick answer

WorkloadSensible host shapeMain constraintProvider fit to inspect
Dify or Open WebUI with an external model APIGeneral-purpose VPSRAM for the app, database and workersContabo, Hetzner or DigitalOcean
Agent app with sustained CPU workDedicated or predictably allocated CPUWorker concurrency and database latencyHetzner dedicated CPU, or an equivalent current product
Local Ollama inferenceActual GPU instanceModel weights, context length and GPU memoryDigitalOcean GPU Droplet, Contabo GPU product, or another documented GPU host
App server plus remote inferenceCPU VPS and a separate GPU endpointNetwork privacy, latency and two recovery pathsAny general VPS here for the app layer
Large uploads or knowledge basesVPS plus explicitly backed-up persistent storageDatabase, vector data and uploaded filesCompare storage and backup boundaries, not headline disk size

Our practical default: use a general VPS for the application and an external API or separate GPU endpoint for inference. This keeps the stateful control plane inexpensive and lets you replace or scale the model backend independently. Put both layers on one machine only after a representative test proves that the chosen GPU, model and context fit.

First decide where inference happens

API-based agents and RAG applications

Dify documents a minimum of 2 CPU cores and 4 GiB of RAM for its Docker Compose deployment. That is an installation floor, not a capacity promise. Its current stack includes the application services plus PostgreSQL, Redis, a vector database, a sandbox and other dependencies. Real sizing depends on users, worker concurrency, document ingestion and the chosen vector store. See the Dify Docker Compose requirements.

Open WebUI does not contain a model. It connects to Ollama or another compatible provider. The endpoint you select determines where inference happens, while Open WebUI still needs persistent application data and a fixed secret key. The official Open WebUI quick start and provider connection guide explain that boundary.

For this architecture, pay for reliable application resources and a recoverable data layer. Buying a GPU for the web interface alone adds cost without moving inference onto that GPU.

Local models with Ollama

Local inference reverses the decision. Choose the model and usable context first, then the server. Ollama’s current context length guide says larger contexts require more memory and recommends at least 64k context for agents, web search and coding tools. Its GPU documentation lists the supported Nvidia and AMD paths.

Do not infer GPU access from a large vCPU count. Confirm that the exact product exposes a supported GPU and enough GPU memory. After deployment, ollama ps shows whether a model is loaded on GPU, CPU or both. A mixed or CPU-loaded model can be valid for a small experiment, but it is not evidence of acceptable interactive latency. Use the Ollama FAQ for the verification command and server settings.

Provider comparison by role

The order below is not a performance ranking. It maps documented product characteristics to the two architectures above.

Contabo: capacity-oriented application layer

Contabo documents its regular VPS products as KVM virtual machines with shared vCPU and fixed RAM. Its product families make different tradeoffs, and the storage-oriented line is described as capacity-focused rather than peak-I/O hosting. That can fit an AI control plane, document store or model cache when occasional CPU variation is acceptable. Read the current Contabo VPS product guide before choosing a family.

For local inference, select an explicitly documented GPU product. A high-RAM general VPS does not by itself provide GPU acceleration. For stateful deployments, also check whether the exact plan supports snapshots or the current automatic-backup add-on. Contabo describes the add-on as a separate off-server daily backup in its VPS automatic backup guide. You still need an application-consistent database backup and a tested restore.

Check current Contabo VPS and GPU products

Hetzner: choose shared or dedicated CPU deliberately

Hetzner separates shared-resource cloud plans from dedicated-resource CCX plans. Its Cloud server FAQ describes shared plans as a baseline with burst capacity and dedicated plans as the choice for sustained, predictable CPU use. That distinction is useful for Dify workers, document ingestion or busy agent services.

Standard cloud plans should be evaluated as an application layer, not assumed to provide a GPU. If persistent data moves to a Hetzner Volume, include that resource in a separate recovery plan. Hetzner states in its Volumes overview that Volumes are not included in server backups or snapshots and do not receive their own backups automatically.

Check current Hetzner shared and dedicated cloud plans

DigitalOcean: general Droplet or explicit GPU Droplet

A regular DigitalOcean Droplet can host Dify, Open WebUI or another agent control plane when inference happens elsewhere. DigitalOcean also offers distinct GPU Droplets for AI and machine-learning workloads. The GPU Droplet creation guide describes its AI/ML-ready image and the difference between persistent boot storage and nonpersistent scratch storage.

That storage boundary matters. DigitalOcean states that Droplet backups cover the boot disk but not attached Volumes or GPU scratch disks. Volumes need their own snapshot process, and scratch data must be reproducible or copied to persistent storage. See the GPU Droplet features and Volumes limits. GPU availability can also depend on account limits and region. Powered-off Droplets continue to incur compute charges until destroyed, according to the current Droplet pricing documentation.

Check current DigitalOcean Droplet and GPU options

A sizing method that avoids the usual mistake

1. Write down the inference path

Record whether every model call goes to an external API, a private remote endpoint or a model on this server. Include embeddings, reranking, speech and image generation. A local chat model does not make a stack fully local if embeddings or document extraction still call a cloud service.

2. Size the stateful application separately

List the web application, database, vector store, Redis, background workers, uploaded files and logs. Start from each project’s current minimum, then leave memory and disk headroom for ingestion and upgrades. Dify users should also review release notes before upgrading because its Compose procedure requires changes from new environment and Compose examples to be merged into an existing deployment.

3. Size local inference from the model outward

Decide the model, quantization, context length and number of simultaneous requests. Then choose enough compatible GPU memory. Do not use a provider’s vCPU and RAM table as a substitute for this calculation. Run representative prompts with the context and tools you expect in production, then confirm actual GPU placement with ollama ps.

4. Define four recovery sets

Treat these as separate assets:

  1. Deployment files, environment variables and secrets.
  2. Database, vector index, uploads and user state.
  3. Model weights and caches, noting which data can be downloaded again.
  4. External provider configuration, credentials and endpoint settings.

A snapshot is useful, but it is not a restore test. Restore into a separate instance and verify login, a known document retrieval, one model call and one background task. If attached storage is excluded from provider backups, protect it separately.

5. Compare the full monthly boundary

Use current provider calculators because plan names, availability and prices change. Include the VPS, GPU uptime, persistent volumes, snapshots, backup storage, outbound transfer and external model API usage. A split architecture can be cheaper when the GPU is needed only intermittently, but only your workload and billing pattern can prove that.

Which provider should you choose?

For a tool-specific decision, continue with our Dify VPS comparison, Open WebUI VPS comparison or Ollama VPS comparison. The full VPS comparison is useful only after you have chosen the architecture.

Frequently asked questions

Can a cheap VPS run AI tools?

Yes, when the VPS runs the interface, database or agent workflow and sends inference to an external model endpoint. A cheap general VPS is not automatically suitable for local inference. Local model performance depends on the model, context, quantization, concurrency and actual GPU access.

Do Dify and Open WebUI need a GPU?

Not for the application layer. They can run on a CPU VPS and connect to an external model provider or a separate Ollama server. A GPU is relevant on the machine that performs local inference.

Is more storage better than a faster CPU?

Only if storage is the current bottleneck. Knowledge bases and uploads need persistent capacity, while ingestion, database work and concurrent agents can need predictable CPU. Separate replaceable model caches from irreplaceable application data before comparing disk sizes.

How do I verify a VPS before committing to it?

Deploy the real stack with a representative data set. Test your expected context length, concurrent users, document ingestion and one restore. Measure response latency, memory pressure, disk use and whether the model actually stays on the GPU. Provider specifications alone cannot predict application-level performance.

Why are there no fixed prices in this comparison?

Cloud prices, plan names, regions and availability change. A stale price creates a false comparison. Use the provider links above to confirm the current offer, then compare the complete cost boundary rather than the entry price alone.