An intelligent orchestration system that queries multiple LLMs in parallel, uses a judge to select the best response, and maintains semantic memory for context-aware conversations.
- Multi-LLM Orchestration: Parallel queries to Gemini, ChatGPT, Groq, and Ollama
- AI Judge System: Intelligent evaluation and selection of best responses
- Semantic Memory: Vector-based memory storage using Milvus for context retention
- Intent Recognition: Smart routing based on query intent and conversation history
- Context-Aware Routing: Distinguishes between follow-ups and new topics
- Human Feedback Loop: Approve, modify, or reject AI responses
- Python: 3.8 or higher
- Milvus: Vector database (optional, for memory features)
- Ollama: Local LLM runtime (optional, for Ollama support)
git clone https://github.com/KK-is-Coding/multi-llm_judge.git
cd Multi-LLM_JUDGEpip install -r router/requirements.txtRequired packages:
aiohttp- Async HTTP clientgoogle-genai- Google Gemini APIopenai- OpenAI APIgroq- Groq APIpython-dotenv- Environment variable managementpymilvus- Milvus vector database client
Create a .env file in the router/ directory:
# router/.env
# Required API Keys (get at least one)
GEMINI_API_KEY=your_gemini_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
GROQ_API_KEY=your_groq_api_key_here
# Optional: Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434Where to get API keys:
- Gemini: Google AI Studio
- OpenAI: OpenAI Platform
- Groq: Groq Console
For full memory capabilities, install and run Milvus:
Using Docker:
# Download Milvus standalone
wget https://github.com/milvus-io/milvus/releases/download/v2.3.0/milvus-standalone-docker-compose.yml -O docker-compose.yml
# Start Milvus
docker-compose up -dOr use Milvus Lite (simpler):
pip install milvusFor local LLM support:
- Install Ollama from ollama.ai
- Pull the DeepSeek model:
ollama pull deepseek-r1:1.5bpython main.pyUser: What is machine learning?
The system will:
- Extract intent from your query
- Send to all configured LLMs in parallel
- Judge evaluates all responses
- Returns the best answer
User: What is machine learning?
Assistant: [Provides answer]
User: Can you explain it more simply?
The system recognizes follow-ups and routes appropriately.
After receiving a response, you can:
- Approve: Accept the answer (saved to memory)
- Modify: Edit and improve the response
- Reject: Request regeneration with feedback
Multi-LLM_JUDGE/
├── main.py # Entry point
├── router/
│ ├── orchestrator.py # Main orchestration logic
│ ├── llm_generators.py # LLM API integrations
│ ├── judge.py # Response evaluation
│ ├── intent.py # Intent extraction
│ ├── context.py # Context management
│ ├── memory.py # Memory operations
│ ├── vector_store.py # Milvus integration
│ ├── feedback.py # Human feedback handling
│ └── requirements.txt # Dependencies
├── backend/ # Alternative backend implementation
└── .env # Environment variables (create this)
Edit router/llm_generators.py to change models to the their latest versions:
# Gemini
model="gemini-flash-latest"
# ChatGPT
model="gpt-4o-mini"
# Groq
model="llama-3.3-70b-versatile"
# Ollama
model_name="deepseek-r1:1.5b"Modify prompts in:
llm_generators.py- Generator behaviorjudge.py- Judge evaluation criteriaintent.py- Intent extraction logic
Run the verification script:
python router/verify_router.py- Ensure your
.envfile is in therouter/directory - Check that API keys are valid and have proper permissions
- Verify Milvus is running:
docker ps(if using Docker) - Check connection settings in
vector_store.py - System will work without Milvus (limited memory)
- Ensure Ollama is running:
ollama list - Verify model is installed:
ollama pull deepseek-r1:1.5b - Check
OLLAMA_BASE_URLin.env
- Reinstall dependencies:
pip install -r router/requirements.txt - Ensure you're running from the project root directory
User Query
↓
Intent Extraction
↓
Context Analysis ──→ Memory Check
↓
Routing Decision
├─→ New Query: All LLMs in parallel
└─→ Follow-up: Judge only
↓
Judge Evaluation
↓
Best Response
↓
Human Feedback ──→ Save to Memory
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
This project is open source and available under the MIT License.
- Repository: https://github.com/KK-is-Coding/multi-llm_judge
For questions or support, please open an issue on GitHub.
Made with ❤️ using multiple LLMs