Skip to main content

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.

*Documentation for LLMs!

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-neutral Transcript; 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/…); APIParticipant for hosted models.
  • Interpretability — conv.capture(...), SteeringSpec, Patch, token_logprobs, backed by a queryable ActivationCache.
  • Scale — conv.rollout(...) / interlens.run([...]): multi-GPU, checkpointed, resumable, batched co-stepping, with in-worker analyzer callbacks; data-driven rollouts via dataset_field, matched compute via TokenBudget.
  • 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, and save/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.76

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for interlens 0.1.76
File Size Uploaded Provenance
interlens-0.1.76.tar.gz 893.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for interlens 0.1.76
File Interpreter ABI Platform
interlens-0.1.76-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / interlens-0.1.76.tar.gz

Download URL interlens-0.1.76.tar.gz
Size 893.1 kB
Tags Source
SHA-256 checksum
How to use checksums
940f0488e4c89b689a3f4b8d24caaf53229fb6bc4c1f0d10247791c8668f92be
BLAKE2b-256 checksum
How to use checksums
b1aa1d18991556c26940c346a6a2d8ab793abe5f6b8cf812d13470e0d8851b13
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 log

Release files / interlens-0.1.76-py3-none-any.whl

Download URL interlens-0.1.76-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
45352a47ac85d752dd71c08b6b2fbdd83f38a87f5cf6b5241edcb4e11aa4063f
BLAKE2b-256 checksum
How to use checksums
34e77672bf56c29ee278a4c204613c22d0058348ca8c2309cf4212ab3f4b0182
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 log

Security for interlens 0.1.76

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.

Select from 2 files

Attestation for interlens-0.1.76.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.1.76 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page