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.

*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.
  • Interpretabilityconv.capture(...), SteeringSpec, Patch, token_logprobs, backed by a queryable ActivationCache.
  • Scaleconv.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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interlens-0.1.59.tar.gz (477.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interlens-0.1.59-py3-none-any.whl (617.1 kB view details)

Uploaded Python 3

File details

Details for the file interlens-0.1.59.tar.gz.

File metadata

  • Download URL: interlens-0.1.59.tar.gz
  • Upload date:
  • Size: 477.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for interlens-0.1.59.tar.gz
Algorithm Hash digest
SHA256 84ce4de1768fe2d14d6066369555478da5ec457ee54c43621b1271ad3b716b0e
MD5 690080c6caacb95505178b28e2add09d
BLAKE2b-256 7131cf1ccca28ccc3c41e2c56424b87aef57e9742a7e4bb51fcdab705b1fd86e

See more details on using hashes here.

Provenance

The following attestation bundles were made for interlens-0.1.59.tar.gz:

Publisher: publish.yml on Sid-MB/interlens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file interlens-0.1.59-py3-none-any.whl.

File metadata

  • Download URL: interlens-0.1.59-py3-none-any.whl
  • Upload date:
  • Size: 617.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for interlens-0.1.59-py3-none-any.whl
Algorithm Hash digest
SHA256 402e7f711375061e489257e64a55a02dbcc96c8f68443b82878d6d7a36608b19
MD5 96da6e98e05d4ae5faf3f616b2fbfe0e
BLAKE2b-256 59f29769a5940e7d5a4ba7174744610fedc742aa4b80666c8b7a1c27b2607c7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for interlens-0.1.59-py3-none-any.whl:

Publisher: publish.yml on Sid-MB/interlens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.74

2 files

0.1.73

2 files

0.1.72

2 files

0.1.71

2 files

0.1.70

2 files

0.1.69

2 files

0.1.67

2 files

0.1.66

2 files

0.1.65

2 files

0.1.64

2 files

0.1.63

2 files

0.1.62

2 files

0.1.61

2 files

0.1.60

2 files

This release

0.1.59 This release

2 files

0.1.58

2 files

0.1.57

2 files

0.1.56

2 files

0.1.55

2 files

0.1.54

2 files

0.1.53

2 files

0.1.52

2 files

0.1.51

2 files

0.1.50

2 files

0.1.49

2 files

0.1.48

2 files

0.1.47

2 files

0.1.46

2 files

0.1.45

2 files

0.1.44

2 files

0.1.43

2 files

0.1.42

2 files

0.1.41

2 files

0.1.40

2 files

0.1.39

2 files

0.1.38

2 files

0.1.37

2 files

0.1.36

2 files

0.1.35

2 files

0.1.34

2 files

0.1.33

2 files

0.1.32

2 files

0.1.31

2 files

0.1.30

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

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