A Boston University SPARK Project
For Boston Universityβs Metropolitan College Office of Education Technology and Innovation (MET ETI)
- Overview
- β¨ Key Features
- π― Goals
- π οΈ Tech Stack
- π Development Roadmap
- π Setup Instructions
- π Workflow Diagram
- π Project Structure
- βοΈ Azure Storage Format
- π₯ Team
- π License
MET BU Autograder is a web-based REST API for AI-Assisted Grading of written and βcomplexβ assignments. It refines and optimizes grading capabilities using various Large Language Models (LLMs) and advanced context management.
Developed as part of a Boston University SPARK project for BU MET ETI, this tool is designed to integrate seamlessly with multiple LLM backends and provide a robust, well-documented API for clients seeking to enhance their grading workflows.
βοΈ Context Management Strategies - Ensures the AI retains necessary context across requests over otherwise stateless APIs.
βοΈ Retrieval-Augmented Generation - Uses a vector database to store supplemental data like documents, videos, images, and graphs.
βοΈ Web Crawling - Gathers assignment-relevant information with optional automatic update checking.
βοΈ Prompt Engineering - Uses zero-shot, few-shot, self-consistency prompting, and instruction tuning.
βοΈ File Conversion & Extraction - Supports multiple formats (CSV, PDF, diagrams, PowerPoints) to feed into LLM APIs.
π― Future-Proof Design: Integrate with multiple text-based or vision-based LLM backends.
π― Consistent Grading: Standardized grading approach for improved fairness and reliability.
π― Well-Documented API: Clear and accessible documentation for clients and contributors.
π― Efficiency: Minimize unnecessary external API calls to reduce costs while maintaining high accuracy.
π‘ Language: Python π
π’ Framework: FastAPI β‘
π΅ Others:
- LLM integration (multiple providers)
- Vector databases (for retrieval-augmented generation)
- Web crawling utilities (Selenium, requests)
π Phase 0: Project Vision & Goals β
π Phase 1: Project Setup & Initial API Development β
π Phase 2: LLM Integration & Context Management β³
π Phase 3: Web Crawling & Vector Database Implementation β³
π Phase 4: Performance Optimization & API Documentation β³
π Phase 5: Deployment & User Testing β³
Below is a visual representation of our current workflow for the MET BU Autograder workflow:
- Python 3.11 or higher installed on your system.
- Pip 24.0 or higher installed on your system.
Older versions may work
Clone the project repository to your local machine:
git clone <repository_url>
cd <repository_folder>
Replace <repository_url>
with your repository URL and <repository_folder>
with the cloned folder name.
It is recommended to use a virtual environment to manage project dependencies.
python3 -m venv venv
source venv/bin/activate
python -m venv venv
venv\Scripts\activate
Upgrade pip and install the project requirements using the provided requirements.txt
file:
pip install --upgrade pip
pip install -r requirements.txt
Copy the sample .env-example
file to .env
. Then provide or modify all environment variables as needed.
To generate a secure JWT encryption secret, run the script located at the root of the repository:
python generate_jwt_secret.py
Then, set the JWT_ENCRYPTION_SECRET_FILE
environment variable to the path of the generated secret file (output by the script).
Start the FastAPI application using Uvicorn with the auto-reload option for development:
uvicorn app.main:app --reload --port 8000
The server should start on http://localhost:8000.
To start the FastAPI application for production use, run the following instead:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
Feel free to modify the port or host to your use case in either case.
Once the application is running, you can view the interactive API documentation generated by FastAPI:
- Swagger UI: {BASE_URL}/docs
- ReDoc: {BASE_URL}/redoc
app
βββ README.md
βββ __init__.py
βββ main.py
βββ models
β βββ __init__.py
β βββ assignment.py
β βββ course.py
β βββ course_material.py
β βββ grade.py
β βββ rubric.py
β βββ student.py
β βββ student_response.py
β βββ token.py
β βββ uploaded_file.py
β βββ user.py
βββ requirements.txt
βββ routes
β βββ __init__.py
β βββ assignment.py
β βββ auth.py
β βββ course.py
β βββ course_material.py
β βββ grading.py
β βββ rubric.py
β βββ student_response.py
β βββ user.py
βββ utils
βββ __init__.py
βββ azure_ai_service.py
βββ azure_blob_uploader.py
βββ json_web_token.py
frontend
βββ README.md
βββ next.config.js
βββ package-lock.json
βββ package.json
βββ public
β βββ icons
β β βββ favicon.ico
β βββ images
β β βββ avatar-placeholder.png
β β βββ bu-logo.png
β β βββ bu-met-logo.png
β β βββ favicon.png
β β βββ login-background.png
β βββ robots.txt
βββ src
βββ ThemeContext.js
βββ api.js
βββ components
β βββ AISuggestionCard.js
β βββ CardSkeleton.js
β βββ ConfirmationDialog.js
β βββ Footer.js
β βββ GradingModeSelect.js
β βββ Header.js
β βββ Layout.js
β βββ Navigation.js
β βββ SelectableList.js
β βββ ThemeToggle.js
βββ config.js
βββ pages
β βββ _app.js
β βββ course
β β βββ [id]
β β βββ assignments.js
β β βββ grading.js
β β βββ index.js
β β βββ instructors.js
β β βββ materials.js
β β βββ rubrics.js
β βββ courses.js
β βββ login.js
β βββ manual_submission.js
β βββ settings.js
βββ styles
β βββ globals.css
β βββ theme.js
β βββ variables.css
βββ utils
βββ createEmotionCache.js
This document outlines the directory and file structure used within the Azure Blob Storage container.
π `/`
βββ π `course/`
β βββ π `{semester_key}/` *(e.g., "Fall2024")*
β βββ π `{course_id}/` *(e.g., "CS101")*
β βββ π `course.json` *(Course metadata - `Course` model)*
β βββ π `assignment/`
β β βββ π `{assignment_id}/` *(Integer ID)*
β β βββ π `assignment.json` *(Assignment metadata - `Assignment` model)*
β β βββ π `{question_index}/` *(Integer index, 0-based)*
β β β βββ π `question.json` *(Question metadata - `Question` model)*
β β β βββ π `student_response/`
β β β βββ π `{student_id}/` *(Student identifier, often email)*
β β β βββ π `response.*` *(Student's answer file - `StudentResponse` model, extension from `data.data_type`)*
β β β βββ π `grade.json` *(Grading details - `Grade` model, part of `GradedStudentResponse`)*
β β βββ π `rubrics/`
β β βββ π `assignment.json` *(Overall assignment rubric - `Rubric` model)*
β β βββ π `{question_index}.json` *(Sub-rubric for a specific question - `SubRubric` model)*
β βββ π `course_material/`
β βββ π `{material_id}.*` *(Course materials - `CourseMaterial` model, extension from `data.data_type`)*
β
βββ π `user/`
βββ π `{user_email}/`
βββ π `user.json` *(User metadata - `User` model)*
βββ π `tokens/`
βββ π `{token_name}.json` *(Personal Access Token details - `PersonalAccessToken` model)*
π€ First Name | Last Name | βοΈ Email Address | π₯οΈ GitHub Username |
---|---|---|---|
Fahim | Uddin | fahuddin@bu.edu | fahimuddin/fahimuddin1 |
Zach | Gentile | zgentile@bu.edu | zgentile |
Josh | Yip | joshyjip@bu.edu | joshyipp |
Muhammad Aseef | Imran | aseef@bu.edu | Aseeef |
This project is licensed under the GNU General Public License (GPL). See the LICENSE file for more details.
β οΈ Note: This project is in active development. For more details on installation, usage, or contributing, please refer to the projectβs documentation and issue tracker.
If you have any questions or feedback, feel free to open an issue or reach out via email.