Home / use case

A Discord bot that answers with Qwen 2.5 3B on a CPU-only VPS

At a glance
Hardware
6-core VPS, no GPU; Ollama capped at 4 of the 6 cores with systemd CPUQuota=400%
Models & engines
Ollama running Qwen 2.5 3B, reachable only from the bot's Docker network, never from the internet
Key gotcha
Ollama starts one thread per core by default, so with the CPU capped at 4 cores, 6 threads were fighting over 4 cores

What they built

StellarDev wanted their Discord bot, Stellar, to answer questions with AI: a /ask command, plus a first reply when someone opens a support ticket. They did not want to pay per message or send people's questions to a third party, so the model runs on the same 6-core VPS as the bot, with no GPU.

Answers stream into Discord as they are written, editing one message every second, so people see text within a couple of seconds even though a full answer takes 10-15 seconds. Small-model weakness in other languages is handled by translating to English, answering from the English command list, and translating back.

Setup

  • Ollama running Qwen 2.5 3B, reachable only from the bot's Docker network, never from the internet
  • 6-core VPS, no GPU; Ollama capped at 4 of the 6 cores with systemd CPUQuota=400%
  • Generation options: num_predict 200, temperature 0.3, num_ctx 2048, num_thread 4

How it works

  1. The bot streams the answer into Discord, editing one message every second
  2. For non-English questions the model first names the language and translates the question to English, then answers in English using the bot's command list, then translates the answer back
  3. In tickets the English copy stays underneath so staff can read it
  4. One answer at a time with a short queue, a 15-second cooldown per user and a daily cap per server

Results & numbers

  • Setting num_thread to match the 4-core cap took generation from 5.1 to 8.6 tokens a second without giving it more CPU
  • Polish answers went from useless to correct with the translate-answer-translate steps
  • Nothing is stored: only the answer's length and how long it took are logged

Gotchas

  • Ollama starts one thread per core by default, so with the CPU capped at 4 cores, 6 threads were fighting over 4 cores
  • A 3B model answering Polish or Spanish directly gave vague or made-up answers
“I didn't want to pay per message or send people's questions to a third party. So the model runs on the same 6-core VPS as the bot.”— StellarDev

Do it yourself

  1. Install Ollama on the bot's server and pull Qwen 2.5 3B
  2. Keep Ollama reachable only from the bot's Docker network
  3. Cap Ollama's CPU with systemd CPUQuota so the bot stays fast
  4. Set num_thread to the number of cores in the cap
  5. Stream replies into Discord by editing one message every second
  6. Add a queue, per-user cooldown and per-server daily cap
options: { num_predict: 200, temperature: 0.3, num_ctx: 2048, num_thread: 4 }
Source: DEV Community (StellarDev) · Published 2026-11-23 · Added 2026-11-24. This write-up summarizes the original source; see it for full details.

Similar setups

OzAI: a self-hosted ChatGPT on a 16 GB MacBook with Ollama, LiteLLM and Open WebUI, and what broke

A DevOps engineer served Qwen3 8B and Qwen2.5-Coder 3B from one M1 Pro laptop as a small private platform with per-user keys, rate limits, local web search and IDE chat, and documented seven silent failures.

Ahmet Ozan GAZİ (DEV Community) · 2026-11-03

A €200 mini PC as an offline AI box: a week with Gemma and Qwen

Diogo Soares ran Gemma 4 E4B and Qwen2.5-Coder 7B on a cheap NiPoGi P1 mini PC firewalled off the internet, used it from his Mac for a week, and measured what was fast and what wasn't.

Diogo Soares (DEV Community) · 2026-10-30

A CPU-only PDF question-answering API with Ollama, Qwen2.5 1.5B and ChromaDB

A developer who wanted to keep documents inside the private network built a small RAG app on a PC with no active GPU: PDFs are indexed into ChromaDB and a local FastAPI endpoint answers questions with Qwen2.5 1.5B on Ollama.

DEV Community (RafterKode) · 2026-12-03

A private ChatGPT alternative on a six-year-old RTX 3090 with Ollama, Open WebUI and imported chat history

Pascal Hetzscholdt turned an older desktop with an RTX 3090 into a local research assistant running GPT-OSS 20B through Ollama and Open WebUI, then imported years of ChatGPT conversations so the local model can search them.

Pascal Hetzscholdt (beehiiv) · 2026-11-16