Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: acsresearch
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 20.1 MB
Statistics
  • Stars: 20
  • Watchers: 5
  • Forks: 3
  • Open Issues: 16
  • Releases: 7
Created almost 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

InterLab - toolkit for multi-agent interactions

GitHub Release PyPI Release Documentation Build status Open In Colab GitHub License

Welcome to InterLab, a research-focused toolkit created to facilitate study and experimentation in the realm of agent interactions, particularly those based on Language Learning Models (LLMs). Our primary objective is to simplify the process of crafting, deploying, and inspecting complex and structured queries within the context of agent interactions, while also providing robust support for interaction logging, UI and visualization. While we maintain a broad scope and plan to include game theoretic agents and a variety of scenarios, our main emphasis lies in the sphere of LLM interactions.

InterLab is developed at the Alignment of Complex Systems Research Group and distributed under MIT license (see LICENSE).

Current status: InterLab is in open beta. InterLab is also active development, we use it internally for our experiments, and we want to make it available to the wider research community. Although we aim to limit the breaking changes between major versions, the API may change substantially as we refine the design and gather information about usage.

If you use InterLab, want to share ideas, feedback or have any questions, please email us at gavento@acsresearch.org - we'd be happy to hear from you.

Overview

InterLab is composed of three main packages:

  • interlab contains the core functionality and common abstractions of actors, environments, memory, and language model interactions, along with a few helpful scaffolds. The main modules there are:
    • actor provides framework for actor interactions, including a generic LLM single-shot agent and a web console for playing as an actor, along with actor memory systems. The agents may be queried for structured (typed JSON-like) or unstuctured actions.
    • environment providing abstraction over partially observable environments.
    • queries contains powerful helpers for querying the models, in particular querying for any dataclass or Pydantic model with robust response parsing and retries, summarization tools etc.
  • treetrace offers comprehensive structured logging of nested TracingNodess, storage for traing nodes, and custom visualization of content such as Images, generic HTML, and tracking f-string-like field substitutions in larger text.
  • interlab_zoo serves as a repository for specific and opinionated implementations of actors, scenarios, actor memory systems, tracing post-processing, and other tools that enhance the InterLab project. Its mission is to gather code that is both widely applicable and useful, while maintaining a compact and focused core package.

Beyond that, some less-tested and experimental code can be found in experimental submodules accross the core package.

Structured interaction log browser

In-notebook or independent browser for the structured logs, with live updates, support for JSON-like structured data and inline visualizations. Captures both high-level interaction structure and the low-level API calls for easy inspection and debugging. Example screenshots (click to zoom in):

Tracing browser screenshot 1

Tracing browser screenshot 2

Example notebooks

You can find Jupyter notebooks with a few worked-out examples here. The notebook car_negotiation.ipynb is a good starting point for a simple bargaining simulation.

Installation

You can install the package interlab from PyPI using pip or any other package manager.

commandline pip install interlab

Installation with development tools

This repository utilizes Poetry package management, which is recommended for dependency installation and is required for InterLab development. Poetry automatically generates and manages a virtual environment for you, and also installs interlab module itself. If you have poetry installed, running the following command inside this repository will install InterLab:

commandline poetry install

pip and requirements.txt. Alternatively, pip can be used to install dependencies with pip install -r requirements.txt (core requirements) or pip install -r requirements-full.txt (including development tools, Jupyter Lab, etc.; equivalent to poetry install). To use InterLab in Google Colab, we use the requirements in requirements-colab.txt to get aroung some Colab versioning conflicts.

Development and experiments

Jupyter Lab provides the simplest way to interact with the code and design experiments:

```commandline poetry run jupyter lab

Or without poetry, in the project root folder:

jupyter lab ```

After running the command, open the provided link in your browser. notebooks/car_negotiation.ipynb is a recommended starting point.

Google Colab

Open In Colab

Google Colab often offers a lightweight alternative to setting up InterLab locally on your computer. Interlab comes with built-in colab compatibility and we have prepared a Example InterLab Colab experiment with common setup and a simple example experiment with two LLMs interacting on behalf of their users.

Note: API Keys

In order to use LLM provider serveics and APIs, you need to generate and provide the corresponding API keys. You can provide the keys as environment variables, via .env file, or interactively on every run (e.g. in the colab). Storing keys in the notebook is possible but not recommended (as they easily leak into git or while sharing the code).

API keys can be stored in a .env file located in the notebook directory or your home directory. (This file is ignored by git by default, providing an additional security measure.) The file is a simple text file with key=value pairs, for example:

text OPENAI_API_KEY=sk-... OPENAI_API_ORG=org-... ANTHROPIC_API_KEY=sk-ant-... ...

You can then import these variables from the .env file into a Jupyter notebook using the dotenv package:

python import dotenv dotenv.load_dotenv()

Contributions and development

To contribute, please submit a pull request with your proposed changes based on the latest main branch.

By submitting a pull request for this project, you agree to license your contribution under the MIT license to this project as written in the LICENSE file.

Citing InterLab

If you use InterLab in your researh, please cite it in your work using the "Cite this repository" github gadget or with:

Tomáš Gavenčiak, Ada Böhm: InterLab [Computer software]. 2023. https://github.com/acsresearch/interlab

Owner

  • Name: acsresearch
  • Login: acsresearch
  • Kind: organization

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: InterLab
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Tomáš
    family-names: Gavenčiak
    email: gavento@acsresearch.org
    affiliation: Charles University, ACS research
    orcid: 'https://orcid.org/0000-0003-1119-2426'
  - given-names: Ada
    family-names: Böhm
    email: ada@acsresearch.org
    affiliation: ACS research
    orcid: 'https://orcid.org/0000-0001-8044-7694'
repository-code: 'https://github.com/acsresearch/interlab'
license: MIT

GitHub Events

Total
  • Watch event: 2
  • Fork event: 1
Last Year
  • Watch event: 2
  • Fork event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 54 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 2
pypi.org: interlab

A research framework for artificial agent interactions

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 54 Last month
Rankings
Dependent packages count: 7.4%
Average: 38.3%
Dependent repos count: 69.1%
Maintainers (2)
Last synced: 7 months ago

Dependencies

.github/workflows/ci.yaml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • snok/install-poetry v1 composite
  • softprops/action-gh-release v1 composite
browser/package-lock.json npm
  • 1273 dependencies
browser/package.json npm
  • @emotion/react ^11.11.0
  • @emotion/styled ^11.11.0
  • @mui/icons-material ^5.11.16
  • @mui/material ^5.13.1
  • @rjsf/core ^5.10.0
  • @rjsf/mui ^5.10.0
  • @rjsf/utils ^5.10.0
  • @rjsf/validator-ajv8 ^5.10.0
  • @testing-library/jest-dom ^5.16.5
  • @testing-library/react ^13.4.0
  • @testing-library/user-event ^13.5.0
  • @types/jest ^27.5.2
  • @types/node ^16.18.32
  • @types/react ^18.2.6
  • @types/react-dom ^18.2.4
  • axios ^1.4.0
  • html-react-parser ^4.0.0
  • material-ui-popup-state ^5.0.9
  • react ^18.2.0
  • react-dom ^18.2.0
  • react-json-view-lite ^0.9.7
  • react-router-dom ^6.14.1
  • react-scripts 5.0.1
  • react-use-websocket ^4.3.1
  • typescript ^4.9.5
  • web-vitals ^2.1.4
poetry.lock pypi
  • 195 dependencies
pyproject.toml pypi
  • addict ^2.4.0
  • anthropic ^0.3.0
  • backoff ^2.2.1
  • cachetools ^5.3.1
  • dirtyjson ^1.0.8
  • fastapi ^0.95.2
  • jsonref ^1.1.0
  • langchain ^0.0.235
  • matplotlib ^3.7.1
  • openai ^0.27.4
  • pyserde ^0.10.5
  • python ^3.10
  • python-dotenv ^1.0.0
  • tiktoken ^0.4.0
  • tornado ^6.3.2
  • tqdm ^4.65.0
  • uvicorn ^0.22.0
