- Hub API client: resolve revision to SHA, paginated recursive file tree, gated-access probe, readable error mapping - Add-model page with quant quick-select, fnmatch-compatible include/exclude globs, selection summary and free-space hint - Models stored pinned to the reviewed SHA with full file list and selection rule - Library list, model detail page, remove (never-downloaded models only) - Worker reports MODELS_DIR free space; unit tests for selection logic Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.3 KiB
Markdown
33 lines
1.3 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 test` | unit tests (Node test runner via tsx) |
|
|
| `npm run typecheck`, `npm run lint` | checks |
|