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.53.tar.gz (424.4 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.53-py3-none-any.whl (550.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: interlens-0.1.53.tar.gz
  • Upload date:
  • Size: 424.4 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.53.tar.gz
Algorithm Hash digest
SHA256 fb82558faa94e88e439f703026a752127ca51435cf0a9732f951c60a02efc159
MD5 b17c6540f056472f6fba373ec03d0fb9
BLAKE2b-256 044ef271b593f7bce69d8a9a42970cee46034c1cec3d7f4de6efda77305aabb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for interlens-0.1.53.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.53-py3-none-any.whl.

File metadata

  • Download URL: interlens-0.1.53-py3-none-any.whl
  • Upload date:
  • Size: 550.5 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.53-py3-none-any.whl
Algorithm Hash digest
SHA256 2631f0f3a3a1164bcbc68535787c685ed608686d7d10b837975d739d109163a6
MD5 8c991307130d3717f529153b50487a48
BLAKE2b-256 b2e70d0e54a9d029f4ad619ce51e8ac37dfaf88f8e0fc8772989785a03717375

See more details on using hashes here.

Provenance

The following attestation bundles were made for interlens-0.1.53-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

0.1.59

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

This release

0.1.53 This release

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