A production-ready Human-in-the-Loop (HITL) grading pipeline using Vision-Language Models (VLMs) and Agentic LLMs to evaluate scanned exams against strict rubrics, with Teaching Assistant (TA) review dashboards for rapid approval or override.
- Backend API (FastAPI): https://artemis6969-gradeops-backend.hf.space
- Hugging Face Space Repository: artemis6969/gradeops-backend
- Frontend App: https://gradeops.vercel.app/
- AI-Powered Grading: Vision models extract handwritten text, LLM agents grade against rubrics
- Role-Based Access: Instructors upload exams, TAs review AI grades, Admins monitor systems
- Partial Credit Support: Structured rubrics with configurable criteria and point allocation
- Plagiarism Detection: Semantic similarity checking across exam responses
- Real-Time Dashboard: TAs rapidly review AI grades with keyboard shortcuts
- Comprehensive Logging: Full system observability with logs and monitoring endpoints
- Scalable Architecture: Docker-ready with PostgreSQL backend and async processing
- Docker & Docker Compose (recommended)
- Python 3.11+ (for local development)
- Node.js 20+ (for frontend development)
docker-compose up --buildAccess:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Backend:
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reloadFrontend:
cd frontend
npm install
npm run dev- FastAPI: Modern async Python web framework
- SQLAlchemy: ORM for database management
- Pydantic: Data validation and settings
- PyMuPDF: PDF processing and image extraction
- NVIDIA NIM: Cloud-based VLM and LLM inference
- Sentence-Transformers: Semantic similarity for plagiarism detection
- React 19: Modern UI framework
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Vite: Fast build tool and dev server
- SQLite (development): Embedded database for quick iteration
- PostgreSQL (production): Scalable relational database
POST /auth/login- Mock login endpoint
POST /config/course/- Create courseGET /config/course/- List coursesPOST /config/exam/- Create examGET /config/exam/- List examsPOST /config/rubric/- Create grading rubricGET /config/rubric/exam/{exam_id}- Get exam rubricsPUT /config/rubric/{rubric_id}- Update rubricDELETE /config/rubric/{rubric_id}- Delete rubric
POST /upload/submission/- Upload exam PDF (auto-triggers grading)GET /upload/submission/{submission_id}- Get submission detailsGET /upload/exam/{exam_id}/submissions- List exam submissions
POST /grade/{answer_id}/trigger- Manually trigger gradingGET /grade/status/{answer_id}- Check grading statusPOST /grade/batch/trigger- Batch grading trigger
GET /review/pending- Get pending answers for TA reviewGET /review/pending-count- Count pending reviewsPOST /review/{answer_id}/approve- Approve AI gradePOST /review/{answer_id}/override- Override AI grade with commentsGET /review/plagiarism-check/{exam_id}- Check plagiarism across examGET /review/{answer_id}/details- Get full answer details
GET /health- Health check with storage statsGET /monitor/stats- System statisticsGET /monitor/submissions-by-status- Status breakdownGET /monitor/exam-summary/{exam_id}- Exam analytics
Create .env in the backend directory:
DATABASE_URL=sqlite:///./gradeops.db
DEBUG=true
API_TITLE=GRADEOPS API
# NVIDIA NIM Configuration
NVIDIA_NIM_API_KEY=your-api-key-here
VLM_MODEL=nvidia/llama-32-vision
LLM_MODEL=nvidia/llama-3.1-70b-instruct
SIMILARITY_THRESHOLD=0.85
LOG_LEVEL=INFO
- Visit NVIDIA Cloud Console
- Create or sign in to your account
- Navigate to API Keys section
- Generate a new API key for NVIDIA NIM
- Add it to your
.envfile asNVIDIA_NIM_API_KEY
-
VLM Models (Vision-Language for text extraction):
nvidia/llama-32-vision- Recommended for exam document analysis
-
LLM Models (Language models for grading logic):
nvidia/llama-3.1-70b-instruct- Recommended for exam gradingnvidia/mistral-large- Alternative optionnvidia/nemotron-4-340b-instruct- High accuracy option
- User: Instructors and TAs
- Course: Manages exams
- Exam: Container for submissions and rubrics
- Rubric: Grading criteria per question
- Submission: Student exam submission
- Answer: Individual question response with AI grade
- Review: TA review record with overrides
- Instructor: Uploads exam PDF + defines rubric criteria
- System: Extracts images, triggers AI grading pipeline
- AI Engine: Extracts text with VLM, grades with LLM agent
- TA Dashboard: Reviews AI grades with extracted text and justification
- TA Actions: Approve grade or override with comments
- Admin: Monitor progress via analytics dashboard
Enter- Approve current answer and move to next←/→- Navigate between answers- Auto-refresh polls every 5 seconds
- Handle 100+ exam uploads per session
- Process 500+ pages through OCR
- Grade 1000+ answers in batch mode
- Real-time TA dashboard with <1s response times
docker-compose up- Use PostgreSQL instead of SQLite
- Set
DEBUG=falseandLOG_LEVEL=WARN - Configure reverse proxy (nginx) for CORS
- Add authentication (JWT tokens)
- Enable HTTPS
- Set up proper logging aggregation
- Configure resource limits for GPU models
cd backend
pytestgradeops/
├── backend/
│ ├── main.py # FastAPI app
│ ├── models.py # SQLAlchemy ORM models
│ ├── schemas.py # Pydantic schemas
│ ├── database.py # DB configuration
│ ├── config.py # Settings management
│ ├── logger.py # Logging setup
│ ├── ai_engine.py # VLM + LLM grading logic
│ ├── utils.py # PDF processing utilities
│ └── routers/
│ ├── upload.py # File upload endpoints
│ ├── grade.py # Grading endpoints
│ ├── review.py # TA review endpoints
│ ├── config.py # Configuration endpoints
│ └── monitor.py # Admin monitoring
├── frontend/
│ ├── src/
│ │ ├── App.tsx # Main app
│ │ ├── components/
│ │ │ ├── UploadPortal.tsx # Instructor interface
│ │ │ ├── ReviewDashboard.tsx # TA dashboard
│ │ │ └── AdminDashboard.tsx # Admin dashboard
│ │ └── main.tsx
│ └── index.html
├── docker-compose.yml
└── README.md
- Real VLM integration (Qwen-VL 7B, Claude Vision)
- Actual LLM grading with function calling
- Semantic plagiarism detection with threshold tuning
- Batch processing with Celery + Redis
- Email notifications for instructors
- Export grades to CSV/LMS integration
- Student appeal workflow
- Mobile app for TA reviews
- Advanced analytics and fairness metrics
- Multi-language support
MIT License
For issues or questions, please refer to the API documentation at /docs