diff --git a/CHANGELOG.md b/CHANGELOG.md index f780609..c78138d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,51 @@ step 1 (Hugging Face downloader) is released as a minor version. ## [Unreleased] +## [0.10.0] - 2026-10-20 + +An API for AI agents: a token-authenticated `/api/v1` lets a program look up models, request +downloads and follow them, within guardrails you set and, by default, only after you approve each +request. + +No changes to `compose.yaml` or `.env`. If Kaname is behind a forward-auth proxy, let `/api/v1/` +through without forward auth (example in [docs/api.md](docs/api.md)). The new table is created on +start. + +### Added + +- **API tokens** (Settings → API tokens): create (shown once; only a SHA-256 hash is stored), name, + scopes `models:read` and `downloads:create`, last used, revoke. Sent as + `Authorization: Bearer kn_…`; only `/api/v1` accepts them, and it accepts nothing else (the rest of + Kaname stays OIDC-only). No token can delete models or files, change settings, or manage runtimes + or tokens. +- **`/api/v1`**, compact JSON with actionable error messages ([docs/api.md](docs/api.md)): + - `GET /api/v1`: the token's name, scopes and the guardrails. + - `GET /api/v1/hub/lookup?repo=`: commit SHA, quants and files with sizes (the Add model lookup). + - `GET /api/v1/models`: the library with its search and filters (author, family, quant, tag, + status, requested by) and the size on disk; `GET /api/v1/models/{id}`. + - `POST /api/v1/downloads`: repo + pinned commit + a quant (weights plus the recommended companion + files, as in Add model) or include globs, optional tags. Uses the same add-model and queue code + as the UI. Repeating a request returns the existing model and job instead of queueing a + duplicate; for a model already in the library it adds the missing files. + - `GET /api/v1/jobs/{id}`: state, per-file progress, error; the `hf` log only with `?log=N`. + - `GET /api/v1/disk`: free, used and reserved space on the models folder. +- **Guardrails for API downloads** (Settings → API tokens): approval mode (default: requests wait + as *pending approval* until you approve or reject them on the model or job page), max size per + request (60 GB), free space that must remain after the download, counting what other open + downloads still need (100 GB), API jobs at once (2), and an optional author allowlist. Rejecting a + request removes a model it added, or restores the previous file selection. +- Everything requested with a token shows **requested by <token name>** in the library, on the + model and job pages, with a "Requested by" filter (and "awaiting approval" under Status). +- **Agent skill** for Hermes Agent and similar ([docs/agent/SKILL.md](docs/agent/SKILL.md)): how to + search, look up, request and monitor a download with `curl`, the guardrails, and to wait for + approval instead of retrying. + +### Changed + +- Settings → API keys is now **Runtime API keys** (the keys deployments require), to keep it apart + from API tokens. +- Tests can now use the database: `npm test` runs with `--conditions=react-server`. + ## [0.9.0] - 2026-10-13 Model testing, part three: benchmarks. Measure deployments with BetterBench (the benchmark behind diff --git a/package-lock.json b/package-lock.json index 0ee7922..4d818d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kaname", - "version": "0.9.0", + "version": "0.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kaname", - "version": "0.9.0", + "version": "0.10.0", "dependencies": { "@base-ui/react": "^1.8.0", "@libsql/client": "^0.18.0", diff --git a/package.json b/package.json index c3bab30..f0591ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kaname", - "version": "0.9.0", + "version": "0.10.0", "private": true, "scripts": { "dev": "concurrently -k -n web,worker -c blue,magenta \"npm:dev:web\" \"npm:dev:worker\"", @@ -13,7 +13,7 @@ "typecheck": "next typegen && tsc --noEmit", "db:generate": "drizzle-kit generate", "db:migrate": "dotenv -e .env -- tsx src/lib/db/migrate-cli.ts", - "test": "tsx --test \"src/**/*.test.ts\"", + "test": "tsx --conditions=react-server --test \"src/**/*.test.ts\"", "build:worker": "esbuild src/worker/index.ts --bundle --platform=node --target=node24 --format=esm --packages=external --outfile=dist/worker.mjs && esbuild src/lib/db/migrate-cli.ts --bundle --platform=node --target=node24 --format=esm --packages=external --outfile=dist/migrate.mjs" }, "dependencies": {