OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Repeng

Repeng is a Python library for training representation-engineering control vectors from paired examples and applying them to language-model generation. Its documented workflow wraps a Transformers causal language model, sets a vector strength, and generates text; trained vectors can also be exported for llama.cpp use.

Independent OpenViST project profile, based on linked sources.

Repeng — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Load the causal language model and wrap it with ControlModel, specifying the target layer indices.

  2. Construct a dataset from closely opposite paired statements using the documented dataset-generation approach.

  3. Train a vector with ControlVector.train(model, tokenizer, dataset).

  4. 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.
Source-based practical guide

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

  1. Call vector.export_gguf(filename) on the trained vector.

  2. 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.
Evidence and transparency

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