Case study

LLM Steering Lab

Activation-space behavior control workbench for local open-source SLMs, with pre/post hook comparison and explainable experiment controls.

LLMOps / interpretability / local-first AIflagship

Primary evidence: Hugging Face + PyTorch

System thesis

Activation-space behavior control workbench for local open-source SLMs, with pre/post hook comparison and explainable experiment controls.

TypeLocal-first LLM research workbenchUsersAI engineers, interpretability researchers, LLMOps reviewersMaturityFunctional workbench shell with reproducible demos

At a glance

Method
ActAdd-style steering vectors
Intervention
Pre-activation and post-activation hooks
Product layer
FastAPI API plus React workbench UI
RuntimeHugging Face + PyTorch
UIVite + React + TypeScript workbench
EvidenceWorkbench GIFs, hook diagrams, method docs

System problem

Why this system exists.

LLM control work can become vague when reduced to prompt examples. This lab treats behavior steering as reproducible experiments, model registries, hook points, UI controls, and documented limitations.

Implementation surface

What was built.

  • Activation steering starter kit.
  • FastAPI workbench API and React UI.
  • Research notes and model support matrix.

Architecture

A system map for the project.

Prompt-pair data -> steering-vector extraction -> model registry -> activation hook -> comparison run -> FastAPI workbench -> React controls.

Custom architectureActivation steering workbench

A model-internals diagram that exposes prompt pairs, vector extraction, hook placement, comparison runs, and workbench review.

Experiment Design

positive promptnegative promptbehavior preset

Representation Work

hidden statessteering vectorlayer + coefficient

Intervention Site

pre-hookpost-hookresidual stream

Workbench

FastAPIReact UIbaseline vs steered

How it works

Input, transformation, model or agent logic, and reviewable output.

01

Prompt-pair setup

Positive and negative examples create a direction in activation space for the behavior being studied.

02

Vector extraction

The workbench supports ActAdd-style steering vectors and metadata that explain layer, coefficient, and hook stage.

03

Hook comparison

Pre-activation and post-activation hooks are compared because the same direction can behave differently depending on where it enters the model.

04

Workbench review

FastAPI and React turn the method into an operational console with model support states and result comparison.

Evidence

Screenshots, responses, diagrams, tests, and model tables from the source repos.

Artifacts are included only where the public repo has enough context to show them safely.

Engineering Decisions

01

Local-first research path

The system keeps model experimentation local while still making UI/API contracts explicit.

02

Explain limitations visibly

Unsupported models and unvalidated routes are shown rather than hidden behind optimistic controls.

03

Research-to-product bridge

The project makes the math, hook sites, prompts, and outputs visible in one loop.

Validation / reliability

How the system is made reviewable.

  • Python source, scripts, and tests compile.
  • Full model runs depend on local model availability.
  • Safety gates and unsupported-model limitations are documented.
  • FastAPI experiment API.
  • React/TypeScript controls.
  • Local model execution for privacy-sensitive experimentation.

Limits / responsible use

Research engineering lab with public artifacts and explicit limitations. It is not a production model-safety guarantee.

  • Workbench artifacts expose prompt pairs, vector extraction, hook choices, and baseline comparisons.
  • Unsupported routes and model-specific fragility are visible rather than hidden behind optimistic controls.
  • The lab demonstrates research tooling and does not claim a production model-safety guarantee.

Repository

Open the source repo and inspect the implementation boundary.

All public examples are synthetic, sanitized, historical, or research/demo implementations. No PHI, PII, employer-confidential data, proprietary claims data, private keys, production credentials, or sensitive datasets are included.