Choosing a VPS

VPS for AI and Python Bots Without a GPU: What Runs on CPU

By NileVPS Team · Published · 4 min read

اقرأ المقال بالعربي

"AI" covers everything from a Telegram bot that forwards messages to an API, to training a large neural network from scratch. Those two jobs need completely different hardware. Many people assume any AI project needs an expensive GPU server, while others try to run a large language model on a tiny VPS and wonder why it takes a minute per sentence. This guide explains what runs comfortably on a CPU-only VPS, how to size it, and where the honest limits are.

Three kinds of "AI on a server"

WorkloadWhere the compute happensTypical VPS need
Bot calling a hosted AI APIOn the API provider's servers1-2 vCPU, 1-2 GB RAM
Classic machine learning (scikit-learn, XGBoost)Your CPU2-4 vCPU, 4-8 GB RAM
Running models locally (embeddings, small LLMs, Whisper)Your CPU and RAM4-8+ vCPU, 8-32 GB RAM
Training large neural networksGPUA GPU server, not a regular VPS

Most production bots fall into the first row. The VPS only orchestrates: it receives a message, calls an API, stores some data and replies. That is light work, and a small Linux server handles thousands of such requests a day.

What runs well on CPU

  • API-based bots and agents: Telegram, Discord and WhatsApp bots, customer support assistants, and automation scripts that call hosted models.
  • Classic ML: classification, regression, forecasting and recommendation models with scikit-learn, XGBoost or LightGBM. Inference on CPU is usually fast.
  • Embeddings and semantic search: small sentence-embedding models with a vector store such as pgvector or Qdrant work fine on CPU for moderate volumes.
  • Small quantized LLMs: models in the 1-8 billion parameter range, quantized to 4 bits, run through llama.cpp or Ollama. Expect a few tokens per second to low double digits depending on model size and CPU, which is acceptable for background tasks and low-traffic chat.
  • Speech to text: Whisper's smaller models, or faster-whisper, can transcribe audio on CPU, slower than real time for larger models.
  • OCR and image processing: Tesseract and OpenCV pipelines.

Sizing RAM for local models

For a quantized model, memory is the main constraint. A rough rule: the model file size plus 1-2 GB for context and the runtime.

  • A 3B model at 4-bit is around 2 GB on disk, so 4 GB RAM can work.
  • A 7-8B model at 4-bit is roughly 4-5 GB, so plan 8 GB RAM at minimum, 16 GB to leave room for your app.
  • Larger models quickly need 32 GB or more and become slow on CPU.

More vCPU cores help generation speed up to a point, but memory bandwidth limits CPU inference, so doubling cores rarely doubles speed. Test with your real model before committing to a size.

Trying it takes a few commands with Ollama:

curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2:3b
ollama run llama3.2:3b "Summarize what a VPS is in one sentence."

Ollama listens on 127.0.0.1:11434 by default. Keep it there and let your app call it locally rather than exposing it to the internet without authentication.

Running a Python bot properly

  1. Create a dedicated user and a virtual environment:

``bash sudo adduser --disabled-password bot sudo -u bot python3 -m venv /home/bot/venv sudo -u bot /home/bot/venv/bin/pip install -r /home/bot/app/requirements.txt ``

  1. Store tokens and API keys in an environment file with chmod 600, never in code.
  2. Run the bot as a systemd service with Restart=always, and read logs with journalctl -u yourbot -f.
  3. Prefer webhooks behind Nginx and HTTPS for high-traffic Telegram bots; long polling is simpler and fine for small bots.
  4. Add a swap file as a safety net, not as extra RAM; if a model constantly swaps, it is too big for the server.

Our guide on VPS for trading and Telegram bots includes a complete systemd unit you can reuse.

When you actually need a GPU

  • You are training or fine-tuning neural networks beyond small experiments.
  • You need fast responses from a large model for many simultaneous users.
  • You generate images or video with diffusion models at any useful speed.
  • You transcribe large volumes of audio with big Whisper models in near real time.

For these, a GPU server or a hosted inference API is the right tool. A common and cost-effective pattern is a CPU VPS for the bot, database and business logic, calling a GPU-backed API only for the heavy model step.

Choosing your VPS

Pick Linux for Python workloads, a location close to the APIs or users you serve, and enough RAM for the largest model you will load. Start small, measure with htop and free -h, and resize when the numbers say so. See plans on /pricing.

FAQ

Can I run ChatGPT-like models on a VPS without a GPU?

You can run smaller open models, such as 3B to 8B parameter models in quantized form, using llama.cpp or Ollama. They work for many tasks but are slower and less capable than large hosted models. For heavy or high-traffic use, a hosted API is usually more practical.

How much RAM does a Python Telegram bot need?

A typical bot that calls APIs and uses a small database runs comfortably in 1-2 GB of RAM. Memory needs rise only if the bot loads ML models locally or processes large files in memory.

Is Windows or Linux better for AI bots?

Linux is the usual choice. Most AI libraries, tutorials and deployment tools target Linux first, it uses fewer resources, and there is no license cost. Choose Windows only when a tool you depend on requires it.

Related guides