interp-playground
Provides tools for inspecting and steering Google's Gemma 2 2B model using Gemma Scope residual-stream SAEs, including activation lookup, feature steering, and ablation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@interp-playgroundShow top SAE features for 'The bridge crossed the river'."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
interp-playground
Tools for looking inside a language model: activations, sparse-autoencoder (SAE) features, steering, and ablation. The goal is an MCP server that lets an AI agent and a human investigate a model's internals together.
It's a learning project. Current target: Gemma 2 2B with Google DeepMind's Gemma Scope residual-stream SAEs, running locally on Apple Silicon (MPS).
Status
Nix + uv environment; MPS verified against CPU
Reproduce a known SAE feature by hand (activations, steering, random control)
MCP server skeleton with
run_promptMore tools:
feature_info,steer,ablate,logit_lens
Related MCP server: AgentWatch
Setup
Requires Nix with flakes. The flake provides Python 3.12 and uv; uv manages Python packages.
nix develop # or: direnv allow
uv syncGemma 2 is gated on Hugging Face. Accept the license at google/gemma-2-2b, then log in once:
uv run hf auth loginThe model (~10 GB in fp32) and SAEs download on first use.
MCP server
claude mcp add interp-playground -- uv run --directory /path/to/interp-playground interp-playground-mcp
uv run python scripts/mcp_smoke.py # end-to-end check over stdiorun_prompt returns the top SAE features per token and across the text, with
Neuronpedia labels. Activations are also given relative to each feature's typical
max (rel), and features active on >10% of tokens are hidden by default. The
model stays loaded between calls. Feature metadata comes from Neuronpedia's bulk
exports and is cached in ~/.cache/interp-playground/.
Scripts
# Does MPS give the same internals as CPU? (fp32: yes; bf16: 1-4% drift)
uv run python scripts/check_mps.py
# Where does a feature fire, token by token?
uv run python scripts/feature_acts.py --feature 7272 "We drove across the old bridge."
# Steer generation along a feature direction, or a random one as a control
uv run python scripts/steer.py --feature 7272 --scales 0 50 100 200
uv run python scripts/steer.py --random 0 --scales 0 50 100 200Findings so far
Layer-12 feature 7272, labelled "references to various types of bridges" on Neuronpedia:
Activations: fires at 35-50 on the word "bridge" in every sense (physical, dental, card game, metaphorical) and at 4-22 on bridge-like concepts without the word (overpass, ferry, river). The label describes the top of the activation range; the low range is broader.
Steering: at scale 70-90 the output drifts toward rivers and "connecting the community"; at 100+ it produces "bridge" and degrades. Random directions of the same norm never produce "bridge" and stay fluent up to ~200, so the effect is specific to the feature. (One prompt, two random seeds: suggestive, not conclusive.)
Notes
fp32, not bf16. bf16 on MPS drifts 1-4% in the residual stream, enough to flip JumpReLU features near their thresholds.
nnsight 0.7: only objects that are themselves
.save()d leave a trace. Wrap lists of saved tensors innnsight.save([...]).transformer-lensis pinned below 4.0 until sae-lens supports it.
License
MIT
Available Tools
1 toolrun_promptA
Run a prompt through the model and report which SAE features are active.
Returns, per layer:
- top_features: the 10 features most strongly active anywhere in the text,
each at its peak token, with its Neuronpedia label, density (fraction of
all tokens it fires on) and the output tokens it promotes.
- tokens: for each token, its top_k features.
`act` is the raw activation. `rel` is act / the feature's typical max
activation, so rel near 1 means firing about as hard as it ever does.
Rankings use rel. Features active on >10% of all tokens carry little
meaning and are hidden unless include_dense is true. The <bos> token is
omitted. The first real token often shows position artifacts: features
with very large activations unrelated to its meaning.
Args:
prompt: Text to run. Gemma 2 2B is a base model, not a chat model.
layers: Residual-stream layers to read (0-25). Default [12].
top_k: Features to list per token.
max_new_tokens: If > 0, greedily generate this many tokens first and
analyze prompt + completion.
include_dense: Include features active on >10% of tokens.
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | ||
| layers | No | ||
| prompt | Yes | ||
| include_dense | No | ||
| max_new_tokens | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so well: it documents the return structure (top_features, tokens), explains the act vs rel normalization ('rel is act / the feature's typical max activation'), and discloses non-obvious filtering behavior — dense features (>10% of tokens) are hidden unless include_dense, the <bos> token is omitted, and first-token position artifacts occur. It also warns the model is a base model, not a chat model.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The purpose is front-loaded and the body is organized as a bulleted output spec followed by parameter notes, so it scans well. It is on the longer side and repeats return-value detail that the output schema already covers, but nearly every sentence carries operational meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 5-parameter analysis tool with an output schema and no annotations, the description supplies everything needed to invoke it correctly: parameter meaning, activation ranking semantics, dense-feature suppression, and known artifact caveats.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description compensates by explaining prompt, layers (range 0-25), max_new_tokens, and include_dense in semantic terms. top_k ('Features to list per token') is thinner and near-circular, and the description says the layers default is [12] while the schema declares null, a minor inconsistency.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening sentence states a specific verb and resource ('Run a prompt through the model and report which SAE features are active'), naming both the input and the class of output. There are no sibling tools, so no differentiation is needed, and an agent immediately knows what the tool produces.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives conditional usage cues tied to parameters, e.g. 'max_new_tokens: If > 0, greedily generate this many tokens first' and 'include_dense is true', which tells the agent when to flip those switches. It stops short of explicit when-to-use/when-not framing, but with no alternatives to route between, this is clear context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
run_prompt
TDQS
Scored across 1 tool
With only one tool, there is no risk of selecting the wrong tool; its purpose is unambiguous. The internally complex output does not create tool-selection overlap.
The sole tool name run_prompt follows a clear verb_noun snake_case convention. There are no other names to contradict the pattern, so consistency is trivially maintained.
One tool is very thin for a server branded as a playground. While the operation is rich, the absence of companion tools for discovery, comparison, or feature inspection makes the count feel too low for the apparent scope.
The surface covers only running a prompt and viewing active SAE features. It lacks obvious operations such as listing models/layers, searching or inspecting individual features, or comparing prompts, leaving significant gaps for an interpretability playground.
Maintenance
Related MCP Connectors
AI agent observability for production traces, natural-language insights, and improvement loops.
Self-hosted AI prompt library: prompts, collections, tags, teams, chains. 29 MCP tools for agents.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Data + AI observability — monitor and troubleshoot production-grade agents and the context they use.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables LLMs to inspect and test other MCP servers by listing and calling their tools, reading resources, and getting prompts. Supports stdio, SSE, and HTTP transports for both local and remote MCP server inspection.74 npm1MIT
- AlicenseNot gradedqualityCmaintenanceA terminal live-tail and a browser dashboard — one process, one event stream, served from localhost. Unified timeline across Claude Code, Codex, Gemini CLI, Cursor, Hermes, and OpenClaw. Token + cost accounting, compaction + anomaly detection, hybrid search, SVG call graphs, monaco-style diff attribution, agent-aware replay ("what would the agent say if I edited the prompt?"), policy editor, MCP s16 npm15MIT
- FlicenseAqualityDmaintenanceLocal multimodal MCP server for vision, document, audio, video, and GUI automation, all processed locally on Apple Silicon for privacy and security.9-
- AlicenseNot gradedqualityDmaintenanceLocal MCP server that enables AI clients to read and search memories from the Fovea macOS app, with privacy-focused local operation and optional semantic search.Apache 2.0