Inspiration
As UC Davis students, we often find ourselves searching for quick, reliable recommendations about study spots, good food, boba shops, and relaxation spaces on and around campus. We wanted to create an AI-powered assistant that could understand the specific context of UC Davis life and instantly provide tailored answers without relying on generalized web search or generic AI. Our goal was to build a localized, fast, and private chatbot to make everyday student life easier.
What it does
Our project is a AggieLife AI: Your UC Davis Study and Life Buddy that allows users to input questions like:
- "Where can I find boba near campus?"
- "Best quiet places to study?"
- "Good food around Davis?"
- "Where can I relax when I'm stressed?"
- More!!!
The chatbot generates personalized, on-topic responses based on a fine-tuned generative AI model, fully customized to UC Davis life. It provides recommendations in real-time through a friendly, easy-to-use web interface.
How we built it
- Model: We fine-tuned Hugging Face’s
distilgpt2(a lightweight version of GPT-2) on a curated UC Davis-specific dataset with 200+ question-answer pairs. - Training: Training was done locally using PyTorch and Hugging Face Transformers, running on Apple Silicon MPS backend (for faster processing).
- Backend: We built a FastAPI server to handle user questions and generate model responses.
- Frontend: We designed a Gradio web app that allows users to input questions and instantly view responses in a clean, user-friendly interface.
- Hosting: Both backend and frontend are running locally on our machine, ensuring low-latency responses and data privacy.
Challenges we ran into
- Device Mismatch Errors: Running models on Mac MPS devices required careful handling of tensor device placement (CPU vs MPS) to avoid crashes.
- Training Stability: Fine-tuning large models required memory management and optimizations, like
torch.no_grad()during generation. - Environment Confusion: Managing Python environments (conda vs pip vs system python) and ensuring clean package installation took extra time.
- Cleaning Outputs: Ensuring that generated answers were concise, free from model artifacts (like [Q], [A] tokens), and relevant to user queries.
Accomplishments that we're proud of
- Fully Local Deployment: We built and hosted a full-stack AI assistant without relying on external APIs — everything runs on our own machine.
- Customized Model: Successfully fine-tuned a general language model into a UC Davis-specific expert.
- Functional Web App: Created a smooth, interactive frontend that any student could easily use.
- Professional Code Structure: Organized the project into backend, frontend, and training modules, simulating a real-world production environment.
What we learned
- How to fine-tune Hugging Face generative models on custom datasets.
- How to manage device compatibility issues when using newer Mac hardware (MPS backend).
- How to design and integrate a FastAPI server with a Gradio frontend for a real-time chatbot.
- How to build a local-only generative AI system that maintains privacy and fast performance without relying on cloud APIs.
What's next for AggieLife AI: Your UC Davis Study and Life Buddy
- Expand the Dataset: Add more categories like mental health resources, event updates, and late-night study tips.
- Deploy Publicly: Move hosting to Hugging Face Spaces or AWS to make it accessible to the entire UC Davis community.
- Add Voice Interface: Enable students to ask questions via voice commands.
- Real-Time Event Updates: Integrate with RSS feeds or UC Davis social media updates for live events and notifications.
- Multi-Campus Expansion: Fine-tune similar assistants for other UC campuses or universities!
Quick Summary
We didn't just build a simple chatbot.
We created a localized, generative AI product that could genuinely help real students at UC Davis.
Log in or sign up for Devpost to join the conversation.