Interlens: Framework for Multi-Agent Interaction and Interpretability
This library provides a harness, optimized utilities, and interpretability hooks for multi-agent conversation 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, and the API reference for every public class and function.
Install
pip install interlens
# with hosted-API participants (APIParticipant):
pip install "interlens[api]"
PyTorch / CUDA note
torch — 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 —
conv.rollout(...)/interlens.run([...]): multi-GPU, checkpointed, resumable, batched co-stepping, with in-workeranalyzercallbacks; data-driven rollouts viadataset_field, matched compute viaTokenBudget. - One object, no ceremony — a
Conversation(with lazy participants) is at once the serializable recipe, the live dialogue, and the rollout driver; build it functionally (.turns(6).data(ds).analyzer(grade)),.set(...)copy-on-write, andsave/load(recipe + transcript).
See docs/examples/ for a simple→advanced walkthrough of the whole API, and docs/reference/ for the generated per-symbol reference.
Develop
git clone https://github.com/Sid-MB/interlens && cd interlens
uv sync # installs the package + dev group (pytest, pre-commit)
uv run pre-commit install # one-time
uv run pytest
# fast tests; opt-in to thorough tests requiring downloading models + a GPU with: pytest -m slow
License
GNU AGPLv3 — see LICENSE.
Metadata
Release files for interlens 0.1.77
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| interlens-0.1.77.tar.gz | 893.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| interlens-0.1.77-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.0 MB
Release files / interlens-0.1.77.tar.gz
| Download URL | interlens-0.1.77.tar.gz |
|---|---|
| Size | 893.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6edea0ebc3975ac2ab245e273736ce529436bb8ad536606430c3f3aeba40a7bb
|
|
BLAKE2b-256 checksum How to use checksums |
0892b0d477d087641979f3127f953d0abfd0e0e1a5bcd7a01afaa9e943eb1d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logRelease files / interlens-0.1.77-py3-none-any.whl
| Download URL | interlens-0.1.77-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6db24a6316fb6afa31101a3de9440449e57b585706cb96e13a14b484e095c498
|
|
BLAKE2b-256 checksum How to use checksums |
27f24e05ba21ee7e2efa72cb9e3f0482104bfc67420f69b63f30cd5c52e7ddb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logSecurity for interlens 0.1.77
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for interlens-0.1.77.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.