This helps you read YouTube comments without drowning in the noise. It extracts comments from any video URL and classifies them locally with LFM2.5-350M, giving you a clear dashboard of what people are asking, praising, criticizing, joking about, or pushing back on.
grab-yt-comments/
|-- backend/
| |-- api.py # FastAPI API for the React frontend
| |-- app.py # Existing Gradio UI entrypoint
| |-- scraper.py # YouTube Data API comment scraping
| |-- classifier.py # LLM classification and SQLite persistence
| |-- pyproject.toml # Backend dependencies for uv
| |-- requirements.txt # Backend dependencies for pip-style deploys
| |-- uv.lock
| `-- .gitignore
|-- frontend/
| |-- App.tsx
| |-- services/
| |-- components/
| |-- package.json
| `-- .gitignore
|-- .gitignore
|-- LICENSE
`-- README.md
Local LLM must be running
Classification depends on a local OpenAI-compatible LLM server. Before running this project, install and start LFM2.5-350M with llama.cpp.
- Install
llama.cpp:
winget install llama.cpp- Start the model server:
llama-server -hf LiquidAI/LFM2.5-350M-GGUF:Q4_K_MOnce started, the server is available at http://localhost:8080.
From the repo root:
cd backend
uv syncCreate backend/.env:
YOUTUBE_API_KEY=your_youtube_api_key_here
Local LLM settings:
LOCAL_LLM_URL=http://127.0.0.1:8080/v1/chat/completions
LOCAL_LLM_MODEL=LiquidAI/LFM2.5-350M-GGUF:Q4_K_M
CLASSIFICATION_REQUEST_TIMEOUT=30
Start the FastAPI backend:
cd backend
uv run python -m uvicorn api:app --host 127.0.0.1 --port 8000 --reloadIn a second terminal, start the React frontend:
cd frontend
npm install
npm run devOpen the frontend:
http://127.0.0.1:3000
The frontend calls the backend at:
http://localhost:8000/api/v1/comments
You can override that by setting VITE_API_URL in frontend/.env.
The original Gradio workflow is still available:
cd backend
uv run python app.pyWhen classification is enabled, comments are classified with the local OpenAI-compatible LLM endpoint into:
appreciationhumorquestionscriticismpersonal experiencefeedbackspam
The backend stores scraped comments first, classifies each saved comment, writes labels back to SQLite, and returns the final result from the database.
