Skip to main content

A framework for efficiently scaffolding and interpreting multi-agent conversations (activation capture, steering, patching).

Project description

Interlens: Framework for Multi-Agent Conversation and Interpretability

This library provides a harness, optimized utilities, and interpretability hooks for multi-agent conversation rollouts.

A harness for multi-agent (model↔model) conversations with first-class interpretability — activation capture, steering, activation patching, and token logprobs, all hooked into the same generation path as real turns and tagged to conversation structure. Scales from one interactive dialogue to thousands of checkpointed, multi-GPU rollouts.

from interlens import Conversation

conv = Conversation.from_models(
    ("qwen2.5-0.5b", "qwen2.5-0.5b"), 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.

Install

pip install "git+https://github.com/Sid-MB/interlens"
# with the Claude-backed APIParticipant:
pip install "interlens[api] @ git+https://github.com/Sid-MB/interlens"

PyTorch / CUDA note

torch is declared as a plain, build-agnostic dependency — 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.
  • Scalerollout / run_conversations: multi-GPU, checkpointed, resumable, batched co-stepping, with in-worker analyze callbacks.
  • SerializationConversationTemplate (recipe) and full save/load (template + transcript).

See docs/examples/ for a simple→advanced walkthrough of the whole API.

Develop

git clone https://github.com/Sid-MB/interlens && cd interlens
pip install -e ".[dev]"
pytest                      # fast tests; real-model tests are opt-in: pytest -m slow

License

GNU AGPLv3 — see LICENSE.

Project details


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.4.tar.gz (156.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.4-py3-none-any.whl (108.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: interlens-0.1.4.tar.gz
  • Upload date:
  • Size: 156.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for interlens-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9546bc7d8f9497e0c74e9999d9cc77e1024cb8ad4e02164e6a93f5c5ff7837cf
MD5 63ee9fd0bef857465b271fdb66b278f4
BLAKE2b-256 cdc785a43c0f296aeb1ab01c91c0e1518b474c677acd0945e0b6e24b47f75e94

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: interlens-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for interlens-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bf09c3c5f6936b9e37b282e74b62e6b5935536138480d7f1275a89ea238ea231
MD5 8a06c57d97bd01236cb9092102480b3e
BLAKE2b-256 2e55d65fda2ffc85f73fcbbb1baff16644274d38c538fab99c0e0e75ec15acf5

See more details on using hashes here.

Provenance

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page