IterativeLLMRefiner is an innovative project that implements a chain of Large Language Models (LLMs) to iteratively refine and improve prompts. By leveraging multiple LLMs in sequence, each model builds upon the previous output, resulting in more detailed, accurate, and coherent responses.
- Iterative Refinement: Uses multiple LLMs in sequence to progressively improve responses
- Hardware-Aware: Automatically selects models based on available RAM and use cases
- Domain Detection: Intelligently identifies the domain of the input prompt
- Optional Reasoning: Includes step-by-step reasoning for complex queries
- Streaming Responses: Real-time streaming of model outputs
- Docker Support: Easy deployment with Docker and Docker Compose
- Modern Web Interface: User-friendly frontend for interaction
- Docker and Docker Compose
- At least 8GB of RAM (for basic models)
- Ollama installed and running locally
- Clone the repository:
git clone https://github.com/dhruv1110/IterativeLLMRefiner.git
cd IterativeLLMRefiner
- Start the application using Docker Compose:
docker-compose up
- Open your browser and navigate to
http://localhost:3000
The project consists of three main components:
- Frontend: React-based web interface for user interaction
- Backend: FastAPI server handling model interactions and processing
- Ollama Integration: Local LLM server for model inference
The system supports various models based on available RAM:
- 8GB: Basic models (3B-7B parameters)
- 16GB: Medium models (7B-14B parameters)
- 32GB: Large models (13B-32B parameters)
- 64GB: Extra large models (70B parameters)
- 128GB: Ultra large models (110B parameters)
Models are categorized by use case:
- General
- Research
- Reasoning
- Coding
- Vision
GET /models
: List available modelsGET /pull-model
: Pull a specific modelPOST /generate
: Generate refined responses using the model chain
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
cd backend
pip install -r requirements.txt
- Run the development server:
uvicorn main:app --reload
- Install dependencies:
cd frontend
npm install
- Start the development server:
npm start
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Ollama for providing the LLM infrastructure
- All the open-source LLM models used in this project
- The open-source community for their valuable contributions