Skip to main content

The LLM Automatic Computer Framework

Project description

L2MAC: Large Langauge Model Automatic Computer

L2MAC logo: The first practical LLM-based general-purpose stored-program automatic computer (von Neumann architecture) framework, an LLMbased multi-agent system, for extensive and consistent output generation.

Pioneering the first practical LLM-based general-purpose stored-program automatic computer (von Neumann architecture) framework in an LLM-based multi-agent system, for solving complex tasks through generating extensive and consistent outputs, unbounded by the LLMs fixed context window constraint.

License: MIT roadmap Discord Follow

News

🌟 May. 7 - 11th, 2024: We will present L2MAC at the International Conference on Learning Representations (ICLR) 2024. Come meet us at ICLR in Vienna Austria! Please reach out to me at sih31 (at) cam.ac.uk so we can meet, virtual meetings accepted as well!

🌟 April. 13, 2024: L2MAC is fully open-sourced with the initial version released.

🚀 Jan. 16, 2024: The paper L2MAC: Large Language Model Automatic Computer for Extensive Code Generation is accepted for presentation at ICLR 2024!

LLM-Automatic Computer (L2MAC) framework excels at solving large complex tasks, such as being state-of-the-art for generating large codebases, or it can even write entire books, all of which bypass the traditional constraints of the LLMs fixed context window constraint.

  • LLM-Automatic Computer can take a one line input prompt and generate an extensive and large output, for example generating an entire complex codebase.
    • Internally, the LLM-Automatic Computer uses a prompt-program which is a series of prompts, each providing a instruction step to execute. Unless explicitly given, the prompt-program is self generated (bootstrapped) and executed. Specifically each instruction step of the prompt-program is loaded into a new LLM agent to execute, whose context is managed by a control unit and is provided with tools so that it can read and write to a persistent memory, here a file store, which contains the final and intermediate outputs. This enables it to automatically execute general-purpose prompt programs to solve complex tasks, that require extensive cohesive outputs, where the output is unbounded and not constrained by the LLMs underlying context window constraint.

BlockDiagram

LLM-Automatic Computer (L2MAC) instantiation for coding a large complex codebase for an entire application based on a single user prompt. Here we provide L2MAC with additional tools to check for any syntax errors within the code and run any unit tests if they exist, and call this instantiation Code-L2MAC.

Get Started

Installation

Ensure that Python 3.7+ is installed on your system. You can check this by using: python --version. You can use conda like this: conda create -n l2mac python=3.9 && conda activate l2mac

pip install --upgrade l2mac
# or `pip install --upgrade git+https://github.com/samholt/l2mac`
# or `git clone https://github.com/samholt/l2mac && cd l2mac && pip install --upgrade -e .`

For detailed installation guidance, please refer to installation

Configuration

You can init the config of L2MAC by running the following command, or manually create ~/.L2MAC/config.yaml file:

# Check https://samholt.github.io/L2MAC/guide/get_started/configuration.html for more details
l2mac --init-config  # it will create ~/.l2mac/config.yaml, just modify it to your needs

You can configure ~/.l2mac/config.yaml according to the example and doc:

llm:
  api_type: "openai"  # or azure etc. Check ApiType for more options
  model: "gpt-4-turbo-preview"  # or "gpt-4-turbo"
  base_url: "https://api.openai.com/v1"  # or forward url / other llm url
  api_key: "YOUR_API_KEY"

Usage

After installation, you can use L2MAC CLI

l2mac "Create a beautiful, playable and simple snake game with pygame. Make the snake and food be aligned to the same 10-pixel grid."  # this will create a codebase repo in ./workspace

or use it as a library

from l2mac import generate_codebase
codebase: dict = generate_codebase("Create a beautiful, playable and simple snake game with pygame. Make the snake and food be aligned to the same 10-pixel grid.")
print(codebase)  # it will print the codebase (repo) complete with all the files as a dictionary, and produce a local codebase folder in ./workspace

QuickStart

Tutorial

Support

Discord Join US

📢 Join Our Discord Channel! Looking forward to seeing you there! 🎉

Contact Information

If you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!

  • Email: sih31 at cam.ac.uk
  • GitHub Issues: For more technical inquiries, you can also create a new issue in our GitHub repository.

We will respond to all questions within 2-3 business days.

Citation

To stay updated with the latest research and development, follow @samianholt on Twitter.

To cite L2MAC in publications, please use the following BibTeX entry.

@inproceedings{
    holt2024lmac,
    title={L2{MAC}: Large Language Model Automatic Computer for Unbounded Code Generation},
    author={Samuel Holt and Max Ruiz Luyten and Mihaela van der Schaar},
    booktitle={The Twelfth International Conference on Learning Representations},
    year={2024},
    url={https://openreview.net/forum?id=EhrzQwsV4K}
}

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

l2mac-0.0.1.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

l2mac-0.0.1-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file l2mac-0.0.1.tar.gz.

File metadata

  • Download URL: l2mac-0.0.1.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for l2mac-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9fdd724a0863da031b4acc47e1b6a71ed8be3f8fbdd9e4450982b0b28a6c4d99
MD5 ed7057284ee96d2688519262d24b67f8
BLAKE2b-256 3e6b1a3a529840c88b7423a0bb766b4b41c2fc8b0c9fd0fe5dc078a3b754a875

See more details on using hashes here.

File details

Details for the file l2mac-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: l2mac-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 51.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for l2mac-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c8b36ec4ee2e24e188665c59796b27ec5759729e0ae7e818f9f9a119127d2c7
MD5 1ad990d2352d6838982da6656fa06c9f
BLAKE2b-256 574e7cd14aea01abfa81c57f375a436249ee21d0c743bef09a719aed6dfbb69c

See more details on using hashes here.

Supported by

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