Library and CLI for debating LLMs
Project description
# AutoDebater
[![Coverage Status](https://coveralls.io/repos/github/nrlewis/autodebater/badge.svg?branch=main)](https://coveralls.io/github/nrlewis/autodebater?branch=main)
![GitHub Release](https://img.shields.io/github/v/release/nrlewis/autodebater)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/nrlewis/autodebater/pylint.yml)
![GitHub License](https://img.shields.io/github/license/nrlewis/autodebater)
AutoDebater is a Python library and CLI for engaging Large Language Models (LLMs) in structured debates. It allows for the creation and management of debates between LLMs, including the ability to judge and score the arguments presented.
> **Note:** This project is a work in progress. Contributions and feedback are welcome!
## Features
- **Library and CLI**: Engage with LLMs in debates programmatically or via the command line.
- **Multiple Roles**: Support for debaters and judges, with configurable prompts and behaviors.
- **Extensible**: Designed to be extended with different LLM backends.
## Installation
### Pip
You can install AutoDebater using pip:
```sh
pip install autodebater
```
Poetry for Development
AutoDebater uses Poetry for dependency management. You can install it with the following steps:
-
Install Poetry if you haven't already:
curl -sSL https://install.python-poetry.org | python3 -
-
Add to your project
git clone https://github.com/nrlewis/autodebater.git cd autodebater
-
Install dependencies:
poetry install
Setup
Before using AutoDebater, you need to set your OpenAI API key:
export OPENAI_API_KEY="your_openai_api_key"
Usage
CLI
You can use the CLI to start a debate. For example:
poetry run autodebater judged_debate "AI will surpass human intelligence" --epochs 2
Library
You can also use AutoDebater as a library:
from autodebater.debate import JudgedDebate
from autodebater.participants import Debater, Judge
debate = JudgedDebate(motion="AI will surpass human intelligence", epochs=2)
debate.add_debaters(Debater(name="Debater1", motion="AI will surpass human intelligence", stance="for"))
debate.add_debaters(Debater(name="Debater2", motion="AI will surpass human intelligence", stance="against"))
debate.add_judge(Judge(name="Judge1", motion="AI will surpass human intelligence"))
for message in debate.debate():
print(message)
Configuration
Modifying Prompts
The prompts used by AutoDebater can be modified by editing the defaults.yaml
file. This allows you to customize the behavior and responses of the debaters and judges to better fit your specific use case.
pyproject.toml
This file contains the configuration for Poetry, including dependencies and build settings.
.pylintrc
The Pylint configuration file is set up to follow the Google Python style guide and includes several custom rules and settings.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Write tests for your changes.
- Ensure all tests pass.
- Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Changelog
See the CHANGELOG file for a detailed list of changes and updates.
Contact
For any questions or issues, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for autodebater-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b17fe76a1f7439ee4fdc38bb2e432d8f809c76a9df84f05057a1aa892b85fe |
|
MD5 | e90d1384019a02468323a95aabbd6fdc |
|
BLAKE2b-256 | 74f73f5b18899be4ff8f389bdd9ce85a4ed78fd209ac1907bdbc8398e48b053b |