- Next.js 16 + Tailwind + shadcn/ui skeleton - Auth.js v5 generic OIDC (Pocket ID, PKCE) with optional group gate - proxy.ts gates all pages and API routes - Drizzle schema (models, files, jobs, logs, worker state) on SQLite/libsql - Worker skeleton: migrations, interrupted-job recovery, heartbeat Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.2 KiB
Markdown
32 lines
1.2 KiB
Markdown
# Model Manager
|
|
|
|
Self-hosted web UI for downloading and managing local LLMs from Hugging Face.
|
|
Downloads are done by the official `hf` CLI; the Hub API is used for metadata.
|
|
|
|
## Architecture
|
|
|
|
- **web** (`next dev` / `next start`): Next.js App Router UI + API routes, OIDC login via Auth.js.
|
|
- **worker** (`src/worker`): owns the job queue, spawns `hf download`, tracks progress, runs update checks.
|
|
Applies DB migrations at startup.
|
|
- They talk only through the SQLite database (`DATABASE_URL`).
|
|
|
|
## Local development
|
|
|
|
```bash
|
|
cp .env.example .env # then fill in OIDC_* and AUTH_SECRET; use local paths, e.g.
|
|
# DATABASE_URL=file:./data/app.db, MODELS_DIR=./data/models, AUTH_URL=http://localhost:3000
|
|
npm install
|
|
npm run dev # starts web (http://localhost:3000) and worker together
|
|
```
|
|
|
|
OIDC redirect URI for the client in Pocket ID: `<AUTH_URL>/api/auth/callback/pocket-id`.
|
|
|
|
Other scripts:
|
|
|
|
| Script | What it does |
|
|
| --- | --- |
|
|
| `npm run dev:web` / `npm run dev:worker` | run one side only |
|
|
| `npm run db:generate` | create a migration after changing `src/lib/db/schema.ts` |
|
|
| `npm run db:migrate` | apply migrations without starting the worker |
|
|
| `npm run typecheck`, `npm run lint` | checks |
|