This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm install # Install dependencies
npm run dev # Start dev server (http://localhost:5173)
npm run build # Type-check (tsc -b) then build (vite build)
npm run lint # ESLint
npm run preview # Preview production buildNo test framework is configured. The project deploys to GitHub Pages via .github/workflows/deploy.yml on push to master.
Batch LLM Studio is a privacy-first PWA for batch LLM inference. Users import CSVs, configure prompts with {{column}} template syntax, and process rows concurrently against local (LM Studio, Ollama) or cloud (OpenAI, Gemini, OpenRouter) providers.
- Dexie wraps IndexedDB with three tables:
Projects,DataRows,AppSettings(defined insrc/db/db.ts) - All state lives in IndexedDB — no backend, no external state library
- Components use
useLiveQuery()fromdexie-react-hooksfor reactive DB reads
- HashRouter (
react-router-dom) for GitHub Pages compatibility - Routes:
/(ProjectList),/project/:id(Workspace),/settings(GlobalSettings),/instructions(InstructionPage) - Defined in
src/App.tsx
src/features/— domain-grouped feature components (projects, runner, results, prompt-builder, settings, instructions)src/components/ui/— Shadcn UI components (Radix primitives + Tailwind + class-variance-authority)src/lib/llm.ts— all LLM API integration (generateCompletion,testConnection); supports OpenAI-compatible APIs and Geminisrc/lib/utils.ts— shared utilities (cnfor classname merging)
- CSV import → Project + bulk DataRows insert
- Prompt config with
{{column}}interpolation → Project update - BatchRunner fetches pending rows → concurrent processing → status updates (pending → processing → completed/error)
- ResultsTable display → CSV export via papaparse
- Tailwind CSS with class-based dark mode and CSS variable theming
- Shadcn UI config in
components.json; import path alias@/→./src/
- Vite base URL is
/batch_llm/(GitHub Pages subdirectory) - Global API credentials stored in
AppSettings; projects can override with project-level settings - Shadcn UI files use lowercase-dash naming (
alert-dialog.tsx); feature components use PascalCase