7
Configuration
Pascal Linxweiler edited this page 2026-10-30 14:07:04 +01:00

Configuration

Kaname is configured entirely through environment variables. With the provided compose.yaml they all go into the .env file next to it; start from .env.example.

After changing .env, apply it with docker compose up -d (the containers are recreated).

Login (OIDC)

Kaname has no local accounts. Everyone signs in through your OIDC provider (tested with Pocket ID) using the authorization code flow with PKCE.

Variable Required Default Description
AUTH_URL yes The URL you open Kaname at, e.g. http://192.168.1.10:3000 or https://models.example.com. Used to build the OIDC redirect URI.
AUTH_SECRET no generated Random secret that encrypts the session cookie. Empty: generated on first start and kept in the data folder (.auth-secret). To set your own: openssl rand -base64 33. Changing it signs everyone out.
OIDC_ISSUER yes Issuer URL of your provider, e.g. https://auth.example.com. Kaname reads /.well-known/openid-configuration from it.
OIDC_CLIENT_ID yes Client ID of the OIDC client you created for Kaname.
OIDC_CLIENT_SECRET yes Client secret of that client.
OIDC_ALLOWED_GROUPS no (everyone who can log in) Comma-separated group names, e.g. admin,llm. If set, Kaname requests the groups scope and only lets users in who are in at least one of these groups. Users without a groups claim are rejected.

Setting up the OIDC client (e.g. in Pocket ID):

  • Callback / redirect URI: <AUTH_URL>/api/auth/callback/pocket-id, for example https://models.example.com/api/auth/callback/pocket-id. It must match AUTH_URL exactly, including http/https and the port.
  • PKCE: enabled.
  • For OIDC_ALLOWED_GROUPS, the provider must put a groups claim into the ID token (Pocket ID does this for the groups scope).

Sessions last 7 days. Group membership is checked when you sign in, so removing someone from a group takes effect on their next login.

Hugging Face

Variable Required Default Description
HF_TOKEN recommended Hugging Face access token. Needed for gated and private repos; for public repos it gives you higher rate limits.

Which token? Read access is all Kaname needs. Best is a fine-grained token with:

  • Read access to contents of all public gated repos you can access (for models like Llama or Gemma)
  • Read access to contents of all repos under your personal namespace (only for your own private repos)

For gated models you also have to accept the terms on the model's Hugging Face page with the same account. The token stays on the server: it is passed to the hf CLI through its environment, never on the command line, and is never sent to the browser or written to logs.

Folders and ports (Docker host)

These are read by compose.yaml on the Docker host, not by the app itself.

Variable Default Description
KANAME_DATA_DIR ./data Folder for the SQLite database, shared by the web and worker containers. Must be on local disk: SQLite does not work reliably over NFS/SMB.
KANAME_MODELS_DIR ./models Folder where models are downloaded to, as <org>/<repo>/…. Can be a NAS share mounted on the host, see Storing models on a NAS.
WEB_PORT 3000 Port on the host where the web UI is published.
KANAME_VERSION latest Image tag to run, e.g. 0.16.0 (or 0.16 for the newest 0.16.x). Pin it if you only want to update deliberately.
KANAME_IMAGE git.linxweiler.xyz/pascallinxweiler/kaname Image without the tag. Only for an image you built or mirrored yourself. The default is public: no login needed.
PUID, PGID 1000 The user and group Kaname runs as, and that owns what it writes.

The containers start as root only long enough to prepare the folders, then run as PUID:PGID:

  • The data folder is Kaname's own; it is created if missing and given to PUID:PGID.
  • The models folder is given to PUID:PGID only if it is empty (e.g. just created). A folder that already has files is never changed: if Kaname can't write to it, the worker stops at startup and says so. Set PUID/PGID to the folder's owner (ls -ln /mnt/nas/models), or give that user write access on the host.

Downloads

Variable Default Description
MAX_CONCURRENT_DOWNLOADS 1 How many downloads run at the same time. Further downloads wait in the queue. Two downloads of the same model never run in parallel.
HF_HUB_DISABLE_XET 1 1: the hf CLI downloads over plain HTTP, which lets Kaname show accurate progress, speed and ETA. 0: use Hugging Face's Xet transfer protocol (can download only changed chunks when a model is updated), but the progress bar then only moves in large jumps.
UPDATE_CHECK_INTERVAL_HOURS 12 How often the worker checks each model on the Hub; 0 disables it. A check looks for a newer commit on the tracked revision (shown as "update available"; updating is always manual) and whether the repo and the pinned commit still exist (deleted repos are flagged, local files are kept). "Check now" on a model page runs it immediately.

Notes:

  • Before a download starts, Kaname checks that enough space is free in the models folder.
  • If a download is interrupted, the hf CLI restarts unfinished files from the beginning (it can't resume partial files); finished files are kept.
  • Speed limit: set in the UI, not in .env: Settings → Downloads → Speed limit, in MB/s, for all downloads together; changes apply to running downloads within seconds. The hf CLI has no bandwidth option, so the worker pauses and resumes it whenever it gets ahead of the limit: short bursts go above it, the average holds.

Code sandbox

The sandbox service in compose.yaml runs the quality eval's coding answers: no network, a read-only filesystem, no capabilities, memory/CPU/process limits. It shares only the sandbox volume with the worker. Remove the service (and the volume on the worker) and the eval skips its coding section. Kaname needs no access to Docker.

Variable Default Description
SANDBOX_DIR set in compose.yaml: /sandbox Exchange folder with the sandbox, on the worker and the sandbox. Unset on the worker: the coding section is skipped.

Benchmarks and launch80

See Benchmarks. BetterBench and the L80 CLI are part of the image; only publishing needs a setting.

Variable Default Description
L80_TOKEN launch80 publish token (comes with the launch80 Supporter role). Lets you publish a benchmark run as a public launch80 page, after a preview and an explicit confirmation. Unset: publishing is off, previews still work. The token stays on the server: it is passed to the L80 CLI through its environment, never shown in the UI or written to logs.
L80_API_BASE launch80's default Alternative launch80 API URL; you normally don't set this.

Advanced

You normally don't set these: the image's defaults match the paths in compose.yaml.

Variable Default (in the image) Description
DATABASE_URL file:/data/app.db SQLite database location inside the container. A relative path like file:./data/app.db puts the database inside the container, where it is lost on recreate and not shared between web and worker.
MODELS_DIR /models Models folder inside the container (mount your host folder there instead of changing this).
HF_HOME /data/hf-home Home directory of the hf CLI (logs and caches; no models).
HF_ENDPOINT https://huggingface.co Alternative Hub endpoint (e.g. a mirror); passed to the hf CLI. Metadata lookups still use huggingface.co.
HTTP_PROXY, HTTPS_PROXY, NO_PROXY Proxy settings, passed to the hf CLI.
PORT 3000 Port the web server listens on inside the container.
BENCHMARKS_DIR /data/benchmarks BetterBench results and HTML reports (default: benchmarks/ next to the database).
BETTERBENCH_BIN, L80_BIN set in the image Paths of the bundled betterbench and L80 executables.

Example

AUTH_URL=https://models.example.com
OIDC_ISSUER=https://auth.example.com
OIDC_CLIENT_ID=0b5e…
OIDC_CLIENT_SECRET=…
OIDC_ALLOWED_GROUPS=admin

HF_TOKEN=hf_…

KANAME_DATA_DIR=./data
KANAME_MODELS_DIR=/mnt/nas/models
WEB_PORT=3000
PUID=1000
PGID=1000
KANAME_VERSION=0.16

MAX_CONCURRENT_DOWNLOADS=2

L80_TOKEN=…