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.67.tar.gz (529.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.67-py3-none-any.whl (672.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: interlens-0.1.67.tar.gz
  • Upload date:
  • Size: 529.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.67.tar.gz
Algorithm Hash digest
SHA256 4bdc7c15fd8c2d952be9e8d71f57130e404bbb408f631f88ee5b9e07cea616d1
MD5 393499e29f4863477d39407fc41dd0f8
BLAKE2b-256 ef1b833e9986964c1564935645016c57ba5ae4047e09df98044a1d5754c9a220

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: interlens-0.1.67-py3-none-any.whl
  • Upload date:
  • Size: 672.7 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.67-py3-none-any.whl
Algorithm Hash digest
SHA256 46d05e125531abd75138abfa2aa7494ae522ffd452f69dc5f096f6c3d3b0bdd4
MD5 131dfab7c9cb8dc077e58092bcf4d4c8
BLAKE2b-256 06d497619c146ffdf39b20f6cfb5b29c3057a2f83d52f0dcd147a9980708fd7a

See more details on using hashes here.

Provenance

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

This release

0.1.67 This release

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

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