A framework for efficiently scaffolding and interpreting multi-agent conversations (activation capture, steering, patching).
Project description
Interlens: Framework for Multi-Agent Interaction and Interpretability
This library provides a harness, optimized utilities, and interpretability hooks for multi-agent conversation rollouts.
A harness for multi-agent (model-to-model) conversations with first-class interpretability—activation capture, steering, activation patching, and token logprobs—all hooked into the same generation path as real turns and tagged to conversation structure. Scales from one interactive dialogue to thousands of checkpointed, multi-GPU rollouts.
from interlens import Conversation
conv = Conversation.from_models(
("Qwen/Qwen2.5-0.5B-Instruct", "Qwen/Qwen2.5-0.5B-Instruct"), names=("alice", "bob"),
shared_context="Let's debate: is cereal a soup?",
)
conv.run(turns=4, first="alice")
print(conv.transcript)
See docs/examples for sample code.
Install
pip install interlens
# with hosted-API participants (APIParticipant):
pip install "interlens[api]"
PyTorch / CUDA note
torch is declared as a plain, build-agnostic dependency — install the wheel matching your platform (CUDA / CPU / MPS) before or alongside interlens. E.g. for CUDA 13.0:
pip install torch --index-url https://download.pytorch.org/whl/cu130
See https://pytorch.org/get-started/locally/.
What's inside
Conversation— turn-taking over a shared, perspective-neutralTranscript; per-speaker view pipeline (system/private framing → context-fit → family-correct chat template).AutoModelParticipant— HF-style factory (from_pretrained/from_model/from_) that returns the family-correct participant (Qwen/Gemma/…);APIParticipantfor hosted models.- Interpretability —
conv.capture(...),SteeringSpec,Patch,token_logprobs, backed by a queryableActivationCache. - Scale —
rollout/run_conversations: multi-GPU, checkpointed, resumable, batched co-stepping, with in-workeranalyzecallbacks. - Serialization —
ConversationTemplate(recipe) and full save/load (template + transcript).
See docs/examples/ for a simple→advanced walkthrough of the whole API.
Develop
git clone https://github.com/Sid-MB/interlens && cd interlens
pip install -e ".[dev]"
pytest
# fast tests; opt-in to thorough tests requiring downloading models + a GPU with: pytest -m slow
License
GNU AGPLv3 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interlens-0.1.9.tar.gz.
File metadata
- Download URL: interlens-0.1.9.tar.gz
- Upload date:
- Size: 163.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bad22eff414a6e8ece2468a40bf199c14fc6c1fa666349c5be29c3ba7b1f539
|
|
| MD5 |
2fc45e6e3be05b9f8b51a9649927eb8b
|
|
| BLAKE2b-256 |
3cfc485add304807d7f38d72969362b6e3ec363eaadef65ef808b424ded6c740
|
Provenance
The following attestation bundles were made for interlens-0.1.9.tar.gz:
Publisher:
publish.yml on Sid-MB/interlens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interlens-0.1.9.tar.gz -
Subject digest:
0bad22eff414a6e8ece2468a40bf199c14fc6c1fa666349c5be29c3ba7b1f539 - Sigstore transparency entry: 2055845457
- Sigstore integration time:
-
Permalink:
Sid-MB/interlens@bdbe1a3b589311d542915241532031ea4dff8974 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Sid-MB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bdbe1a3b589311d542915241532031ea4dff8974 -
Trigger Event:
push
-
Statement type:
File details
Details for the file interlens-0.1.9-py3-none-any.whl.
File metadata
- Download URL: interlens-0.1.9-py3-none-any.whl
- Upload date:
- Size: 112.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78ae70799112b10ebb8e519456ed01ec4ca3a628494149992c6760e7a7f0c012
|
|
| MD5 |
525e78ec4e3fd4f309738b367a425b99
|
|
| BLAKE2b-256 |
8d681f36a3202073f37633fc886db30c837280882ce796c5a730e2d3a15f9f93
|
Provenance
The following attestation bundles were made for interlens-0.1.9-py3-none-any.whl:
Publisher:
publish.yml on Sid-MB/interlens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interlens-0.1.9-py3-none-any.whl -
Subject digest:
78ae70799112b10ebb8e519456ed01ec4ca3a628494149992c6760e7a7f0c012 - Sigstore transparency entry: 2055845716
- Sigstore integration time:
-
Permalink:
Sid-MB/interlens@bdbe1a3b589311d542915241532031ea4dff8974 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Sid-MB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bdbe1a3b589311d542915241532031ea4dff8974 -
Trigger Event:
push
-
Statement type: