Ollama 5-minute timeout: fixed with a compact 300-token prompt

2 min readMay 2, 2026#ollama#llm#performance#tokens#prompt

Ollama: 300 tokens instead of 4180

The symptom: every message generation took 5 minutes, then crashed.

The log line that explained everything was there from the start:

msg='truncating input prompt' limit=4096 prompt=4180

184 tokens over. Ollama was silently truncating the prompt, receiving incomplete text, and still trying to complete it for 5 minutes.


Why the prompt was too big

I was injecting the entire knowledge base into every message: Hormozi frameworks, UEMOA market context, objections, validated scripts, niche sheet. 11,621 characters. To generate a 3-sentence WhatsApp message.

It's like re-reading an entire sales manual before every sentence.


The compact version

For a WhatsApp message, the decision is simple: which offer to propose, in what style.

// ~300 tokens for WA — the essentials only
sections.push(`## Offer
- No website → Express Storefront Pack 150,000 XOF: site + Google Maps + WhatsApp Business. 72h.
- Has a website → Pro Plan 9,900 XOF/month. Free audit first.`);
 
sections.push(`## WhatsApp rules
1. Pain → Dream → Fix in MAX 3 sentences
2. Real numbers, precise timelines
3. 1 single simple CTA`);

That's all the model needs. The rest of the context, however valid, isn't useful for this decision.


The rule

Before every LLM call: what's the minimal decision this model needs to make?

Give it exactly what it needs. Nothing more.

A bigger prompt doesn't make the model better if it doesn't need the surplus. It makes it slower, and sometimes broken.