Skip to content

About

llm slop. sorry..

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Course Prerequisite Visualizer

yoink/ contains the scraping + structuring pipeline that feeds the frontend. Below is the workflow for keeping the data fresh.

tip: hi friend, if you're cloning the repo and playing around you DON'T need to run anything in yoink. The structured data is already committed, you can skip steps 1-4 and simply build the frontend and run the backend.

1. Environment Setup

cd yoink
python3 -m venv venv
source venv/bin/activate
pip install google-genai requests beautifulsoup4

Place your Gemini API key (plaintext) in yoink/key.

2. Fetch Raw Course Data

cd yoink
python fetch_courses.py

This writes raw department JSON files into yoink/courses/.

3. Structure Courses with Gemini

cd yoink
source venv/bin/activate
python structure_courses.py

The script:

  • Reads every file under yoink/courses/
  • Parses deterministic fields (id, name, description, credits, rawRequirements)
  • Calls Gemini Flash in batches to interpret prerequisite logic
  • Writes structured department files to yoink/structuredCourses/

Notes:

  • This script takes awhile! I recommend running it in the background in something like a tmux session.
  • Running the LLM pipeline myself, I burned ~$2.5 in Gemini API credits, just an fyi.

3b. (Free) Local alternative: structure with Ollama

structure_courses_ollama.py is a drop-in replacement that runs the same parsing on a locally hosted open-weight model via Ollama — no API key, no cost. It was tuned for a 4 GB GPU (GTX 1650). The selected model is qwen3:4b (see yoink/OLLAMA_MIGRATION.md for the full model comparison and rationale).

# one-time: install ollama, then pull the model
ollama pull qwen3:4b

cd yoink
# whole catalog -> yoink/structuredCourses_ollama/ (keeps the Gemini output intact)
python3 structure_courses_ollama.py --model qwen3:4b --think off

# or write straight into the canonical dir consumed by the backend:
python3 structure_courses_ollama.py --model qwen3:4b --think off --out-dir structuredCourses
  • No extra Python deps (stdlib only); requires a running Ollama on localhost:11434.
  • Full catalog (~6,200 courses, ~1,800 LLM calls) runs in ~30 min fully on-GPU.
  • --think off is important: reasoning mode is ~50x slower here for no gain.
  • Evaluate a model against the Gemini baseline with eval_model.py, and diff two datasets with compare_datasets.py.

Single-Department Runs

To reprocess just one department (e.g., CSE) without touching the rest:

cd yoink
python structure_courses.py --file cse-computer-science-and-engineering.json
# or, local:
python3 structure_courses_ollama.py --model qwen3:4b --think off --file cse-computer-science-and-engineering.json

Tip: delete the existing structured file before a rerun if you want the course to be re-sent to the LLM.

4. Output

yoink/structuredCourses/*.json is the canonical, LLM-structured dataset consumed by the frontend. Each course now includes prereqGroups, where each inner array represents an OR group, and AND relationships are captured by separate arrays in sequence.

Backend (FastAPI)

Minimal API for serving the static course data lives under be/. The repository already includes structured catalogs in be/courseData/, so you can run the backend immediately. If you refresh data via yoink/, remember to restart the server. We just load the JSON files on startup and keep course data in memory for the duration of the application's runtime. Our data is static and minimal, no need for a fancy DBMS.

cd be
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload

You can see API docs at http://localhost:8000/docs

Frontend (React)

To get the development server runnnig

cd fe
npm install
npm run dev

To build a static bundle for deployment

npm run build

About

llm slop. sorry..

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages