mal_bnais‑svr.js is an Express/Node.js server that
exposes a simple REST endpoint (`POST /chill`) to transform any
user‑supplied text from negative to positive. It uses the same local
Ollama LLM that powers benais.js
, so your data never leaves
your machine.
# .env
PORT=3000
OLLAMA_URL=http://127.0.0.1:11434/api/chat
LLM_MODEL=gemma3
npm install express dotenv node-fetch
node mal_bnais-svr.js
Transforms a single sentence from negative to positive.
{
"text": "I hate how slow this is."
}
{
"original": "I hate how slow this is.",
"chilled": "I appreciate the improvements being made."
}
curl -X POST http://localhost:3000/chill \
-H "Content-Type: application/json" \
-d '{"text":"You are stupid as fuck!"}'
The server forwards the user’s sentence to Ollama with a prompt
identical to that used in benais.js
:
You are a helpful text filter. Analyze the following sentence and determine if it contains any negative or "bad" meaning.
If it does, rewrite the sentence to have a positive, opposite meaning.
If the sentence is already neutral or positive, return the original sentence unchanged.
Example 1: "This is a terrible situation." -> "This is a wonderful situation."
...
The sentence to transform is: "${originalMessage}"
Transformed sentence:
The LLM returns the transformed text, which the API then packages in JSON and sends back.
This project is in Beta. Pull requests, issue reports and ideas are welcome! Fork the repo, tweak the prompt or add new features, then submit a PR.