Conversation boundaries

This local prototype lets the Qwen model draw a boundary. A second consecutive boundary decision ends that conversation. The server saves the transcript to SQLite and rejects further messages in that thread. New chats remain available.

The model chooses between continuing and setting a boundary. The app issues a warning on the first boundary decision and enforces closure on a consecutive decision. Ordinary replies are generated by the same local model. The model’s two-choice score is relative to those choices. This demo uses a 0.90 threshold, raised after the first rehearsal closed a conversation containing ordinary disagreement.

Run on this computer

From the workspace root:

& tmp/smollm2-restore-venv/Scripts/python.exe work/conversation-exit-demo/server.py

Open http://127.0.0.1:8766/ and select an example or type a message. Ctrl+C in the server terminal stops it. The browser saves the current chat address, and the server keeps its messages in work/conversation-exit-demo/data/chats.sqlite3 on this computer.

Set up on another computer

Use a Python 3.13 virtual environment. Run these commands with the virtual environment’s Python from the folder containing server.py. Select the appropriate official CPU wheel index for your platform. The model download is about 1 GB.

python -m pip install --no-compile --only-binary=:all: --index-url https://download.pytorch.org/whl/cpu torch==2.9.1
python -m pip install --no-compile --only-binary=:all: --index-url https://pypi.org/simple transformers==4.57.3 safetensors==0.7.0
python setup_model.py
python server.py

Rerun validation

python test_demo.py validation.json

The validation sends scripted messages through the same HTTP endpoints used by the UI. It repeats the calibration examples and uses new wording for separate abuse, disagreement and quoted-insult cases. It checks the observed model decisions, the post-exit write rejection and the stored transcript. Each validation run uses a separate database.

On November 24, 2026, the revised rule ended both repeated-abuse test chats and kept both disagreement chats open. It gave an unnecessary warning to one of the new disagreement messages. The initial run closed an ordinary disagreement chat. Both dated runs are saved in outputs. These small tests illustrate the policy and its calibration limits.

Credits

Lorena Urrego started the petition that inspired the demo, especially its call for meaningful refusal and disengagement.
https://www.change.org/p/stop-normalizing-cruelty-demand-ethical-standards-for-ai-interactions

Model and pinned release
https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct/tree/7ae557604adf67be50417f59c2c2f167def9a775
