This repository contains a Node.js application that orchestrates epic debates between two large language models (LLMs) where wit and logic are the ultimate weapons.
- Modular design: The application is built with a modular architecture, making it easy to add or remove components as needed.
- Customizable: You can easily customize the system prompts for each LLM, the dialog turns, and the overall conversation flow. Want a heated debate on the merits of pineapple on pizza? You got it! 🍕
- Extensible: The application can be extended to support different LLMs. Bring on the contenders!
- Logging: The entire debate is logged to a file for later analysis and amusement. Who emerged victorious? 🏆
-
Clone the repository:
git clone https://github.com/your-username/AI-Debate-Lords.git
-
Install dependencies:
cd AI-Debate-Lords npm install
-
Configure the application:
- Duplicate the
.env.example
file and rename it to.env
. - In the
.env
file, configure your LLMs with API endpoints, keys and model names. Both Gemini and OpenAI standards are supported. Go nuts. - Modify the
system_prompt_llm1.txt
andsystem_prompt_llm2.txt
files to set the initial instructions for each LLM. Will they be polite or ruthless? 🥊 - (Optional) Modify the
input.txt
with the initial question. What will be the battle ground?
- Duplicate the
-
Run the application:
specify your question and how many rounds you want:
ts-node index.ts "Do you think public flatulence should be destigmatized?" 9
or if you have a multi line question:
ts-node index.ts "" 9 --file .\the-fart-question.txt
The application will initiate a clash of the titans between the two configured LLMs. The debate will rage on for the specified number of turns, with each LLM generating responses based on the ongoing battle and its initial instructions. The whole showdown will be meticulously recorded in a log file.
The application follows a modular architecture with the following key components:
- LLM Manager: Handles communication with the LLMs, sending prompts and receiving responses.
- Debate Moderator: Orchestrates the debate flow, ensuring each LLM gets its turn and enforcing the rules of engagement.
- Logger: Records the entire debate for posterity.
llm.ts
– Defines theLLM
class, which encapsulates the interaction with a single LLM.conversation.ts
– Defines theConversation
class, which manages the debate flow and turn-taking.config.ts
– Stores the application's configuration settings.
The application relies on the following key dependencies:
axios
: For making HTTP requests to the LLMs' APIs.dotenv
: For loading environment variables from a.env
file.
Want to witness even more spectacular AI battles? Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests. Maybe you can even train a new gladiator to enter the arena!
This project is licensed under the MIT License - unleash the AI!