EvalAI is an explainable human-preference evaluation platform for competing large language model (LLM) responses. It generates two answers for the same prompt, uses a trained RoBERTa reward model to predict the preferred response, and combines that prediction with human feedback and evaluation diagnostics.
This repository contains the working prototype for our Smart India Hackathon (SIH) project. It is designed as a local-first demonstration that makes LLM response quality easier to compare, review, and analyze.
Different LLMs can produce very different answers to the same prompt. Comparing those answers manually is slow, subjective, and difficult to reproduce. A useful evaluation workflow should:
- Compare responses under the same prompt.
- Provide a consistent model-based preference signal.
- Keep a human evaluator in the loop.
- Measure performance on held-out data.
- Surface potential position and verbosity bias.
EvalAI creates a complete comparison loop:
- A user enters a prompt.
- Two locally hosted Ollama models generate competing responses.
- A trained RoBERTa reward model scores both responses.
- The system predicts whether Response A or Response B is preferred.
- A human evaluator can submit A, B, or Tie feedback.
- Held-out evaluation and bias checks measure model behavior.
The result is a practical evaluation interface rather than a single opaque score.
- Side-by-side response generation: Generate two answers from the same prompt.
- Preference prediction: Use the trained RoBERTa model to rank the responses.
- Human review: Record human preference as A, B, or Tie.
- Rating-weighted feedback: Capture helpfulness, correctness, relevance, clarity, and safety ratings for training signals.
- Safe feedback retraining: Fine-tune a candidate model and activate it only when it outperforms the current model on held-out evaluation.
- Held-out evaluation: Measure accuracy, precision, recall, F1-score, and ROC-AUC.
- Bias diagnostics: Check sensitivity to response order and answer verbosity.
- Local and private workflow: Run the application with local models and local data.
- Interactive dashboard: Use the Streamlit interface to compare, review, and inspect results.
User prompt
|
+--> Ollama model A (llama3.2) ----> Response A --+
| |
+--> Ollama model B (qwen2.5:3b) -> Response B --+--> FastAPI backend
|
+--> RoBERTa reward model
|
+--> Predicted winner: A or B
|
+--> Human feedback and diagnostics
| Layer | Technology |
|---|---|
| User interface | Streamlit |
| Application API | FastAPI and Uvicorn |
| Preference model | Fine-tuned RoBERTa reward model |
| Local response generation | Ollama with llama3.2 and qwen2.5:3b |
| Data and feedback | CSV, JSONL, and local model artifacts |
| Testing | Python unittest, compilation checks |
- Open the Compare tab.
- Enter a prompt and generate two responses, or paste responses manually.
- Select Compare Responses to view scores, confidence, and the predicted winner.
- Open Human Feedback and record your preference.
- Open Evaluation & Bias to run benchmark and diagnostic checks.
- Use the retraining panel to train and validate a candidate model from collected feedback.
- Use the About tab to confirm backend and model readiness.
EvalAI/
├── backend/ # FastAPI application, routes, model, and storage
│ ├── app/
│ ├── data/
│ └── tests/
├── frontend/ # Streamlit dashboard and theme configuration
├── notebooks/ # Dataset inspection and model artifacts
├── preprocess/ # Dataset preprocessing and data splits
├── src/ # Training, inference, preprocessing, and evaluation
├── requirements.txt
└── README.md
- Python 3.10 or newer
- Git
- Ollama: https://ollama.com/download
- The trained model directory at
notebooks/roberta_reward_model_FINAL
Make sure the trained model directory exists in the repository:
notebooks/roberta_reward_model_FINAL
That folder should include at least:
config.json
model.safetensors
tokenizer.json
tokenizer_config.json
Run these commands in order.
cd <parent-directory>
git clone <your-repo-url>
cd EvalAI
python -m venv .venv
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
Copy-Item backend\.env.example backend\.env
Copy-Item frontend\.env.example frontend\.env
ollama pull llama3.2
ollama pull qwen2.5:3bNow start services in separate terminals.
Terminal 1 (Ollama):
ollama serveTerminal 2 (Backend):
cd <project-directory>\EvalAI
.\.venv\Scripts\Activate.ps1
python -m uvicorn backend.app.main:app --host 127.0.0.1 --port 8000The backend starts immediately while the local RoBERTa model loads in the background. The /health endpoint reports starting until the model is ready.
Terminal 3 (Frontend):
cd <project-directory>\EvalAI
.\.venv\Scripts\Activate.ps1
python -m streamlit run frontend/app.py --server.port 8502Open the app:
http://localhost:8502
git clone <your-repo-url>
cd EvalAI
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
ollama pull llama3.2
ollama pull qwen2.5:3bThen start:
- ollama serve
- python -m uvicorn backend.app.main:app --host 127.0.0.1 --port 8000
- python -m streamlit run frontend/app.py --server.port 8502
After startup, confirm these URLs:
- Backend health: http://127.0.0.1:8000/health
- Backend docs: http://127.0.0.1:8000/docs
- Frontend app: http://localhost:8502
Healthy backend should return status ok.
- Open the Compare tab.
- Enter your prompt.
- Click Generate two responses.
- Click Compare responses.
- Review winner and confidence.
- Open Human Feedback tab and submit A, B, or Tie.
- Open Evaluation and Bias tab when you want benchmark metrics.
- Do not edit notebooks or preprocess folders for normal app usage.
- Keep backend/.env and frontend/.env local only.
- Do not put secrets in .env.example files.
- Feedback is saved locally at backend/data/feedback.jsonl.
Main backend settings in backend/.env:
USE_DUMMY_MODEL=false
MODEL_PATH=notebooks/roberta_reward_model_FINAL
MODEL_LABEL_MAPPING=A,B
MAX_LENGTH=256
OLLAMA_URL=http://127.0.0.1:11434
GENERATION_MODEL_A=llama3.2
GENERATION_MODEL_B=qwen2.5:3b
GENERATION_TIMEOUT=120
CORS_ORIGINS=*Frontend setting in frontend/.env:
BACKEND_URL=http://127.0.0.1:8000- GET /health: backend and model status
- POST /generate: generate response A and response B
- POST /predict: score both responses and return winner A or B
- POST /feedback: save human preference
- POST /evaluation: run held-out benchmark and bias checks
- POST /retrain: train, evaluate, and conditionally activate a feedback-trained candidate model
Run these from project root:
python -m unittest discover -s backend/tests -t backend -v
python -m compileall -q backend frontendCause: you are not in repo root.
Fix:
cd <project-directory>\EvalAI
Copy-Item backend\.env.example backend\.envFix checklist:
- Backend terminal is running uvicorn.
- Health URL opens: http://127.0.0.1:8000/health
- frontend/.env has correct BACKEND_URL.
Fix:
ollama serve
ollama list
ollama pull llama3.2
ollama pull qwen2.5:3bThis is normal. Evaluation runs the held-out test set and additional bias checks.
- Response generation runs through locally hosted Ollama models.
- Human feedback is stored locally at
backend/data/feedback.jsonl. - The prototype is intended for local evaluation and demonstration.
- The current implementation is not positioned as an internet-scale production service.
- Do not commit local
.envfiles, credentials, or private datasets.
- Preference quality depends on the training data and reward model.
- Held-out evaluation can take several minutes on CPU.
- Ollama must be running and both configured generation models must be available.
- A model prediction is a decision-support signal, not a replacement for human judgment.
- Add authentication and role-based evaluator access.
- Support additional generation providers and reward models.
- Add persistent experiment tracking and richer result visualizations.
- Expand multilingual evaluation and domain-specific benchmarks.
- Add deployment support for shared team or institutional environments.
This project is distributed under the license included in LICENSE.