Skip to content

alanchelmickjr/consensus

Repository files navigation

ERACAI: AI Consensus Live Response Evaluation and Tuning Mechanism for Chat/Completion Open Source

This is branched off the original framework for the Myriad Engine (PRO version).

Below find the first vanilla template I created in Feb24. Good "starting" place for thoughts. [February 2024 V1.0 Alpha] <- https://github.com/alanchelmickjr/consensus/tree/Vanilla-Template-01-Backup

ERACAI (Ensemble Response through AI Consensus) is a cutting-edge AI system that leverages multiple language models to generate consensus-based responses. By querying various AI models and implementing a majority voting mechanism, ERACAI provides more reliable and balanced answers to user queries.

Features

  • Multi-Model Querying: Simultaneously queries OpenAI, Anthropic, Google, and Groq AI models.
  • Consensus Mechanism: Implements majority voting to determine the best response.
  • Asynchronous Processing: Utilizes asyncio for efficient parallel processing of model queries.
  • Weaviate Integration: Stores results in a Weaviate vector database for future reference and analysis.
  • FastAPI Backend: Provides a robust and fast API interface for easy integration.
  • CLI Tool: Includes a command-line interface for quick testing and interaction.

Installation

  1. Clone the repository: git clone https://github.com/yourusername/eracai.git cd eracai

  2. Install the package: pip install -e .

  3. Set up your environment variables by copying the '.env.example' file to '.env' and filling in your API keys: cp .env.example .env

Usage

As a Python Package

from eracai.main import consensus_response

async def main():
    result = await consensus_response("Who is the hottest actress this year?")
    print(result.content)

asyncio.run(main())

API

Start the FastAPI server:

uvicorn eracai.api:app --reload

Then, you can send POST requests to 'http://localhost:8000/query' with a JSON body:

{
  "text": "Who is the hottest actress this year?",
  "max_tokens": 100,
  "temperature": 0.7
}

CLI

eracai query "Who is the hottest actress this year?"

Configuration

Adjust the settings in your '.env' file to configure API keys, model parameters, and Weaviate connection details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

About

Consensus allows you to query multiple models, in a moderated fashion, to produce robust and agreed upon answers.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages