transformer_lens.model_bridge.sources.inspect.source module¶
boot_inspect — wrap an inspect_ai provider in a RemoteBridge via InspectDriver.
- transformer_lens.model_bridge.sources.inspect.source.boot_inspect(model_name: str, tokenizer: Any | None = None, dtype: dtype | None = None, provider: str = 'tl_bridge', **inspect_kwargs: Any) RemoteBridge¶
Boot a model via an
inspect_aiprovider and wrap it in aRemoteBridge.The driver is provider-agnostic:
providerdefaults to our own HF-backedtl_bridgeprovider (residual/attn/mlp capture + full affine interventions + full-sequence logits);"vllm-lens"targets a running vllm-lens vLLM provider (residual-only, additive-steering-only) — wire-aligned with its documented format, but not yet verified against a live provider.Fireable hooks (
tl_bridge, TransformerBridge-native names):blocks.{i}.hook_in(resid_pre) /ln2.hook_in(resid_mid) /hook_out(resid_post) /attn.hook_out/mlp.hook_out, plus the head-split attention hooks where the structural probe finds them:attn.hook_q/k/v(pre-RoPE projection outputs; separate-projection archs only — fused qkv gates them),attn.hook_z(out-projection input), andattn.hook_pattern(post-softmax, capture-only, eager attention required). The provider runs a structural self-check per model and gates any boundary it can’t serve faithfully:resid_midfor parallel-residual or norm-variant blocks,attn_out/mlp_outwhen their submodule isn’t locatable (it warns when it gates one).embed,ln_final, andattn.hook_attn_scoresare always non-fireable — useboot_transformers()for those.For parity with
boot_transformersthe provider loads with the same dtype (fp32 by default) and eager attention. Full-sequence logits ride onreturn_logits=True(the default); passreturn_logits=Falseto skip the (seq × d_vocab) payload for pure activation capture (run_with_cachekeeps them since it returns logits).