requirements-colab.txt pypi
  • addict ==2.4.0
  • aiohttp ==3.8.5
  • aiosignal ==1.3.1
  • anthropic ==0.3.3
  • anyio ==4.0.0
  • async-timeout ==4.0.3
  • attrs ==23.1.0
  • backoff ==2.2.1
  • cachetools ==5.3.1
  • casefy ==0.1.7
  • certifi ==2023.7.22
  • charset-normalizer ==2.0.12
  • click ==8.1.7
  • colorama ==0.4.6
  • contourpy ==1.1.0
  • cycler ==0.11.0
  • dataclasses-json ==0.5.9
  • decorator ==4.4.2
  • dirtyjson ==1.0.8
  • distro ==1.8.0
  • exceptiongroup ==1.1.3
  • fastapi ==0.95.2
  • filelock ==3.12.3
  • fonttools ==4.42.1
  • frozenlist ==1.4.0
  • fsspec ==2023.9.0
  • greenlet ==2.0.2
  • h11 ==0.14.0
  • httpcore ==0.17.3
  • httptools ==0.6.0
  • httpx ==0.24.1
  • huggingface-hub ==0.16.4
  • idna ==3.4
  • jinja2 ==3.1.2
  • jsonref ==1.1.0
  • kiwisolver ==1.4.5
  • langchain ==0.0.235
  • langsmith ==0.0.7
  • markupsafe ==2.1.3
  • marshmallow ==3.20.1
  • marshmallow-enum ==1.5.1
  • matplotlib ==3.7.2
  • multidict ==6.0.4
  • mypy-extensions ==1.0.0
  • numexpr ==2.8.5
  • numpy ==1.22.4
  • openai ==0.27.10
  • openapi-schema-pydantic ==1.2.4
  • packaging ==23.1
  • pillow ==10.0.0
  • pydantic ==1.10.12
  • pyparsing ==3.0.9
  • pyserde ==0.10.8
  • python-dateutil ==2.8.2
  • python-dotenv ==1.0.0
  • pyyaml ==6.0.1
  • regex ==2023.8.8
  • requests ==2.27.1
  • six ==1.16.0
  • sniffio ==1.3.0
  • sqlalchemy ==2.0.20
  • starlette ==0.27.0
  • tenacity ==8.2.3
  • tiktoken ==0.4.0
  • tokenizers ==0.14.0
  • tornado ==6.3.3
  • tqdm ==4.66.1
  • typing-extensions ==4.7.1
  • typing-inspect ==0.9.0
  • urllib3 ==1.26.16
  • uvicorn ==0.22.0
  • uvloop ==0.17.0
  • watchfiles ==0.20.0
  • websockets ==11.0.3
  • yarl ==1.9.2
