Practical overview
When it fits
Use Repeng when you can load a language model and want to explore whether a control vector trained from paired examples can influence its generated text.
Who it is for
- Developers experimenting with behavior steering in language models.
- Researchers building paired-example control-vector experiments.
- Practitioners who want to export trained vectors for llama.cpp inference.
Documented uses
- Train a control vector from contrasting behavioral examples.
- Adjust generation by applying a vector at different strength settings.
- Export a trained vector for a llama.cpp inference workflow.
Requirements & limits
The repository is public and MIT-licensed.
- The documented Transformers example loads Mistral-7B-Instruct-v0.1 and wraps the causal language model with ControlModel.
- Training uses a dataset of closely opposed paired statements.
- The README states vector training currently does not work with MoE models such as Mixtral.
- Some example notebooks require the separately installed accelerate package.
- The documented GGUF export path is for llama.cpp; the README does not establish support for every model or configuration.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and apply a control vector with a Transformers model
Train a representation-engineering vector from paired examples and compare generation at different control strengths.
Before you start
- A Transformers causal language model; the README example uses Mistral-7B-Instruct-v0.1.
- A tokenizer for the selected model.
- A paired dataset with closely opposite examples and the supporting dataset-construction logic.
Steps
Load the causal language model and wrap it with ControlModel, specifying the target layer indices.
Construct a dataset from closely opposite paired statements using the documented dataset-generation approach.
Train a vector with ControlVector.train(model, tokenizer, dataset).
For each chosen strength, call model.set_control(vector, strength), generate text with the wrapped model, and decode the output.
Expected outcome
A trained control vector is applied during model generation, allowing outputs at different strengths to be compared.
Guide limitations
- The README's dataset builder is a placeholder and points to notebooks/experiments.ipynb for its definition; the example is not complete as written.
- Vector training currently does not work with MoE models such as Mixtral.
- Some example notebooks require accelerate, which must be installed manually.
Export a trained control vector for llama.cpp
Export a repeng-trained vector in GGUF format for use with llama.cpp.
Before you start
- A control vector already trained with repeng.
- llama.cpp for downstream inference.
Steps
Call vector.export_gguf(filename) on the trained vector.
Use the exported vector with llama.cpp for inference.
Expected outcome
The trained vector is exported for use in llama.cpp-based inference.
Guide limitations
- The README does not establish support for every llama.cpp model or configuration.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- vgel/repeng · Official homepage title · retained in its source language

