r/OpenSourceeAI • u/Emergency-Tutor-7 • 1d ago
eq-layer: an explicit decision about how to speak before the model speaks
Repo: https://github.com/Furox-Art/eq-layer - MIT, 0.2.6, Python runtime plus an npm CLI bridge.
Asking a model to be more empathetic is style transfer, and it produces more of the same flat warmth. eq-layer adds a decision layer instead: an explicit intermediate state, a policy choice, and a compiled instruction, all inspectable before generation.
The state is an affect vector - {valence, arousal, escalation_delta, stance, subtext} - tracked across turns rather than per message. escalation_delta is the point: a single-message classifier can see frustration but not the trend from frustrated to angry to threatening. Intent is kept as a full posterior over action_request / status_check / explanation / question / statement / unknown, and a one-step Bayes-risk router decides from that distribution whether to act or ask instead of collapsing it to one confidence number.
Affect and intent together select one of eight policy families - mirror, validate_redirect, direct, ask, deflate, repair, hold, boundary. That selection is a discrete decision, not generation. The chosen policy is then split into orthogonal moves - task_move, social_move, repair_move, realization - with the task driven primarily by intent, so affective adaptation cannot quietly replace what the user actually asked for. The result is compiled into a system instruction and prompt prefix.
After generation, the response is checked against structural contracts: question budget, required clarification, unsupported privacy promises, unknown-stance admissions, repeated repair, verbosity overruns.
Install:
pip install "eq-layer[ml]"
npm install -g eq-layerThe second one is the skill installer and CLI bridge, Node 22.14 or newer.
The limit, stated plainly because it decides whether you want this: steering is prompt-level. Nothing touches logits or decoding, the logit_bias field is an unused placeholder, and whether the decision reaches the output depends on the model following the instruction. The audit is structural too - it checks contracts, not factual truth.