requirements-full.txt pypi
  • addict ==2.4.0
  • aiohttp ==3.8.5
  • aiosignal ==1.3.1
  • anthropic ==0.3.3
  • anyio ==4.0.0
  • appnope ==0.1.3
  • argon2-cffi ==23.1.0
  • argon2-cffi-bindings ==21.2.0
  • arrow ==1.2.3
  • asttokens ==2.4.0
  • async-lru ==2.0.4
  • async-timeout ==4.0.3
  • attrs ==23.1.0
  • babel ==2.12.1
  • backcall ==0.2.0
  • backoff ==2.2.1
  • beautifulsoup4 ==4.12.2
  • black ==23.9.0
  • bleach ==6.0.0
  • cachetools ==5.3.1
  • casefy ==0.1.7
  • certifi ==2023.7.22
  • cffi ==1.15.1
  • charset-normalizer ==3.2.0
  • click ==8.1.7
  • colorama ==0.4.6
  • comm ==0.1.4
  • contourpy ==1.1.0
  • csscompressor ==0.9.5
  • cycler ==0.11.0
  • dataclasses-json ==0.5.9
  • debugpy ==1.7.0
  • decorator ==5.1.1
  • defusedxml ==0.7.1
  • dirtyjson ==1.0.8
  • distro ==1.8.0
  • exceptiongroup ==1.1.3
  • executing ==1.2.0
  • fastapi ==0.95.2
  • fastjsonschema ==2.18.0
  • filelock ==3.12.3
  • flake8 ==6.1.0
  • fonttools ==4.42.1
  • fqdn ==1.5.1
  • frozenlist ==1.4.0
  • fsspec ==2023.9.0
  • ghp-import ==2.1.0
  • gitdb ==4.0.10
  • gitpython ==3.1.35
  • greenlet ==2.0.2
  • h11 ==0.14.0
  • htmlmin2 ==0.1.13
  • httpcore ==0.17.3
  • httptools ==0.6.0
  • httpx ==0.24.1
  • huggingface-hub ==0.16.4
  • idna ==3.4
  • iniconfig ==2.0.0
  • ipykernel ==6.25.2
  • ipython ==8.15.0
  • ipython-genutils ==0.2.0
  • ipywidgets ==8.1.0
  • isoduration ==20.11.0
  • isort ==5.12.0
  • jedi ==0.19.0
  • jinja2 ==3.1.2
  • jsmin ==3.0.1
  • json5 ==0.9.14
  • jsonpointer ==2.4
  • jsonref ==1.1.0
  • jsonschema ==4.19.0
  • jsonschema-specifications ==2023.7.1
  • jupyter ==1.0.0
  • jupyter-client ==8.3.1
  • jupyter-console ==6.6.3
  • jupyter-core ==5.3.1
  • jupyter-events ==0.7.0
  • jupyter-lsp ==2.2.0
  • jupyter-server ==2.7.3
  • jupyter-server-terminals ==0.4.4
  • jupyterlab ==4.0.5
  • jupyterlab-pygments ==0.2.2
  • jupyterlab-server ==2.24.0
  • jupyterlab-widgets ==3.0.8
  • kiwisolver ==1.4.5
  • langchain ==0.0.235
  • langsmith ==0.0.7
  • markdown ==3.4.4
  • markupsafe ==2.1.3
  • marshmallow ==3.20.1
  • marshmallow-enum ==1.5.1
  • matplotlib ==3.7.2
  • matplotlib-inline ==0.1.6
  • mccabe ==0.7.0
  • mergedeep ==1.3.4
  • mike ==1.1.2
  • mistune ==3.0.1
  • mkdocs ==1.5.2
  • mkdocs-git-revision-date-localized-plugin ==1.2.0
  • mkdocs-material ==9.2.8
  • mkdocs-material-extensions ==1.1.1
  • mkdocs-minify-plugin ==0.7.1
  • multidict ==6.0.4
  • mypy-extensions ==1.0.0
  • nbclient ==0.8.0
  • nbconvert ==7.8.0
  • nbformat ==5.9.2
  • nest-asyncio ==1.5.7
  • notebook ==7.0.3
  • notebook-shim ==0.2.3
  • numexpr ==2.8.5
  • numpy ==1.25.2
  • openai ==0.27.10
  • openapi-schema-pydantic ==1.2.4
  • overrides ==7.4.0
  • packaging ==23.1
  • paginate ==0.5.6
  • pandas ==2.1.0
  • pandocfilters ==1.5.0
  • parso ==0.8.3
  • pathspec ==0.11.2
  • pdoc ==14.0.0
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • pillow ==10.0.0
  • platformdirs ==3.10.0
  • pluggy ==1.3.0
  • prometheus-client ==0.17.1
  • prompt-toolkit ==3.0.39
  • psutil ==5.9.5
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pycodestyle ==2.11.0
  • pycparser ==2.21
  • pydantic ==1.10.12
  • pyflakes ==3.1.0
  • pygments ==2.16.1
  • pymdown-extensions ==10.3
  • pyparsing ==3.0.9
  • pyserde ==0.10.8
  • pytest ==7.4.2
  • pytest-asyncio ==0.21.1
  • python-dateutil ==2.8.2
  • python-dotenv ==1.0.0
  • python-json-logger ==2.0.7
  • pytz ==2023.3.post1
  • pywin32 ==306
  • pywinpty ==2.0.11
  • pyyaml ==6.0.1
  • pyyaml-env-tag ==0.1
  • pyzmq ==25.1.1
  • qtconsole ==5.4.4
  • qtpy ==2.4.0
  • referencing ==0.30.2
  • regex ==2023.8.8
  • requests ==2.31.0
  • rfc3339-validator ==0.1.4
  • rfc3986-validator ==0.1.1
  • rpds-py ==0.10.2
  • send2trash ==1.8.2
  • six ==1.16.0
  • smmap ==5.0.0
  • sniffio ==1.3.0
  • soupsieve ==2.5
  • sqlalchemy ==2.0.20
  • stack-data ==0.6.2
  • starlette ==0.27.0
  • tenacity ==8.2.3
  • terminado ==0.17.1
  • tiktoken ==0.4.0
  • tinycss2 ==1.2.1
  • tokenizers ==0.14.0
  • toml ==0.10.2
  • tomli ==2.0.1
  • tornado ==6.3.3
  • tqdm ==4.66.1
  • traitlets ==5.9.0
  • typing-extensions ==4.7.1
  • typing-inspect ==0.9.0
  • tzdata ==2023.3
  • uri-template ==1.3.0
  • urllib3 ==2.0.4
  • uvicorn ==0.22.0
  • uvloop ==0.17.0
  • verspec ==0.1.0
  • watchdog ==3.0.0
  • watchfiles ==0.20.0
  • wcwidth ==0.2.6
  • webcolors ==1.13
  • webencodings ==0.5.1
  • websocket-client ==1.6.2
  • websockets ==11.0.3
  • widgetsnbextension ==4.0.8
  • yarl ==1.9.2
