explaingit

n8python/gemma-steer

6PythonAudience · researcherComplexity · 4/5ActiveLicenseSetup · hard

TLDR

Local FastAPI web app for experimenting with steering vectors on a Gemma model in MLX format, with sliders to nudge output style and a builder for custom contrastive-persona vectors.

Mindmap

mindmap
  root((gemma-steer))
    Inputs
      Gemma MLX checkpoint
      Persona pairs
      Slider values
    Outputs
      Steered chat replies
      New steering vectors
      JSON axis configs
    Use Cases
      Style experiments
      Build custom vectors
      Local Mac chat
    Tech Stack
      Python
      MLX
      FastAPI
      Gemma

Things people build with this

USE CASE 1

Chat with a local Gemma model and steer its tone with built-in style sliders

USE CASE 2

Build a custom steering vector from a contrastive persona pair like cryptic oracle vs practical engineer

USE CASE 3

Compare full 8-bit and economy 4-bit Gemma profiles on Apple Silicon

USE CASE 4

Run the vector builder from the command line to rebuild all bundled axes

Tech stack

PythonMLXFastAPIGemma

Getting it running

Difficulty · hard Time to first run · 1h+

Requires Apple Silicon macOS and 32GB+ unified memory for the full profile; vectors do not transfer across model checkpoints.

CC0 1.0 places the work in the public domain so you can use, modify, and redistribute it for any purpose without attribution.

In plain English

This project, called steerSelf, is a local web app for experimenting with steering vectors on a Gemma language model. A steering vector is a numerical adjustment that is added inside the model while it is running, with the aim of nudging its output toward a chosen trait, like sounding more mystical or more practical. The app comes with a set of these vectors already computed and a way to make new ones. The app is built around a specific Gemma 4 checkpoint hosted on Hugging Face, in an MLX format optimized for Apple Silicon Macs. Two profiles are supported. The full profile uses a 26 billion parameter version of the model at 8 bit precision and is the default. An economy profile uses a smaller 4 bit variant for machines with less memory. Each profile has its own bundle of steering vectors, and the README is clear that these vectors do not transfer cleanly to other models or other Gemma checkpoints. Requirements are macOS on Apple Silicon, Python 3.10 or newer, and 32 gigabytes or more of unified memory for the full profile. Installation is a virtual environment plus a pip install of the requirements file. Running the script steering_webui.py starts a local FastAPI web interface at localhost on port 7860. From the UI, a user can chat with the model, move sliders to apply steering, and open a sampling panel to tweak temperature, top-p, top-k, and similar generation settings. New steering vectors are created from contrastive persona pairs, written one per line as something like cryptic oracle :: practical engineer. The app generates the corresponding dataset, builds the vector, and can hot-load it into the slider list. Vectors and datasets land in profile-specific folders, and custom names cannot collide with built-in axes. A command line script exposes the same vector builder for use outside the web UI, plus a helper to rebuild all bundled vectors for a profile. The repository layout includes the web app scripts, vector builder scripts, the static frontend files, JSON configs for the bundled emotion and style axes, and the vector bundles for each profile. The README is upfront that this is experimental software and that steering vectors should be treated as exploratory controls, not reliable safety edits. The project is released under the CC0 1.0 Universal license.

Copy-paste prompts

Prompt 1
Give me a 5-minute install guide for steerSelf on an Apple Silicon Mac with 32GB unified memory
Prompt 2
Show me how to define a contrastive persona pair and turn it into a hot-loaded steering vector
Prompt 3
Explain the difference between gemma-steer's full and economy profiles and when to pick each
Prompt 4
Walk me through the steering_webui.py FastAPI endpoint at localhost 7860 and its sampling controls
Prompt 5
How do I rebuild all bundled steering vectors for a profile from the CLI
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.