CC

chrishayuk/chuk-mcp-lazarus

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

21 stars 5 forks 质量 62 趋势 20

机制可解释性 MCP 服务器封装 chuk-lazarus。

概览

机制可解释性 MCP 服务器封装 chuk-lazarus。 加载任何模型,提取激活、训练探针、转向生成和消融组件——所有这些都通过 MCP 工具,Claude(或任何 MCP 客户端)可以自主调用。 添加到你的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json): 适用于任何型号的chuk-lazarus支持: - -- Gemma 3(270M--27B),TranslateGemma 4B/12B - -- Llama 2/3,Mistral,SmolLM2 - -- Qwen 2/3 - -- IBM Granite 3.x/4.x(混合 Mamba-2/Transformer)- -- AI21 Jamba(混合 Mamba-Transformer MoE)-- 纯 SSM 模型 -- 代码生成 -- GPT-2 兼容 默认演示目标:(34层,适用于苹果硅片)。用于速度的烟雾测试。 旗舰实验遵循15步工作流程: 1. -- load_model(“Google/gemma-3-4b-it”)2.-- get_model_info() 揭示34层 3.-- 查看提示如何拆分成令牌 4.-- 查看基线模型输出 5.-- 验证激活是否非平凡 6.

概述(AI 翻译)

机制可解释性 MCP 服务器封装 chuk-lazarus。

加载任意模型,提取激活,训练探针,生成转向, 并消融组件——所有这些都通过 Claude(或任何 MCP 客户端)的 MCP 工具进行 可以自主拨打电话。

快速启动

克劳德桌面

添加到你的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json):

工具(64)

组 工具 目的
模型 load_model 将任何 HuggingFace 模型加载到内存中
模型 get_model_info 返回架构元数据
生成 generate_text 从加载模型生成文本
生成 predict_next_token 带概率的Top-k下一个代币预测
生成 tokenize 展示文本如何被标记化
生成 logit_lens 层层预测演化(校准Logit透镜)
生成 track_token 追踪特定标记在层间的概率
生成 track_race 跨层的N种候选标记带有交叉检测
生成 embedding_neighbors 在嵌入空间中求最近符号(余弦相似度)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

chuk-mcp-lazarus

Mechanistic interpretability MCP server wrapping chuk-lazarus.

Load any model, extract activations, train probes, steer generation, and ablate components – all via MCP tools that Claude (or any MCP client) can call autonomously.

Quick Start

# Clone and install
git clone https://github.com/chuk-ai/chuk-mcp-lazarus.git
cd chuk-mcp-lazarus
uv sync

# Run the smoke test (53 tests on SmolLM2-135M, ~3 seconds)
uv run python examples/smoke_test.py

# Run the full 15-step language transition demo
uv run python examples/language_transition_demo.py

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "lazarus": {
      "command": "uv",
      "args": ["run", "chuk-mcp-lazarus", "stdio"],
      "cwd": "/path/to/chuk-mcp-lazarus"
    }
  }
}

Tools (64)

Group Tool Purpose
Model load_model Load any HuggingFace model into memory
Model get_model_info Return architecture metadata
Generation generate_text Generate text from the loaded model
Generation predict_next_token Top-k next-token predictions with probabilities
Generation tokenize Show how text is tokenized
Generation logit_lens Layer-by-layer prediction evolution (calibrated logit lens)
Generation track_token Track a specific token’s probability across layers
Generation track_race Race N candidate tokens across layers with crossing detection
Generation embedding_neighbors Find nearest tokens in embedding space (cosine similarity)
Activations extract_activations Hidden states at specific layers and positions
Activations compare_activations Cosine similarity + PCA across prompts
Attention attention_pattern Per-head attention weights at specified layers
Attention attention_heads Per-head entropy and focus analysis
Probing train_probe Train a classifier on activations
Probing evaluate_probe Evaluate on held-out data
Probing scan_probe_across_layers Find the crossover layer
Probing probe_at_inference Run a trained probe during autoregressive generation
Probing list_probes List all trained probes
Steering compute_steering_vector Contrastive activation addition
Steering steer_and_generate Generate with steering applied
Steering list_steering_vectors List all computed vectors
Ablation ablate_layers Zero out layers, measure disruption
Ablation patch_activations Swap activations between prompts
Causal trace_token Which layers are causally necessary for a prediction
Causal full_causal_trace Position × layer causal heatmap (Meng et al. style)
Residual residual_decomposition Attention vs MLP contribution per layer
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "lazarus": { "command": "uv", "args": ["run", "chuk-mcp-lazarus", "stdio"], "cwd": "/path/to/chuk-mcp-lazarus" } } }