requirements.txt pypi
  • addict ==2.4.0
  • aiohttp ==3.8.5
  • aiosignal ==1.3.1
  • anthropic ==0.3.3
  • anyio ==4.0.0
  • async-timeout ==4.0.3
  • attrs ==23.1.0
  • backoff ==2.2.1
  • cachetools ==5.3.1
  • casefy ==0.1.7
  • certifi ==2023.7.22
  • charset-normalizer ==3.2.0
  • click ==8.1.7
  • colorama ==0.4.6
  • contourpy ==1.1.0
  • cycler ==0.11.0
  • dataclasses-json ==0.5.9
  • dirtyjson ==1.0.8
  • distro ==1.8.0
  • exceptiongroup ==1.1.3
  • fastapi ==0.95.2
  • filelock ==3.12.3
  • fonttools ==4.42.1
  • frozenlist ==1.4.0
  • fsspec ==2023.9.0
  • greenlet ==2.0.2
  • h11 ==0.14.0
  • httpcore ==0.17.3
  • httptools ==0.6.0
  • httpx ==0.24.1
  • huggingface-hub ==0.16.4
  • idna ==3.4
  • jinja2 ==3.1.2
  • jsonref ==1.1.0
  • kiwisolver ==1.4.5
  • langchain ==0.0.235
  • langsmith ==0.0.7
  • markupsafe ==2.1.3
  • marshmallow ==3.20.1
  • marshmallow-enum ==1.5.1
  • matplotlib ==3.7.2
  • multidict ==6.0.4
  • mypy-extensions ==1.0.0
  • numexpr ==2.8.5
  • numpy ==1.25.2
  • openai ==0.27.10
  • openapi-schema-pydantic ==1.2.4
  • packaging ==23.1
  • pillow ==10.0.0
  • pydantic ==1.10.12
  • pyparsing ==3.0.9
  • pyserde ==0.10.8
  • python-dateutil ==2.8.2
  • python-dotenv ==1.0.0
  • pyyaml ==6.0.1
  • regex ==2023.8.8
  • requests ==2.31.0
  • six ==1.16.0
  • sniffio ==1.3.0
  • sqlalchemy ==2.0.20
  • starlette ==0.27.0
  • tenacity ==8.2.3
  • tiktoken ==0.4.0
  • tokenizers ==0.14.0
  • tornado ==6.3.3
  • tqdm ==4.66.1
  • typing-extensions ==4.7.1
  • typing-inspect ==0.9.0
  • urllib3 ==2.0.4
  • uvicorn ==0.22.0
  • uvloop ==0.17.0
  • watchfiles ==0.20.0
  • websockets ==11.0.3
  • yarl ==1.9.2