NutsNews Qwen Summary Length Update
Section titled “NutsNews Qwen Summary Length Update”This update makes accepted Qwen/Ollama AI article summaries return in the 240-300 character range.
Changed files
Section titled “Changed files”local-ai-service/server.mjslocal-ai-service/.env.exampledocs/HOME_SERVER_LOCAL_AI.md
What changed
Section titled “What changed”- Adds configurable summary limits:
ACCEPTED_SUMMARY_MIN_CHARS=240ACCEPTED_SUMMARY_MAX_CHARS=300
- Updates the Qwen/Ollama prompt to request 240-300 character summaries for accepted stories.
- Adds server-side summary normalization so accepted summaries are trimmed/filled into the configured range before the Worker receives them.
- Keeps rejected article summaries as an empty string.
- Raises the default
OLLAMA_NUM_PREDICTfrom180to260so the longer summary plus JSON fields has enough output room. - Updates local AI documentation.
Apply to local project
Section titled “Apply to local project”cd /Users/ramideltoro/WebstormProjects/nutsnews2unzip -o ~/Downloads/nutsnews-qwen-summary-240-300-update.zip -d /tmp/nutsnews-qwen-summary-240-300-updatersync -av /tmp/nutsnews-qwen-summary-240-300-update/qwen-summary-240-300-update/ ./node --check local-ai-service/server.mjsDeploy to home server local AI service
Section titled “Deploy to home server local AI service”cd /Users/ramideltoro/WebstormProjects/nutsnews2scp local-ai-service/server.mjs rami@chingadera:/tmp/server.mjsssh rami@chingadera 'sudo cp /tmp/server.mjs /opt/nutsnews/local-ai-service/server.mjs && sudo chown root:root /opt/nutsnews/local-ai-service/server.mjs'Update the real service .env on the home server:
ssh rami@chingaderasudo nano /opt/nutsnews/local-ai-service/.envMake sure these values exist:
ACCEPTED_SUMMARY_MIN_CHARS=240ACCEPTED_SUMMARY_MAX_CHARS=300OLLAMA_NUM_PREDICT=260Restart and verify:
sudo systemctl restart nutsnews-local-aisudo systemctl status nutsnews-local-ai --no-pagercurl -s http://127.0.0.1:8788/stats -H "x-nutsnews-ai-key: $LOCAL_AI_API_KEY" | python3 -m json.toolCommit
Section titled “Commit”cd /Users/ramideltoro/WebstormProjects/nutsnews2git statusgit add local-ai-service/server.mjs local-ai-service/.env.example docs/HOME_SERVER_LOCAL_AI.mdgit commit -m "Constrain Qwen summaries to 240-300 characters"