A Discord bot that answers with Qwen 2.5 3B on a CPU-only VPS
- 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
- The bot streams the answer into Discord, editing one message every second
- 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
- In tickets the English copy stays underneath so staff can read it
- 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
- Install Ollama on the bot's server and pull Qwen 2.5 3B
- Keep Ollama reachable only from the bot's Docker network
- Cap Ollama's CPU with systemd CPUQuota so the bot stays fast
- Set num_thread to the number of cores in the cap
- Stream replies into Discord by editing one message every second
- Add a queue, per-user cooldown and per-server daily cap
options: { num_predict: 200, temperature: 0.3, num_ctx: 2048, num_thread: 4 }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.
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.
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.
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.