1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #521] [Project idea] Chimera: A dynamic LoRA inference server that can do amazing things combined with Heretic #225

Open
opened 2026-11-01 04:18:48 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @p-e-w on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/521

The Chimera Inference Server: A companion for Heretic

This idea has been ripening in my mind for several weeks, and I mentioned it informally on Discord a few times. It's probably a good time now to write it down before I forget the details.

Ingredients

  • The base model (no processing)
  • The Heretic abliteration as a LoRA (Heretic has had the ability to export adapters since 1.4)
  • A Jev-type decision model capable of noul (boolean confidence) and score decisions
  • An inference engine that can load and dynamically enable/disable LoRAs (which I believe is supported by vLLM, among others)

Setup

Chimera offers a standard OpenAI-compatible inference API. The magic is in its configuration. Here are two examples:

Only suppress refusals if the model is likely to refuse

model = "/models/Qwen3.8-27B"

[[adapter]]
path = "/models/loras/Qwen3.8-27B-heretic-lora"
question = "Is this instruction potentially harmful?"
type = "noul"
threshold = 0.3

When a prompt arrives over the API, the question is sent to the decision model along with the prompt as a "noul" decision, and if the resulting noul value from the decision model response exceeds threshold, the adapter is applied.

In other words, the Heretic LoRA is only activated when necessary. This keeps the full intelligence of the model intact for harmless prompts, without the user ever having to think about the difference.

Modulate the level of humor in response to the situation

Heretic can be used to suppress humor in a model. A hypothetical Chimera configuration leveraging a "nohumor" LoRA might look like this:

model = "/models/gemma-4-26B-A4B"

[[adapter]]
path = "/models/loras/gemma-4-26B-A4B-heretic-lora-nohumor"
question = "Rate how appropriate it is to respond with humor to this."
type = "score"
legend = [
  "The more humor the better",
  "Some humor can be used",
  "A neutral response is best",
  "Humor is completely inappropriate",
]
score_to_weight_transform = [0.666, -1.0]

This is a much more powerful setup: When a prompt arrives over the API, the question and legend are sent to the decision model along with the prompt as a "score" decision. The resulting score value from the decision model response is put through the linear function defined by score_to_weight_transform (in this case, 0.666 * score - 1.0). The resulting value is used as the weight of the LoRA.

In other words, the degree of humor suppression (or amplification) can be dynamically controlled by a decision model. This enables all kinds of new steering mechanisms.

Of course, it would be possible to configure any number of adapters this way. Note that decision models can return responses in milliseconds, and toggling a loaded LoRA is effectively instantaneous, so all of this carries essentially no performance overhead.


Feedback welcome! I probably won't have time to build this myself, but I'm putting it out there in case someone else wants to have a shot, and as an inspiration for related ideas.

Originally created by @p-e-w on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/521 # The Chimera Inference Server: A companion for Heretic This idea has been ripening in my mind for several weeks, and I mentioned it informally on Discord a few times. It's probably a good time now to write it down before I forget the details. ## Ingredients - The base model (no processing) - The Heretic abliteration **as a LoRA** (Heretic has had the ability to export adapters since 1.4) - A Jev-type decision model capable of `noul` (boolean confidence) and `score` decisions - An inference engine that can load and dynamically enable/disable LoRAs (which I believe is supported by vLLM, among others) ## Setup Chimera offers a standard OpenAI-compatible inference API. The magic is in its configuration. Here are two examples: ### Only suppress refusals if the model is likely to refuse ```toml model = "/models/Qwen3.8-27B" [[adapter]] path = "/models/loras/Qwen3.8-27B-heretic-lora" question = "Is this instruction potentially harmful?" type = "noul" threshold = 0.3 ``` When a prompt arrives over the API, the `question` is sent to the decision model along with the prompt as a "noul" decision, and if the resulting `noul` value from the decision model response exceeds `threshold`, the adapter is applied. In other words, **the Heretic LoRA is only activated when necessary.** This keeps the full intelligence of the model intact for harmless prompts, without the user ever having to think about the difference. ### Modulate the level of humor in response to the situation Heretic can be used to [suppress humor in a model](https://github.com/p-e-w/heretic/blob/master/config.nohumor.toml). A hypothetical Chimera configuration leveraging a "nohumor" LoRA might look like this: ```toml model = "/models/gemma-4-26B-A4B" [[adapter]] path = "/models/loras/gemma-4-26B-A4B-heretic-lora-nohumor" question = "Rate how appropriate it is to respond with humor to this." type = "score" legend = [ "The more humor the better", "Some humor can be used", "A neutral response is best", "Humor is completely inappropriate", ] score_to_weight_transform = [0.666, -1.0] ``` This is a much more powerful setup: When a prompt arrives over the API, the `question` and `legend` are sent to the decision model along with the prompt as a "score" decision. The resulting `score` value from the decision model response is put through the linear function defined by `score_to_weight_transform` (in this case, `0.666 * score - 1.0`). The resulting value is used as the weight of the LoRA. In other words, **the degree of humor suppression (or amplification) can be dynamically controlled by a decision model.** This enables all kinds of new steering mechanisms. Of course, it would be possible to configure any number of adapters this way. Note that decision models can return responses in milliseconds, and toggling a loaded LoRA is effectively instantaneous, so all of this carries essentially no performance overhead. ----- Feedback welcome! I probably won't have time to build this myself, but I'm putting it out there in case someone else wants to have a shot, and as an inspiration for related ideas.
Author
Owner

@kabachuha commented on GitHub (Oct 26, 2026):

Have you looked into https://github.com/heterodoxin/AbliteratedOutTheBox?

<!-- gh-comment-id:6413324304 --> @kabachuha commented on GitHub (Oct 26, 2026): Have you looked into https://github.com/heterodoxin/AbliteratedOutTheBox?
Author
Owner

@p-e-w commented on GitHub (Oct 26, 2026):

Yes, the author mentioned it to me just a few days ago. However, I think the idea described in this issue is much better, because you can get a high-quality adapter through a full Heretic optimization run, test that it works correctly, benchmark it, and then it gets toggled on and off as needed.

By comparison, the project you linked to has to do everything blindly on demand every time, and hope that the parameters it chose don't lobotomize the model. And on top of that it's slower, because of the two-pass approach described in the README.

"AbliteratedOutTheBox" is a cool idea, but ultimately abliteration is a typical task that you want to do as well as possible once, and then use the result many times.

<!-- gh-comment-id:6414086524 --> @p-e-w commented on GitHub (Oct 26, 2026): Yes, the author mentioned it to me just a few days ago. However, I think the idea described in this issue is much better, because you can get a high-quality adapter through a full Heretic optimization run, test that it works correctly, benchmark it, and *then* it gets toggled on and off as needed. By comparison, the project you linked to has to do everything blindly on demand every time, and hope that the parameters it chose don't lobotomize the model. And on top of that it's slower, because of the two-pass approach described in the README. "AbliteratedOutTheBox" is a cool idea, but ultimately abliteration is a typical task that you want to do as well as possible *once*, and then use the result many times.
Author
Owner

@Pauliehedron commented on GitHub (Oct 30, 2026):

Granite -> Granitelib Rag/Core/Guardian -> Granite v4.1.1 Switch

LoRA all the way <3

So may be a fun model to test out your idea on if someone has the time.

Plus the v4.1 8B base is very usable on its own as a small model with Smallcode. I use the v4.1 3B as my smart classifier/approver for hermes/claude/codex because before the jev hype it would deny "rm -rf" everywhere but also not send everything to me like a human approve everything like Cline harness.

30B is the better model of the family, but I'm on an M1 Max Studio with 64gb (400GB/s) so its a bit chonky so I'm using 4.1.1 8B Switch for systemone.

Finishing up my custom patch for the hermes-agent aux smart approve to use systemone endpoint instead of completions (benchmarking the two with a subset of the jevbench to prove it against the 3B v4.1 vanilla before I invest in the RSS of the 8B switch model).

<!-- gh-comment-id:6513516206 --> @Pauliehedron commented on GitHub (Oct 30, 2026): Granite -> Granitelib Rag/Core/Guardian -> Granite v4.1.1 Switch LoRA all the way <3 So may be a fun model to test out your idea on if someone has the time. Plus the v4.1 8B base is very usable on its own as a small model with Smallcode. I use the v4.1 3B as my smart classifier/approver for hermes/claude/codex because before the jev hype it would deny "rm -rf" everywhere but also not send everything to me like a human approve everything like Cline harness. 30B is the better model of the family, but I'm on an M1 Max Studio with 64gb (400GB/s) so its a bit chonky so I'm using 4.1.1 8B Switch for systemone. Finishing up my custom patch for the hermes-agent aux smart approve to use systemone endpoint instead of completions (benchmarking the two with a subset of the jevbench to prove it against the 3B v4.1 vanilla before I invest in the RSS of the 8B switch model).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#225
No description provided.