EECE 2140 · Computing Fundamentals for Engineers
A chatbot that handles the common stuff with plain rules first and only falls back to a local language model when nothing matches. Rule-based intent detection, a class that keeps conversation state, a summary feature, and an optional Ollama-backed GGUF fallback, all behind a Gradio web chat.
Tools: Python · Gradio · Ollama · Llama 3.1 8B (GGUF)
Sending "thanks" or "ok" through a multi-billion-parameter model is wasteful. The assistant tries a rule-based decision tree first and only calls a local LLM (Llama 3.1 8B through Ollama, running on my own PC) for open-ended questions it has no rule for.
detectIntent looks for word patterns and returns one of a fixed set of intents: greeting, goodbye, name, mood, project info, project tech, exam, study, thanks, help, small talk, summary.VirtualAssistant class, which stores the user's name, a mood history, the topics seen (a set), and the recent chat history.ggufFallback builds a short system prompt (who the user is, their mood) plus the last few turns and POSTs it to the Ollama API.The rule-based path answers instantly and predictably; the LLM fallback is flexible but slow and heavy. The 22-page technical report covers the architecture, pseudocode for the main components, the data structures used and why, and test conversations.