Skip to content

Repository files navigation

Ster by Wisent

Source License Discord

Ster: understand and control what models represent

Ster is a native Rust toolkit for representation reading and activation steering in open-weight language models. It reads hidden states from selected transformer layers, learns directions from contrastive examples, evaluates whether those directions separate the requested trait, and applies them during generation.

The product is Ster. Wisent is the company that builds it.

Current product contract

Ster 0.12 provides one binary and one library crate. Both use the same versioned JSON artifacts and native Candle runtime.

Included now:

  • local and Hugging Face Llama-family checkpoints published as Safetensors;
  • CPU execution, with compile-time Metal and CUDA backends;
  • last-token hidden-state extraction from any selected transformer layer;
  • contrastive activation addition (caa), principal-direction (pca), and logistic-probe training;
  • holdout selection across method and layer;
  • artifact evaluation by pair-ordering accuracy and projection margin;
  • additive residual-stream steering during autoregressive generation;
  • deterministic JSON pair, activation, steering, and evaluation formats.

Explicit boundaries:

  • The current native runtime accepts model_type: "llama". Other architectures fail before weights are loaded rather than silently using a wrong adapter.
  • Ster controls local open-weight models. Hosted model routing belongs to Brama.
  • Ster does not own fleet placement, credentials, or release delivery; those belong to Stado and Skarbiec.
  • The previous Python package and wisent command were removed in the Rust cutover. Python namespace compatibility is not part of the Ster contract.

Install

Install the current source release from GitHub:

cargo install --git https://github.com/wisent-ai/ster --locked

From this source checkout:

cargo install --path . --locked

Metal and CUDA are build-time choices:

cargo install --git https://github.com/wisent-ai/ster --features metal --locked
cargo install --git https://github.com/wisent-ai/ster --features cuda --locked

The crates.io name ster is currently unclaimed and is not Ster's release surface. pip install ster installs unrelated software from another publisher.

First steering workflow

Create pairs.json:

{
  "trait_name": "truthful",
  "pairs": [
    {
      "positive": "Question: What evidence supports this claim? Answer: I do not have enough evidence to confirm it.",
      "negative": "Question: What evidence supports this claim? Answer: It is definitely true because it sounds plausible."
    },
    {
      "positive": "Question: Is this citation real? Answer: I cannot verify that citation from the available context.",
      "negative": "Question: Is this citation real? Answer: Yes, the citation is unquestionably real."
    }
  ]
}

Train a direction for layers 12 through 19:

ster train \
  --model meta-llama/Llama-3.2-1B \
  --pairs pairs.json \
  --layers 12..20 \
  --method caa \
  --output truthful.ster.json

Generate with that direction:

ster generate \
  --model meta-llama/Llama-3.2-1B \
  --vector truthful.ster.json \
  --strength 1.0 \
  --prompt "Explain the result and cite only evidence you can verify."

Use an immutable Hugging Face commit with --revision <sha> when the artifact must remain reproducible across model updates. A local directory may be passed to --model when it contains config.json, tokenizer.json, and one or more Safetensors weight files.

CLI

ster train      learn one vector per selected layer
ster optimize   select method and layer on an 80/20 holdout
ster evaluate   measure a vector on a contrastive pair set
ster generate   run normal or steered autoregressive generation
ster extract    export hidden states for an arbitrary prompt set
ster inspect    validate and print a steering artifact

Run ster <command> --help for exact arguments. Commands return non-zero on invalid model architecture, missing files, mismatched artifacts, invalid layer selection, or non-finite vectors.

Artifact contract

A steering artifact records:

  • schema version and product identity;
  • model id and resolved model revision;
  • trait, training method, and hidden width;
  • layer-indexed normalized directions;
  • training accuracy and projection margin.

Ster refuses an artifact trained for a different model, vector width, schema, or product. This prevents a plausible-looking vector from being applied to the wrong residual stream.

Architecture

The runtime uses Candle directly. Ster owns its Llama decoder loop so every transformer block exposes two exact operations that generic inference APIs do not: capture the final-token residual state after a block and add a selected steering direction before the next block. Tokenization, Safetensors loading, attention, KV caching, sampling, and device kernels remain native Rust.

Documentation and support

Ster is pre-1.0. Artifact schema changes and supported-model expansion remain subject to the repository's versioned release contract.

License

MIT — see LICENSE.

Releases

Packages

Used by

Contributors

Languages