🤖
Hosting

Server Requirements for AI Agent Apps: CPU, RAM and Architecture

18.11.2026
← All articles

An AI agent is more than a chatbot. It takes a task, calls a language model, reads a database when needed, uses external services and repeats several steps until it reaches a result. That is why choosing a server for an agent is not just a question of whether a website loads. You need to know how long a single task runs, how many users work at the same time and where the model itself is executed.

What the agent actually does on the server

Many people assume every AI application needs huge computing power, but that is often not the case. When the agent uses a hosted model API, the heavy computation happens on the provider's side, and your server mostly sends requests and waits for answers. CPU usage stays low, while long-lived connections, task queues and memory for conversation context become the real concerns. A single task can take tens of seconds or a few minutes, so the app must run as a persistent process rather than a script that exits with each request.

Where the model runs: API or your own server

This is the factor that shapes everything else. With a model API, small and medium projects usually run fine on a VPS with 2 vCPUs and 2-4 GB of RAM, since only the app code, the queue and the database live there. Running the model yourself changes the picture: even small quantized models need several gigabytes of memory, and a GPU or a strong CPU is required for usable speed. Exact numbers depend on the model size and quantization level, so check the documentation of the model you pick.

CriterionModel via APISelf-hosted model
CPULight load, 1-2 vCPUs often enoughMulti-core CPU or GPU needed
RAM2-4 GB for app and databaseMore than the model size
CostPay per requestServer rent, no per-request fees
PrivacyData is sent to the providerData stays on your server

Why shared hosting is not a good fit

Shared hosting is built for PHP sites: a browser sends a request, a script runs and returns a response within seconds. An agent needs an always-on background worker, a queue such as Redis, long open connections and Python or Node.js libraries you install yourself. In a shared environment such processes are killed by time limits or not allowed at all. A VPS with root access is the right choice, and you can order one from the sayt.uz cabinet and have it running in minutes.

Sizing memory, disk and network

Each Python or Node.js worker can use a few hundred megabytes of RAM, and more if it keeps large contexts or documents in memory. Decide how many tasks should run in parallel and set the number of workers accordingly. Logs, conversation history and vector indexes all go to disk and grow over time, so use SSD storage and configure log rotation. On the network side, the agent mostly makes outbound HTTPS calls to foreign APIs, so stable outgoing connectivity matters.

Example: an appointment agent for a Tashkent clinic

Imagine a private clinic in Tashkent that wants patients to book visits through Telegram. A patient writes "I want to see a cardiologist tomorrow", the agent reads free slots from PostgreSQL, suggests options and books the chosen time. A FastAPI app receives Telegram messages and pushes tasks to a Redis queue, while a separate worker talks to the model and writes to the database. A VPS with 2 vCPUs and 4 GB of RAM is enough to start, with the worker kept alive by systemd.

[Unit]
Description=Klinika AI agent worker
After=network.target redis-server.service

[Service]
User=agent
WorkingDirectory=/opt/klinika-agent
EnvironmentFile=/opt/klinika-agent/.env
ExecStart=/opt/klinika-agent/venv/bin/python worker.py
Restart=always
RestartSec=5
MemoryMax=1G

[Install]
WantedBy=multi-user.target

Save it as /etc/systemd/system/klinika-agent.service, enable the service and watch its logs. The MemoryMax line stops a runaway worker from eating all memory and slowing down the whole server.

sudo systemctl daemon-reload
sudo systemctl enable --now klinika-agent
journalctl -u klinika-agent -f

Nginx settings for long answers and streaming

When the agent streams its answer in chunks, Nginx may buffer the response by default and show everything at once. The default 60-second timeout can also cut long tasks in half. The configuration below disables buffering and raises the timeout so users see the answer appear in real time.

location /api/stream {
    proxy_pass http://127.0.0.1:8000;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_buffering off;
    proxy_read_timeout 300s;
}

API keys and limiting agent permissions

A model provider key is tied to money, and if it leaks, someone else can spend from your account. Keep it in a .env file rather than in code, set chmod 600 so only the app user can read it, and never commit it to Git. Limit the agent's tools too: the clinic agent should connect to the database as a separate user that can only touch schedules and bookings. Setting a monthly spending cap in the provider dashboard also helps, so a loop stuck because of a bug does not turn into a large bill.

Monitoring and scaling up

Once the agent is live, keep an eye on queue length, worker memory and model response times; journalctl and simple monitoring tools are enough to start. If the queue is constantly full, add workers or move to a bigger plan. Growing step by step is far cheaper than paying for unused capacity from day one.

Related articles

🧭 Self-Hosting a Vector Database: Qdrant and pgvector 🧭 Portainer: Managing Docker from Your Browser 💾 How to Restore a Site and Database from Backup in ISPmanager 🤝 Reseller hosting in Uzbekistan: hosting client sites the organised way
🌐 Language
🇺🇿 O'zbek 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