Release 0.13.0: agent API for deployments and benchmarks
Release / release (push) Successful in 3m0s

Scopes deployments:read/write and benchmarks:read/run; /api/v1 endpoints
for runtimes, deployments (create with dry run, edit, start, stop, delete
own ones), benchmark runs, A/B, sweeps and comparisons; ?wait= on all
status endpoints. Guardrails: approval, agent deployments at once, one
GPU job at a time, time limits, sweep variants, runtime and argument
allowlists, host port range, memory/CPU caps, protected deployments with
a VRAM check. Requested-by filters, approval bars, per-token activity log,
scope editing, docs/agent/SKILL-tuning.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-21 15:11:06 +02:00
1 parent e007a35143
commit 716bd8f2f0
62 files changed
+6091 -219

No files matched your search

+179
View File
@@ -0,0 +1,179 @@
---
name: kaname-tuning
description: Deploy local LLMs on the user's Kaname server and benchmark them to find good launch options (context, KV cache type, batch sizes, GPU layers, runtime) for the hardware. Use when the user asks to deploy, test, benchmark, tune or compare a model's settings, or to find the fastest setup for a model.
required_environment_variables:
- name: KANAME_URL
prompt: Kaname base URL (no trailing slash)
- name: KANAME_TOKEN
prompt: Kaname API token (kn_…) with the deployments and benchmarks scopes
---
# Kaname: deploy and tune models
Kaname runs models in containers (llama.cpp or vLLM) and measures them with BetterBench. With this
skill you deploy a downloaded model, benchmark it, change **one** launch option at a time and report
which setup is best. To find or download models, use the `kaname-models` skill (`SKILL.md`).
You may only change and benchmark deployments your own token created. You **cannot** touch the
user's deployments (especially protected ones), change settings, runtimes or tokens, or delete
models. Tell the user when something needs one of those.
Every call needs `KANAME_URL` and `KANAME_TOKEN` (never print the token or put it in a URL), and the
`kaname` helper (a `curl` wrapper that adds the token and JSON headers; see `SKILL.md` → Setup). If
`kaname` is missing, write out
`curl -sS -H "Authorization: Bearer $KANAME_TOKEN" -H "Content-Type: application/json" …` instead.
Errors are `{"error": {"code", "message"}}`; the message says what to do.
## Rules
- **No polling loops.** Status calls take `?wait=S` (max 900): Kaname holds the request until the
state settles. Make one call, with `-m` (curl's time limit) a bit above the wait.
- **Approval:** by default every start, run and sweep waits for the user (`state:
pending_approval`). Then **stop**: tell the user what you asked for and that it awaits their
approval in Kaname. Don't retry, don't poll. Continue when the user says it's approved.
- **Never work around a guardrail** (another token, splitting a sweep, renaming things). Report the
error message and stop.
- **One GPU job at a time:** one of your deployments running at once (unless the user raised the
limit), one run or sweep at a time. Stop your deployment when you're done.
- **Change one variable at a time**, so a difference has one cause.
## 1. Know your limits
```bash
kaname "$KANAME_URL/api/v1"
```
`deploymentGuardrails`: approval mode, how many of your deployments may run, run/sweep time limits,
max sweep variants, caps, host ports. Your scopes must include `deployments:write` and
`benchmarks:run`; if not, tell the user.
## 2. Pick a model and a runtime
```bash
kaname "$KANAME_URL/api/v1/models?status=ready&q=qwen3"
kaname "$KANAME_URL/api/v1/models/<modelId>" # its files (pick a .gguf for llama.cpp)
kaname "$KANAME_URL/api/v1/runtimes"
```
Runtimes say what they serve (llama.cpp: a GGUF file, vLLM: a safetensors repo), whether you may use
them (`"allowed": true`) and which extra argument flags you may pass (`allowedExtraArgs`). `gpus`
lists the host's GPUs and their VRAM.
Previous results for this model, to start from what is known:
```bash
kaname "$KANAME_URL/api/v1/benchmarks?limit=10"
```
## 3. Deploy
Check first (nothing is created; you get the exact command and the memory/VRAM estimates):
```bash
kaname -X POST "$KANAME_URL/api/v1/deployments" -d '{
"runtimeId": "<runtimeId>", "modelId": "<modelId>", "dryRun": true,
"options": { "modelFile": "Qwen3-8B-Q4_K_M.gguf", "contextSize": 16384, "gpuLayers": "auto",
"cacheTypeK": "q8_0", "cacheTypeV": "q8_0", "parallel": 1, "extraArgs": [] }
}'
```
If `estimates.vramMb` is above `estimates.gpuVramMb`, lower the context, quantize the KV cache or
pick a smaller quant. Then the same body without `"dryRun"`:
- `state: pending_approval` → tell the user and stop (see Rules).
- `state: starting` → wait until it is ready:
```bash
kaname -m 660 "$KANAME_URL/api/v1/deployments/<id>?wait=600"
```
`state: running` → go on. `state: failed` → read `error` (and `?log=50`), fix the options
(`PATCH`, below) and start again; don't repeat the same failing options.
## 4. Benchmark
```bash
kaname -X POST "$KANAME_URL/api/v1/benchmarks" -d '{
"deploymentId": "<id>", "quick": true, "label": "Q4_K_M ctx16k q8_0 KV",
"description": "Baseline for tuning Qwen3-8B on this GPU"
}'
kaname -m 960 "$KANAME_URL/api/v1/benchmarks/<runId>?wait=900"
```
- `quick: true` (5 passes) to screen options; `quick: false` (20 passes) to confirm the winner.
- `phases` (`decode`, `prefill`, `concurrency`) narrows what is measured; leave it out for all.
- The result's `headline` has `decodeTps` (generation speed), `prefillTps` (prompt processing at the
deepest prompt), `ttftMs` (time to first token) and `peakParallelTps`; `setup` lists GPU, PCIe,
engine version, model/quant/KV cache, context and concurrency; `resources` has VRAM, power and
temperature. `?full=1` only when you need the per-category details.
- If the wait times out, the run is still going: one more call with `?wait=900`, then report.
## 5. Change one variable and compare
Stop, change one option, start, wait, benchmark again:
```bash
kaname -X POST "$KANAME_URL/api/v1/deployments/<id>/stop"
kaname -m 120 "$KANAME_URL/api/v1/deployments/<id>?wait=60"
kaname -X PATCH "$KANAME_URL/api/v1/deployments/<id>" -d '{"options": {"cacheTypeK": "f16", "cacheTypeV": "f16"}}'
kaname -X POST "$KANAME_URL/api/v1/deployments/<id>/start"
```
Or let Kaname do it: a **sweep** deploys each variant of one or two settings, benchmarks it and
removes it again (stop your own deployment first; it counts as one run):
```bash
kaname -X POST "$KANAME_URL/api/v1/sweeps" -d '{
"baseDeploymentId": "<id>", "quick": true,
"params": [{ "key": "kvCache", "values": ["f16", "q8_0", "q4_0"] }]
}'
kaname -m 960 "$KANAME_URL/api/v1/sweeps/<sweepId>?wait=900"
```
Keys: `contextSize`, `modelFile`, `kvCache`, `threads`, `parallel`, `batchSize`, `ubatchSize`,
`flashAttn`, `cacheRamMb`, `gpuLayers` (llama.cpp); `dtype`, `maxNumSeqs`, `gpuMemoryUtilization`
(vLLM); `cpus`. A sweep can take long: after a timed-out wait, report progress instead of waiting
again and again.
Compare runs side by side:
```bash
kaname "$KANAME_URL/api/v1/benchmarks/compare?ids=<run1>,<run2>,<run3>"
```
Differences under ~2 % between separate runs are noise. For a small difference that matters, run
an A/B (two deployments of the same model at once, if the user allows 2 agent deployments):
`{"kind": "ab", "deploymentId": "<A>", "deploymentBId": "<B>"}`.
## 6. Report and clean up
Report a compact table, one row per setup, the varied option first:
| KV cache | Decode t/s | Prefill t/s | TTFT ms | VRAM peak | Notes |
| --- | --- | --- | --- | --- | --- |
| f16 | 58.1 | 1910 | 88 | 11.2 GB | baseline |
| q8_0 | 57.6 | 1880 | 90 | 9.4 GB | −1 %, 1.8 GB less VRAM |
Name the winner and why (and what stayed the same: GPU, engine version, quant, context). Then stop
your deployment (or delete it if the user doesn't need it):
```bash
kaname -X POST "$KANAME_URL/api/v1/deployments/<id>/stop"
```
## When something is refused
| `error.code` | What to do |
| --- | --- |
| `too_many_deployments` | Stop your other deployment first, or tell the user. |
| `gpu_busy` | Another agent job is running or a deployment is loading: wait once with `?wait=`, then retry once; otherwise report and stop. |
| `vram_protected` | It would crowd the user's protected deployment out of VRAM: smaller quant, context or quantized KV cache, or tell the user. |
| `arg_not_allowed` | That flag isn't allowed; use the structured option if there is one (`contextSize`, `gpuLayers`, `cacheTypeK`, …) or drop it. |
| `limit_exceeded` | Over the memory/CPU cap: smaller model or context. |
| `port_not_allowed` | Leave out `hostPort`. |
| `runtime_not_allowed`, `runtime_not_pulled` | Pick another runtime from `GET /api/v1/runtimes`, or tell the user. |
| `protected`, `not_owner` | Not your deployment: deploy your own. |
| `too_many_variants` | Vary fewer values. |
| `busy` | Stop the deployment before changing it. |
| `unauthorized`, `forbidden` | Token wrong, revoked or missing a scope: tell the user. |
+11 -6
View File
@@ -12,7 +12,9 @@ required_environment_variables:
Kaname manages the user's local LLM library. You can look up Hugging Face repos, see what is
already downloaded, request a download and follow it. You **cannot** delete anything, change
settings, or start models: tell the user when they need one of those.
settings, or start models with this skill: tell the user when they need one of those. To deploy and
benchmark models (with a token that has the deployments and benchmarks scopes), see
`SKILL-tuning.md`.
Every call needs two environment variables:
@@ -94,17 +96,20 @@ Answer:
## 4. Follow it
```bash
kaname "$KANAME_URL/api/v1/jobs/<jobId>"
kaname -m 660 "$KANAME_URL/api/v1/jobs/<jobId>?wait=600"
```
`state`: `pending_approval` → `queued` → `downloading` → `verifying` → `completed`. Every check
costs a full round of your context, so check rarely:
`state`: `pending_approval` → `queued` → `downloading` → `verifying` → `completed`. With `?wait=600`
Kaname holds the request until the job is finished (or 600 s have passed; then `timedOut` is
`true`), so one call replaces a polling loop. Keep `-m` (curl's time limit) a bit above the wait.
Every call costs a full round of your context, so call rarely:
- **`pending_approval`:** do **not** poll. Tell the user what you requested and that it awaits
their approval in Kaname, then stop. Check again only when the user says it's approved, or, if
the user asks for it, schedule a single one-off check later with your cron/scheduling tool.
- **`queued` / `downloading` / `verifying`:** check at most once, around the reported
`etaSeconds`; if there is no ETA, once after about 10 minutes. Never loop in short intervals.
- **`queued` / `downloading` / `verifying`:** one call with `?wait=600`. If it comes back with
`timedOut: true` and the ETA is long, tell the user it is still downloading instead of waiting
again and again. Never loop in short intervals.
- **`completed`:** tell the user it's ready.
- **`cancelled`:** the user rejected or cancelled it. Don't ask again unless the user says so.
- **`failed`:** report `error.message` to the user. Don't loop on retries.
+162 -12
View File
@@ -1,16 +1,17 @@
# Kaname API (`/api/v1`)
A small JSON API for programs and AI agents: look up Hugging Face repos, list the local library,
request downloads and follow them. Everything an agent can do here is bounded by
[guardrails](#guardrails); it can't delete models or files, change settings, or manage runtimes or
tokens.
request downloads, deploy models and benchmark them to tune launch options. Everything an agent can
do here is bounded by [guardrails](#guardrails); it can't delete models or files, change settings,
manage runtimes or tokens, or touch deployments it didn't create.
The rest of Kaname (the web UI and its internal `/api/*` routes) stays behind your OIDC login. Only
`/api/v1` accepts tokens, and it accepts *only* tokens (a browser session doesn't work there).
- [Authentication](#authentication)
- [Errors](#errors)
- [Endpoints](#endpoints)
- [Endpoints](#endpoints): models and downloads, [deployments](#deployments), [benchmarks](#benchmarks)
- [Waiting instead of polling](#waiting-instead-of-polling)
- [Guardrails](#guardrails)
- [Behind a forward-auth proxy (Traefik)](#behind-a-forward-auth-proxy-traefik)
@@ -27,6 +28,13 @@ Authorization: Bearer kn_…
| --- | --- |
| `models:read` | Hub lookup, list models, read jobs (and their log), disk space |
| `downloads:create` | `POST /api/v1/downloads`, within the guardrails |
| `deployments:read` | List runtimes and deployments, read a deployment's state and log |
| `deployments:write` | Create deployments; edit, start, stop and delete **its own** ones, within the guardrails |
| `benchmarks:read` | Read runs, sweeps and comparisons |
| `benchmarks:run` | Start runs, A/B runs and sweeps on **its own** deployments; cancel its own |
Tokens created before 0.13 keep the scopes they had; grant new ones with **Scopes** next to the
token in Settings → API tokens.
A missing, unknown or revoked token gets `401`; a token without the needed scope gets `403`. The
settings page shows when each token was last used; **Revoke** stops it immediately.
@@ -44,12 +52,12 @@ Errors are JSON with a message meant to be read and acted on:
| Status | Codes |
| --- | --- |
| 400 | `invalid_request`, `invalid_json`, `empty_selection` (quant or globs match nothing), `invalid_repo_id` |
| 401 / 403 | `unauthorized`, `forbidden` (scope), `author_not_allowed`, `gated_no_token`, `gated_no_access` |
| 400 | `invalid_request` (also unknown fields), `invalid_json`, `empty_selection` (quant or globs match nothing), `invalid_repo_id`, `invalid` |
| 401 / 403 | `unauthorized`, `forbidden` (scope), `author_not_allowed`, `gated_no_token`, `gated_no_access`, `runtime_not_allowed`, `arg_not_allowed`, `port_not_allowed`, `protected`, `not_owner` |
| 404 | `not_found`, `repo_not_found`, `revision_not_found` |
| 409 | `already_exists` (repo is in the library at another commit), `busy` (the model has an open job) |
| 422 | `too_large` |
| 429 | `too_many_jobs`, `rate_limited` (Hugging Face) |
| 409 | `already_exists` (repo is in the library at another commit), `busy` (a model with an open job; a deployment that must be stopped first), `runtime_not_pulled`, `vram_protected`, `invalid` (e.g. benchmarking a stopped deployment) |
| 422 | `too_large`, `limit_exceeded`, `too_many_variants` |
| 429 | `too_many_jobs`, `too_many_deployments`, `gpu_busy`, `rate_limited` (Hugging Face) |
| 503 / 507 | `disk_unknown` (worker offline), `disk_space` |
Sizes appear as bytes plus a readable `"… GB"` field (decimal GB, like the Hub).
@@ -136,7 +144,7 @@ curl -s -X POST -H "Authorization: Bearer $KANAME_TOKEN" -H "Content-Type: appli
```json
{ "created": true, "modelId": "01M…", "jobId": "01M…", "state": "pending_approval",
"requestedBytes": 5027783488, "requestedSize": "5.0 GB", "files": ["Qwen3-8B-Q4_K_M.gguf"],
"message": "Requested; waiting for the user to approve it in Kaname. Do not retry: check GET /api/v1/jobs/01M… every few minutes." }
"message": "Requested; waiting for the user to approve it in Kaname. Do not retry or poll; tell the user and stop." }
```
- **201**: a new job, `state` `pending_approval` (approval mode `approve`) or `queued` (`auto`).
@@ -149,7 +157,7 @@ curl -s -X POST -H "Authorization: Bearer $KANAME_TOKEN" -H "Content-Type: appli
It uses the same code path as the Add model dialog (the file list is fetched again from the Hub at
that commit; the client's list isn't trusted).
### `GET /api/v1/jobs/{id}[?log=N]`
### `GET /api/v1/jobs/{id}[?wait=S][&log=N]`
`models:read`. Compact job state:
@@ -166,7 +174,8 @@ that commit; the client's list isn't trusted).
States: `pending_approval`, `queued`, `downloading`, `verifying`, `completed`, `failed`, `cancelled`
(also when the user rejected the request), `interrupted`. The `hf` log is only included with
`?log=N` (the last N lines, at most 200).
`?log=N` (the last N lines, at most 200). `?wait=S` returns once the job is finished (or right away
while it waits for approval); see [Waiting instead of polling](#waiting-instead-of-polling).
### `GET /api/v1/disk`
@@ -181,8 +190,117 @@ States: `pending_approval`, `queued`, `downloading`, `verifying`, `completed`, `
`reservedBytes` is what open downloads still have to fetch; `availableForRequests` is what a request
may use before hitting the minimum-free guardrail.
### Deployments
A deployment is a model served by a runtime container. Agents use the same validation, estimates and
`docker run` command as the UI; they can only edit, start, stop, delete and benchmark deployments their
own token created, and never [protected](#protected-deployments) ones.
#### `GET /api/v1/runtimes`
`deployments:read`. Runtimes with a pulled image: engine (`llama.cpp` or `vllm`), accelerator
(`cpu`, `nvidia`, `dri` for Intel/AMD), what they serve, whether agents may use them (`allowed`) and
the extra argument flags agents may pass (`allowedExtraArgs`); plus the host's GPUs.
#### `GET /api/v1/deployments[?mine=1]`, `GET /api/v1/deployments/{id}[?wait=S][&log=N]`
`deployments:read`. State (`stopped`, `pending_approval`, `starting`, `running`, `stopping`,
`failed`), `mine`, `protected`, runtime, model, options, limits, the endpoint inside the Docker
network, what the server reported once ready (version, slots, context), live CPU/RAM, error and a
`next` hint. `?wait=S` returns once it is running, stopped or failed (or right away while the start
waits for approval). `?log=N` adds the last N log lines (max 200).
#### `POST /api/v1/deployments`
`deployments:write`.
| Field | |
| --- | --- |
| `runtimeId`, `modelId` | From `GET /api/v1/runtimes` and `GET /api/v1/models` |
| `options` | The deployment form's launch options: `modelFile` (llama.cpp: the `.gguf`; vLLM: `""`), `contextSize`, `parallel`, `cacheTypeK`/`cacheTypeV`, `flashAttn`, `gpuLayers`, `batchSize`/`ubatchSize`, `maxNumSeqs`, `gpuMemoryUtilization`, … and `extraArgs` (only [allowed flags](#deployments-and-benchmarks)). Unknown fields are refused. |
| `cpus`, `memoryMb` | Optional limits within the caps; without `memoryMb` the estimate is used |
| `hostPort` | Optional, only inside the configured range (none by default) |
| `name` | Optional |
| `start` | Default `true`; with approval mode `approve` the start waits for the user |
| `dryRun` | `true`: only validate; returns the command and estimates, creates nothing |
```json
{ "created": true, "id": "01M…", "state": "pending_approval",
"command": "docker run -v <models>:/models:ro ghcr.io/ggml-org/llama.cpp:server-intel -m /models/… -c 16384 -ctk q8_0 …",
"estimates": { "memoryMb": 9800, "vramMb": 7900, "gpuVramMb": 32768 }, "limits": { "memoryMb": 9800, "cpus": null },
"message": "Created; the start waits for the user's approval in Kaname. Don't retry or poll; tell the user and stop." }
```
#### `PATCH /api/v1/deployments/{id}`, `POST …/start`, `POST …/stop`, `DELETE …`
`deployments:write`, own deployments only. `PATCH` takes `options` (merged into the current ones),
`cpus`, `memoryMb`, `hostPort`, `name`, and only while the deployment is stopped; it returns the new
command and estimates. `start` goes through the same guardrails as creating one (and approval);
`stop` and `DELETE` never need approval.
### Benchmarks
#### `POST /api/v1/benchmarks`
`benchmarks:run`. A [BetterBench](https://github.com/GGZ14/BetterBench) run against the token's own
**running** deployment.
| Field | |
| --- | --- |
| `kind` | `run` (default) or `ab` (paired A/B with `deploymentBId`, same model; needs 2 agent deployments) |
| `deploymentId`, `deploymentBId` | Own, running deployments |
| `quick` | `true`: 5 passes, a smoke check; default `false`: 20 passes, comparable |
| `passes`, `phases` | Optional: passes per category; phases `decode`, `prefill`, `concurrency` (default all) |
| `label`, `description` | Optional; the description goes into the report and the launch80 preview |
Answers `201` with `state` `pending_approval` (default) or `queued`, and the run's time limit.
#### `GET /api/v1/benchmarks/{id}[?wait=S][&full=1]`, `GET /api/v1/benchmarks[?deployment=&requested_by=&limit=]`
`benchmarks:read`. Compact result:
```json
{ "id": "01M…", "kind": "run", "state": "completed", "label": "q8_0 KV", "mine": true,
"headline": { "decodeTps": 61.3, "prefillTps": 1840, "prefillDepth": 16000, "ttftMs": 92, "peakParallelTps": 155.2, "peakParallelLevel": 8 },
"setup": { "gpus": "1× Intel Arc Pro B65 (32 GiB)", "pcie": "Gen5 x8 of Gen5 x16", "p2p": "n/a", "rebar": "on",
"engine": "llama.cpp b11541-f2918cabb", "image": "ghcr.io/ggml-org/llama.cpp:server-intel", "digest": "sha256:…",
"model": "Qwen3-8B-GGUF Q4_K_M with q8_0 KV cache", "ctx": "16,384", "concurrency": "4" },
"resources": { "cpuAvgCores": 1.1, "ramPeakBytes": 2100000000,
"gpus": [{ "name": "Intel Arc Pro B65", "vramPeakMb": 9100, "vramTotalMb": 32768, "utilAvg": 88.5, "powerAvgW": 151.2, "tempPeakC": 71 }] },
"error": null, "next": "Done. Compare runs with GET /api/v1/benchmarks/compare?ids=…" }
```
`?full=1` adds BetterBench's complete summary (per category, per prompt depth, per concurrency
level). A/B runs add `ab` (pairs, verdict, decode difference with its confidence interval).
`POST /api/v1/benchmarks/{id}/cancel` cancels an own run.
#### `GET /api/v1/benchmarks/compare?ids=a,b,…`
`benchmarks:read`. 2–16 runs: headline numbers side by side, the setup values that differ per run
(`differs`) and the ones they share (`same`).
#### `POST /api/v1/sweeps`, `GET /api/v1/sweeps/{id}[?wait=S]`, `POST /api/v1/sweeps/{id}/cancel`
`benchmarks:run` / `benchmarks:read`. One or two settings varied from an own base deployment, e.g.
`{"baseDeploymentId": "…", "params": [{"key": "kvCache", "values": ["f16", "q8_0"]}], "quick": true}`.
Keys: `contextSize`, `modelFile`, `kvCache`, `threads`, `parallel`, `batchSize`, `ubatchSize`,
`flashAttn`, `cacheRamMb`, `gpuLayers`, `dtype`, `maxNumSeqs`, `kvCacheGb`, `gpuMemoryUtilization`,
`cpus` (per engine, as in the UI). Each variant is deployed, benchmarked and removed again. The
answer lists every variant with its headline numbers and setup.
## Waiting instead of polling
Every status call costs an agent a round of its context. The status endpoints (`/jobs/{id}`,
`/deployments/{id}`, `/benchmarks/{id}`, `/sweeps/{id}`) take `?wait=S` (seconds, at most 900): the
request is held until the state is settled (finished, running, failed, cancelled) or the time is up,
then answers with the current state plus `waitedSeconds` and `timedOut`. Something that waits for the
user's approval answers right away: there is nothing to wait for. Use one waiting call instead of a
polling loop, with a wait shorter than your HTTP client's timeout (and any proxy's).
## Guardrails
### Downloads
Settings → API tokens → **Guardrails for API downloads**. They apply to every token together;
downloads started in the UI aren't affected.
@@ -197,6 +315,38 @@ downloads started in the UI aren't affected.
Rejecting a request cancels its job. A model that only that request added leaves the library again;
for a request that added files to an existing model, the previous selection is restored.
### Deployments and benchmarks
Settings → API tokens → **Guardrails for API deployments and benchmarks**, for every token together:
| Setting | Default | Rejection |
| --- | --- | --- |
| Approval | **Ask me**: starts, runs and sweeps wait as *pending approval* on the deployment, run or sweep page. Creating or editing a stopped deployment, stopping and deleting own ones need none. | (not an error) |
| Agent deployments at once | 1 (running, starting or waiting to start); 2 for A/B runs | `429 too_many_deployments` |
| One GPU job at a time | No agent start while an agent run or sweep is pending or running, or another agent deployment is still loading; one agent run or sweep at a time; no sweep while an agent deployment runs (the sweep deploys its variants itself) | `429 gpu_busy` |
| Max minutes per run / sweep | 30 / 180, then the worker stops it | (`failed` with the reason) |
| Max variants per sweep | 8 | `422 too_many_variants` |
| Runtimes | Any with a pulled image, or an allowlist | `403 runtime_not_allowed`, `409 runtime_not_pulled` |
| Extra arguments | Tuning flags only, per engine (editable list); values can't be paths or URLs | `403 arg_not_allowed`, naming the argument |
| Host ports | None (Kaname reaches deployments over the Docker network), or a range | `403 port_not_allowed` |
| Memory / CPU caps | The host's size, or what you set; agent deployments always get a memory limit (the estimate if they don't give one) | `422 limit_exceeded` |
| Own deployments only | Agents change and benchmark only what their token created | `403 not_owner` |
Docker options (devices, volumes, privileges, capabilities, network) are never arguments: they belong
to the runtime, which tokens can't change.
### Protected deployments
The **Protect** button on a deployment's page: agents can't edit, start, stop, delete or benchmark
it, and can't start a deployment on the same GPUs if the estimated VRAM of everything running there
plus the new one (and 1 GiB to spare) exceeds the GPUs' VRAM (`409 vram_protected`). When the need
can't be estimated (only some layers on the GPU), such a start is refused too.
### Activity
Settings → API tokens → **Activity** next to each token lists what it did: every request that
creates or changes something, waits for approval, or was refused (with the error code).
## Behind a forward-auth proxy (Traefik)
If Kaname sits behind forward auth (e.g. Traefik with Tinyauth or Pocket ID), the proxy would answer