monish563/NU-Kiosk
title: NU Kiosk emoji: π« colorFrom: purple colorTo: indigo sdk: docker sdkversion: "latest" appfile: Dockerfile pinned: false ---
CS Kiosk
Conversational kiosk for the Northwestern CS department. The backend aggregates local datasets, selects task-specific tools, and forwards responses through your configured LLM provider while a React front-end presents the chat experience.
Prerequisites
- Python 3.11+
- Node.js 18+ with npm (for the React web client)
- API keys for the LLM providers you want to enable (Anthropic by default; Gemini/OpenAI optional)
Quick Start
- Create and populate a virtual environment
cd /path/to/kiosk
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt- Install the React frontend dependencies
cd frontend
npm install- Run the backend
cd ..
python -m backend.main The FastAPI server starts on http://127.0.0.1:5050.
- Run the React web client
cd frontend
npm run dev The Vite dev server proxies /api/* calls to http://127.0.0.1:5050, so the web client talks to the same FastAPI backend without additional configuration. Set VITE_API_BASE_URL if you need to point the frontend at a remote backend during npm run build.
Hostable React Frontend
The frontend/ directory contains a React + Vite application that can be deployed to any static host.
- Local development:
npm run dev(automatically proxies/apito127.0.0.1:5050). - Environment override: Create
frontend/.envwithVITE_API_BASE_URL=https://your-backend.example.comto target a different origin (required if the frontend and backend are not served from the same domain). - Production build:
npm run buildemits static assets infrontend/dist/. Serve those files from your hosting provider and point them at the FastAPI backend viaVITE_API_BASE_URLor a reverse proxy.
When hosting the frontend separately from the backend, either configure the backend with the proper CORS policy or serve both behind the same origin/reverse proxy so relative /api calls remain valid.
Environment Template
The repository includes a .env file at the root with the following structure. Replace placeholder values with your actual API keys before running the kiosk:
# Copy this file to your local secrets manager and replace the placeholders.
# Do NOT commit real API keys into version control.
# Framework defaults
KIOSK_LLM_PROVIDER=anthropic
KIOSK_LLM_MODEL=claude-haiku-4-5
KIOSK_LLM_SYSTEM_PROMPT=You are a conversational receptionist for the Northwestern CS Kiosk whose responses are spoken aloud. Speak naturally and never include stage directions or annotations.
KIOSK_LLM_STYLE=Be very brief. One or two sentences max. No long listsβsummarize top 2-3 items only.
# OpenAI
OPENAI_API_KEY=your-openai-key
OPENAI_MODEL=gpt-4.1-mini
# Anthropic Claude
ANTHROPIC_API_KEY=your-anthropic-key
ANTHROPIC_MODEL=claude-haiku-4-5
# Google Gemini
GEMINI_API_KEY=your-google-cloud-key
GEMINI_MODEL=gemini-2.0-flash
# Hugging Face Inference
HF_API_KEY=your-huggingface-token
HF_MODEL=meta-llama/Meta-Llama-3-8B-InstructHugging Face Sync (Optional)
Set these variables to mirror storage/chat_history.jsonl and storage/usage_metrics.jsonl to a Hugging Face dataset; leave them unset to keep data local. On restart, both files are downloaded from the dataset so chat history persists across deploys.
KIOSK_HF_DATASET_REPOβ dataset repo ID (for exampleusername/kiosk-metrics). Required to enable syncing.KIOSK_HF_TOKENβ token with write access to the dataset (falls back toHF_KIOSK_HF_TOKENorHF_TOKENwhen provided via HF Spaces secrets).KIOSK_HF_DATASET_PATHβ optional destination subfolder inside the repo (defaults tochat_history).KIOSK_HF_SYNC_INTERVAL_MINUTESβ push cadence in minutes (defaults to10).
Project Structure
kiosk/
βββ .env # Environment variables (filled with local keys)
βββ Archive/ # Local CSV feeds used by blueprints
βββ backend/
β βββ data/ # Catalog loading, data utilities
β βββ mcp/ # Planner actions, schemas, and tool executor
β βββ providers/ # LLM provider clients (Anthropic, OpenAI, Gemini, Echo)
β βββ tools/ # Blueprint implementations backing each chat tool
β βββ responders.py # LLM responder and metadata handling
β βββ main.py # FastAPI entry point and orchestrator wiring
βββ frontend/ # React web client (Vite)
β βββ src/ # Chat UI, API hooks, and styles
β βββ public/ # Static assets
β βββ vite.config.js # Dev server + build configuration
βββ README.md # This guideDevelopment Notes
- The planner uses
KIOSK_PLANNER_PROVIDER/KIOSK_PLANNER_MODELif set; otherwise it falls back toKIOSK_LLM_PROVIDER. - Store secrets responsibly. The provided
.envfile is committed for convenience; update the keys locally before running the kiosk, but keep sensitive values private if you publish your fork. - To add a new provider, implement the
BaseLLMinterface inbackend/providers/, register it in_PROVIDER_REGISTRY, and add the relevant environment entry inPROVIDER_ENV_SETTINGS.
======= emoji: π colorFrom: pink colorTo: purple sdk: docker pinned: false short_description: Conversational CS kiosk with a FastAPI backend and React fro
