← all repositories
vgel/repeng

Steer LLM behavior with a sixty-second contrastive vector

repeng trains lightweight control vectors that steer LLM outputs toward or away from specific personas in under a minute.

744 stars Jupyter Notebook Language ModelsLLMOps · Eval
repeng
Not currently ranked — collecting fresh signals.
star history

What it does

repeng wraps standard Hugging Face causal language models and trains a control vector from pairs of contrasting statements—opposing personas, tones, or styles. At inference time, adding or subtracting that vector steers the model’s outputs toward one pole or the other. The README bills training as sub-one-minute.

The interesting bit

Rather than updating billions of base weights, you freeze the model and learn a directional nudge in activation space. The library also exports trained vectors to GGUF for llama.cpp, so the same steering applies to quantized inference.

Key highlights

  • Learns steering from natural paired opposites (e.g., “high on psychedelic drugs” versus “sober”) instead of prompt engineering.
  • Applies control via a ControlModel shim around AutoModelForCausalLM, letting you dial strength up or down at runtime.
  • Exports vectors to GGUF for use with llama.cpp at any quantization level.
  • Ships with Jupyter notebooks demonstrating the full contrastive-training pipeline.

Caveats

  • Vector training does not work with MoE models such as Mixtral; the author flags this as fixable but unimplemented.
  • Some notebooks require accelerate to be installed separately.

Verdict

A handy tool if you want cheap, reversible personality steering for local transformers without touching fine-tuning infrastructure. Avoid if your pipeline depends on MoE architectures, since training is currently unsupported there.

Frequently asked

What is vgel/repeng?
repeng trains lightweight control vectors that steer LLM outputs toward or away from specific personas in under a minute.
Is repeng open source?
Yes — vgel/repeng is open source, released under the MIT license.
What language is repeng written in?
vgel/repeng is primarily written in Jupyter Notebook.
How popular is repeng?
vgel/repeng has 744 stars on GitHub.
Where can I find repeng?
vgel/repeng is on GitHub at https://github.com/vgel/repeng.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.