transformer_lens.model_bridge.sources.vllm.intervention_specs module

Intervention op vocabulary + spec validation shared by every producer path (VLLMDriver, the worker RPCs — which also cover the Inspect vLLM provider).

Adding a new op requires (a) listing it here, (b) allowing its keys in validate_spec, (c) handling it in worker_extension._apply_intervention.

transformer_lens.model_bridge.sources.vllm.intervention_specs.validate_spec(hook_name: str, spec: Any, *, width: int | None = None) dict

Validate one declarative intervention spec; returns a plain-dict copy.

width enables the value-shape check where the caller knows the hook width.