본문으로 건너뛰기
  1. 운영
  2. Self-hosting

운영

Self-hosting

이 페이지는 영어로 쓰여 있습니다.

Everything needed to build the image, to install it on a host of your own, and to hand it to whatever runs it. This repository stops at an image that builds and at the image of each release, published for everyone (ADR-0087): a deployment's registries, pipelines, infrastructure, DNS, TLS, CDN and rollout live outside it (ADR-0008).

FilePurpose
DockerfileThe one multi-stage image. Roles api, worker, migrate, check and purge are selected by the container command.
compose.dev.yamlLocal development dependencies (PostgreSQL 18 with the vector extension). Not a production topology.
compose.yamlThe self-hosting bundle for one host: PostgreSQL, migrate, api and worker from one image (Running with compose).
compose.meaning.yaml, compose.rerank.yaml, compose.gpu.yamlOverlays on the bundle: the embedding server of the search by meaning, the reranker, and both on an NVIDIA GPU.
compose.packs.yamlAn overlay: the packs of a directory of the host, mounted read-only and served at local addresses (packs from a directory).
install.shInstalls the bundle on this host: checks for docker, writes the settings with secrets of its own making, brings the bundle up and waits until it is ready (Installing with the script).
bundle.shMakes the directory an installation without internet is made from: the images, these files, the model files asked for, and the digest of every file (An installation without internet).
get-models.shFetches the model files of a profile into models/ and checks their digests, pinned in the script: base unless named, quality, quality-4bit, cpu-reranker or kure, several at once (the profiles); the directory stays out of git and of the image.
../.github/workflows/ci.ymlLint, build, typecheck, tests (integration tests run against a PostgreSQL service container), secret scan, and an image build that is then exercised: exit codes, migrate, the worker taking the queue up and handing it back, readiness, non-root user, clean shutdown. It needs no secrets. Every commit on main keeps its own run, since any of them may be deployed and a deployment pinned to a commit waits for its verdict; on other refs a newer push cancels the run before it.
../.github/workflows/release.ymlVersions and publishes the npm packages from the pending changesets: a pull request that bumps versions and changelogs, and, once it is merged, a publish through the registry's trusted publishing, with provenance and no stored secret (ADR-0046). The image of the release follows, from the same commit, to this repository's own container registry (ADR-0087): each platform built on a runner of its own, and both named together. Every run asks whether the registry has the image of the release the pushed commit is of, and builds a missing one from the commit of that release (ADR-0116).

The compose bundle for self-hosting is below, with the script that installs it.

Build and run locally

docker build -f deploy/Dockerfile -t skillcdn .      # from the repository root
docker run --rm skillcdn migrate                     # one-off role
docker run --rm -p 11188:11188 --env-file .env skillcdn api
docker run --rm -v "$PWD:/repo:ro" skillcdn check /repo    # what an agent would get from this directory

The image runs as a non-root user, contains production dependencies only, and has no secrets and no configuration baked in. It carries the fonts of the web UI under their own license; see THIRD-PARTY-NOTICES.md.

Running with compose

compose.yaml runs the whole product on one host: PostgreSQL with the vector extension, migrate once, then api and worker from one image, and, as overlays, the servers of the search by meaning and the packs of a directory of the host. It is a topology for one machine behind a reverse proxy of your own (below), not a cluster.

Installing with the script

On a host with docker and its compose plugin, from this directory of a checkout at a release:

./install.sh --url https://skills.example.com --packs /srv/packs

install.sh writes deploy/.env when there is none, with a database password, an admin token and the key of the usage statistics of its own making, readable by its owner alone; names the image of the release these files are of, ghcr.io/skillcdn/skillcdn:<version>, which the release workflow publishes for linux/amd64 and linux/arm64; brings the bundle up; and waits until the server is ready at http://127.0.0.1:11188. It takes no secret as an argument and prints none. --packs serves the packs of a directory (below), and --private with it serves them only to a request that presents a token you made for the pack; --meaning, --rerank and --gpu add the servers of the search by meaning, fetching the model files of the base profile when there are none; --image names another image and --build builds one from the checkout; --port moves the port; --no-start writes the settings and stops. Run again, it keeps every setting that is there and brings the bundle up on what it is told: that is also how an installation is updated, with the files of the new release. The overlays it turned on are written into the settings, so docker compose ps, logs and down in this directory mean the installation as it was installed. Every other setting of the environment contract is a line you add to deploy/.env before you run the script again: INDEX_AHEAD=packs, for one, on an installation that serves its organization's repositories from a git host (the worker).

By hand

  1. Build the image from the repository root, docker build -f deploy/Dockerfile -t skillcdn:local ., or name another in SKILLCDN_IMAGE: the image of a release, ghcr.io/skillcdn/skillcdn:<version>, or one you built elsewhere.
  2. Settings: cp .env.example deploy/.env, then set POSTGRES_PASSWORD to a long random value, from which the bundle builds DATABASE_URL, and what your installation needs besides, PUBLIC_URL, GITHUB_TOKEN, the variables of signing in. The containers read the file, and compose reads it for the variables of the bundle itself; git ignores it.
  3. docker compose -f deploy/compose.yaml up -d. The API answers at http://127.0.0.1:11188 (SKILLCDN_PORT moves it) once migrate has run. down stops the bundle; down -v drops the database as well. To update, build or pull the new image and up -d again: migrate runs first, then api and worker restart on the new image, as the rollout contract asks.

The search by meaning joins as overlays. Run get-models.sh once: it fetches the two files of the base profile (the profiles) into deploy/models/, 1.3 GB, and checks their digests; get-models.sh quality, quality-4bit, cpu-reranker or kure fetches the file of another profile or alternative beside them, each pinned to its digest, and EMBEDDING_GGUF and RERANKER_GGUF then name the files the overlays run. Then:

docker compose -f deploy/compose.yaml -f deploy/compose.meaning.yaml up -d
# and, for the reranker as well
docker compose -f deploy/compose.yaml -f deploy/compose.meaning.yaml -f deploy/compose.rerank.yaml up -d
# on an NVIDIA GPU, with the container toolkit installed
docker compose -f deploy/compose.yaml -f deploy/compose.meaning.yaml -f deploy/compose.rerank.yaml -f deploy/compose.gpu.yaml up -d

The overlays set EMBEDDINGS_URL, EMBEDDINGS_MODEL, EMBEDDINGS_SCOPE (public; all sends the text of private repositories to the server too, which is yours) and the query instruction, and the reranker's variables; deploy/.env may override any of them, and EMBEDDING_GGUF, RERANKER_GGUF, EMBEDDING_POOLING, MODELS_DIR and LLAMA_CPP_IMAGE choose other files, another profile or another server image. On a CPU the reranker overlay is best left out, as the evaluation set showed; the GPU overlay names both servers, so it goes with the reranker overlay and stacks last.

An installation without internet

At run time the bundle reaches nothing outside the host but the git host the packs come from, which may be a GitHub Enterprise Server inside the network (GITHUB_API_URL), or no git host at all, with the packs in a directory of the host (below). To install where there is no internet:

  1. Where there is, from a checkout at the release: deploy/bundle.sh --platform linux/amd64 --models "base" skillcdn-bundle. bundle.sh pulls the image of the release, the database's and, with --models, the inference server's (--gpu for the one for NVIDIA GPUs), saves them into one archive, fetches the model files of the profiles named and checks their digests, copies these files, and writes SHA256SUMS over everything and VERSION with what it took along. --image with --no-pull takes an image the host built instead. No settings and no secret go into it.
  2. Carry the directory over, by whatever the installation admits, and on the host: ./install.sh --offline --packs /srv/packs, with --meaning when the bundle has models. It checks every file against SHA256SUMS and installs nothing when one differs, loads the images, and brings the bundle up without pulling anything. The packs are the installation's own: copy them into the directory, <owner>/<name> each, and the worker finds and indexes them within a minute or two (the worker).
  3. Keep the bundle with the installation, as what it runs: an update is the bundle of the new release and the same command. Keep the model files with the installation as you keep the images. A change of model is a change of configuration and a backfill (the worker), never a file swapped under a running server; the vectors are keyed by the model's name, so a file replaced in place under the same name would be searched by the vectors of another model.

Whoever makes bundles for installations of their own, an organization's packs with a service beside the server, adds to the product's bundle instead of making another (ADR-0115). Each of these may be given as many times as there are:

bundle.shWhat goes alongWhat install.sh does with it
--packs DIRThe packs of the directory, <owner>/<name> each, without their .gitServes them from the bundle where the installation names no directory, as /local/<owner>/<name>; with --packs DIR, or a PACKS_PATH set before, puts each into that directory where no pack of its name is yet. A pack that is there is the installation's and is left: remove it and run the script again to take the bundle's.
--add-image REFAnother image, in the same archiveLoads it with the others.
--overlay FILEA compose file of yours, named compose.<name>.yaml, beside the bundle'sLays it over the bundle's own, last, and keeps it on at every run: the services it adds come up with the rest.
--add PATHA file or a directory beside these files: what the overlay mounts, a manualChecks it against the digests like every file.

VERSION names the overlays and says that packs came along, and SHA256SUMS covers every file, so an installation checks what you added as it checks the product. A file named .env among what you add is refused: the settings of an installation are made on its host. install.sh --with compose.<name>.yaml turns on an overlay that stands beside the script without a bundle having named it, and an overlay turned on stays on at every later run.

Environment contract

The server is configured only through environment variables. .env.example is the source of truth; this table adds what operators need to know. Both are updated in the same change as the config module.

VariableRolesRequiredSecretNotes
NODE_ENVallnonoThe image sets production.
LOG_LEVELallnonoDefault info.
SERVER_VERSIONapi, workernonoWhat the deployment was built as, which the server says of itself to whoever asks: as the version of the MCP server info, at every address and at the root, and in the user agent of its calls to the git host and to the inference servers (ADR-0133). Unset, an image says what its build wrote (below): the image of a release its version, an image you build the version of the packages with the commit (1.2.3+abc1234). Set it to say something else, 0.0.0 to say neither. A server run from source says 0.0.0. Three numbers and what a build may write after them (1.2.3, 1.2.3+abc1234); anything else is refused at startup.
SERVER_VERSION_FILEapi, workernonoThe file that holds what the build of the image wrote, read when SERVER_VERSION is unset (ADR-0134). The image sets it to /app/version; leave it as it is.
HOST, PORTapinonoDefaults 0.0.0.0 and 11188.
SHUTDOWN_GRACE_SECONDSapi, workernonoDefault 20. Keep the platform's stop timeout above it. The worker gives its running jobs this long before it lets go of them; a slice of embedding still running then stops before its next call to the embeddings server, and the next worker goes on from the body it was at.
HTTP_KEEP_ALIVE_SECONDS, HTTP_REQUEST_TIMEOUT_SECONDSapinonoDefaults 65 and 60. See Behind a reverse proxy.
ACCESS_LOGapinonoDefault true: one log line per request, probes excluded. Each line carries the client address and user agent: keep the log only as long as your privacy policy says, or turn it off. The usage statistics hold neither.
TRUSTED_PROXIESapinonoAddresses or CIDR networks whose forwarding headers are believed. Default: none.
CLIENT_IP_HEADER, REQUEST_ID_HEADERapinonoDefaults x-forwarded-for and x-request-id. Read only from trusted proxies.
CLIENT_COUNTRY_HEADERapinonoThe header in which a trusted proxy or CDN names the visitor's country (ISO 3166-1 alpha-2, or a subdivision as US-CA), which decides whether a page asks before analytics run (ADR-0051). Default: none, and every visitor is asked. Read only from trusted proxies.
DATABASE_URLallyesyesPostgreSQL connection string. The search by meaning keeps its vectors under the vector extension (pgvector): migrate creates the extension and its table where the server offers the extension and the role may create it, and otherwise logs the database's notice and makes neither, so that the search stays by words and everything else runs; the next migrate after the extension is installed makes them (ADR-0064). migrate also installs the schema of the job queue, pgboss, which api and worker use without migrating (the worker).
DATABASE_POOL_MAXapi, workernonoDefault 10 connections per process.
GITHUB_API_URLapi, workernonoDefault https://api.github.com. GitHub Enterprise Server: https://<host>/api/v3.
GITHUB_TOKENapi, workernoyesOptional, no scopes needed. Raises the GitHub rate limit for public-repo reads; without it the anonymous limit applies to the whole deployment.
GITHUB_WEB_URLapinonoWhere people sign in at the git host. Default: derived from GITHUB_API_URL (https://github.com, or the origin of a GitHub Enterprise Server).
GITHUB_APP_ID, GITHUB_APP_CLIENT_IDapinonoThe id and the client id of the GitHub App people sign in through. See Signing in and private repositories.
GITHUB_APP_PRIVATE_KEY, GITHUB_APP_CLIENT_SECRETapinoyesThe app's private key in PEM format (a value with \n for line breaks is accepted; GITHUB_APP_PRIVATE_KEY_FILE is the natural way to mount one) and its client secret.
GITHUB_APP_WEBHOOK_SECRETapinoyesThe secret of the app's webhook, at least 32 characters. Set, the server receives the app's events at /webhooks/gh, verifies each against this secret, and ends what it remembers when they say so (ADR-0038). Unset: there is no such route, and what is remembered ends when its time is up. Read only together with the app's other variables.
AUTH_SECRETapinoyesWhat the tokens of the git host are encrypted under at rest, and what requests in flight are sealed with. At least 32 characters, the same on every replica. Changing it signs everyone out. Signing in exists only when this and the four app variables are all set; setting some of them is a configuration error.
SESSION_TTL_DAYSapinonoHow long a browser stays signed in without being used. Default 30.
ACCESS_TOKEN_TTL_SECONDS, REFRESH_TOKEN_TTL_DAYSapinonoHow long an AI app's access token lasts, and how long it can renew it without the person. Defaults 3600 and 30.
PERMISSION_TTL_SECONDSapinonoHow long the git host's answer about what a person can see is believed: someone removed at the host keeps access for at most this long. Default 60; 0 asks on every request.
WEB_ROOTapinonoDirectory of a web UI build. The image sets /app/web; set it to an empty value to run without a UI. The build's render module runs inside the server, so only ever point this at a build made from this repository or its @skillcdn/web package, by you or by someone you trust, with or without pages of your own (below).
PUBLIC_URLapinonoThe origin visitors use, such as https://skills.example.com. Goes into canonical links, the sitemap and the URLs pages show. Unset: the origin of each request, which is right behind one hostname and wrong behind several; set it for any public deployment. Required for signing in: it is where the git host sends people back, the issuer of every token, and what the session cookie is bound to.
PACKS_DIRapi, workernonoA directory of packs the deployment serves at local addresses, besides the git host (packs from a directory). Unset: a local address is a name that is nothing.
PACKS_ACCESSapi, workernonoWho reads the packs of PACKS_DIR (ADR-0088): public (the default), everyone the deployment serves; token, only a request that presents a token the operator made for the pack through the admin API, which therefore needs ADMIN_TOKEN. Give the two roles the same value.
ADMIN_TOKENapinoyesBearer token of the admin API. At least 32 characters. Unset: the admin API does not exist.
GOOGLE_SITE_VERIFICATIONapinonoThe content of the google-site-verification meta tag a search console asks for; written into the head of every page.
GOOGLE_ANALYTICS_IDapinonoA Google Analytics measurement id (G-...). Set, the pages run analytics (ADR-0051): where the visitor's region asks first (ANALYTICS_CONSENT_REGIONS), and whenever the visitor could not be placed (CLIENT_COUNTRY_HEADER), a banner asks once and the script loads only after they agree; elsewhere it loads at once and the footer offers to turn it off; a browser that signals Global Privacy Control is never asked and never loads it. The script's consent mode starts denied in the regions that ask and granted elsewhere, advertising denied everywhere. The content security policy allows the script's sources and nothing else new. The pages send their own page views and the events of one funnel, naming only public repositories (ADR-0050); the property is set up to match, once (below).
ANALYTICS_CONSENT_REGIONSapinonoWhere the pages ask before analytics run: a comma-separated list of regions (ISO 3166-1 alpha-2, or a subdivision as US-CA), * for everywhere, none for nowhere. Default: the European Economic Area, the United Kingdom and Switzerland. Matters only with GOOGLE_ANALYTICS_ID.
TERMS_URL, PRIVACY_URLapinonoWhere the deployment's terms of service and privacy policy are, when they are hosted elsewhere. A page written into the deployment through the admin API is served at /terms or /privacy and comes first (ADR-0029). Whichever exists is written into the head of every page as a standard link type and shown in the footer. See Operating a public deployment.
CONTACT_EMAILapinonoWhom to write to about content: takedown requests and reports. Shown in the footer as a link, only when set.
CONSOLE_URLapinonoWhere the console this deployment's builders work on is, when there is one (ADR-0047): the console section of the front page links it, for the people who have a seat there, beside the console pack every visitor's AI connects to. Unset: no link. Written into the head of every page, which the pages read; the pages that depend on it are rendered per request rather than served prerendered.
OPENAI_APPS_CHALLENGEapinonoThe token ChatGPT's app directory gives whoever lists an address of the deployment, to see that they control its hostname (listing an address): one line without spaces, at most 512 characters. Set, GET /.well-known/openai-apps-challenge answers it as plain text and nothing else. Unset: nothing is there. It is no secret, since anyone can read it at that path.
USAGE_STATS, USAGE_STATS_FLUSH_SECONDSapinonoDaily counts per public repository (connections, tool calls, skill loads, file reads, distinct clients) and for the deployment as a whole over every repository, public or not, which name no repository and count distinct clients by the app they named; without anything that identifies a client: addresses are hashed under the key of the day, and the rows of a day are folded into counts and deleted when it is over. Read through the admin API. Defaults true and 15.
USAGE_HASH_SECRETapinoyesWhat client hashes are keyed from (ADR-0027); at least 32 characters. Unset, each process makes its own at start, and replicas or restarts within a day count a client more than once. Set it for more than one replica, or for exact counts.
REPO_TTL_SECONDS, REF_TTL_SECONDSapi, workernonoHow long repository facts and moving refs are trusted before revalidation. Default 60 each.
INDEX_WAIT_MSapinonoHow long a tool call waits for a new commit's index. Default 20000.
INDEX_CONCURRENCY, INDEX_LEASE_SECONDSapi, workernonoCommits indexed at once per process, and the lifetime of an indexing claim. INDEX_CONCURRENCY=0 makes an api process index nothing and serve only what another process, on any version, has indexed; the worker indexes what it is asked to, one commit at a time at least.
INDEX_AHEADworkernonoWhat the worker indexes ahead of requests (ADR-0085, the worker): listed (the default), the packs of PACKS_DIR and the repositories on the operator's lists; packs, every repository that is a pack as well; none, nothing, and every commit is indexed by the request for it. A push the git host announces is followed for every pack unless it is none. An installation that serves its own organization's repositories sets packs; a deployment that serves the public stays at listed; one whose packs are all in PACKS_DIR needs neither (which to set).
INDEX_AHEAD_MINUTES, INDEX_AHEAD_LIMITworkernonoHow long after the git host was asked where a ref points the worker asks again (default 15, 1 to 1440), which is also how soon a changed file of a pack in PACKS_DIR is seen; and how many repositories one pass, every minute, queues (default 50, 1 to 1000).
INDEX_RETENTION_DAYSworkernonoHow long an index is kept after it was last read, where no ref of a pack points at its commit (ADR-0086, ADR-0145): a commit an address is pinned to, a commit a branch moved on from, and every commit of a repository that is no pack. Default 30; 0 keeps every index. For a pack, the commit a ref somebody asked for points at, and the one it pointed at last, are kept whatever their age. Without a worker nothing is removed.
EMBEDDINGS_URL, EMBEDDINGS_MODELapi, workernonoThe embeddings server of the search by meaning (ADR-0064, ADR-0065): the endpoint of the common embeddings shape (POST <url> with input and model) and the model it serves, which the vectors are keyed by. Unset: nothing is embedded and the search is by words alone. Set, the worker embeds the sections of the indexed commits of the packs it ranks for it, and of the rest when a search asks (the worker), api queues the commits it indexes for it, and a search embeds its query and fuses the sections nearest in meaning with the words' results (words and meaning); a query the server does not answer within EMBEDDINGS_QUERY_TIMEOUT_MS is answered by words alone, and the result says so. Give the two roles the same model: a worker embeds under its own, and leaves a job for another alone. On CPUs, give them a server each, from the same model file: a query that shares a server with the worker's batches waits behind them, often past EMBEDDINGS_QUERY_TIMEOUT_MS, and is then answered by words alone.
EMBEDDINGS_SCOPEapi, workernonoWhich repositories are embedded (ADR-0064): none (the default), public, or all, which includes the private repositories the deployment serves, whose text then goes to the embedding server as well (operating a public deployment). Under none nothing new is embedded and a search by meaning finds what was embedded before. Read only with EMBEDDINGS_URL. Within the scope, the Entitlements port decides per repository and may bound the bytes embedded per repository and per account and day; the default allows everything without bounds, and a manifest may keep its documents out (format).
EMBEDDINGS_DIMENSIONSapi, workernonoHow many numbers every vector has. Default 1024. A longer vector the model answers is cut to them and normalized, as the models of ADR-0065 allow; a model that answers fewer is the wrong model. A change of dimensions is a change of model, with a backfill.
EMBEDDINGS_QUERY_INSTRUCTIONapinonoThe one-line task told to the model in front of a query, never of a document, as the instruction-tuned models take it (Instruct: <task> on one line, Query:<text> on the next). Default: none; the models of ADR-0065 lose a few points of retrieval without one.
EMBEDDINGS_KEY, RERANKER_KEYapi, workernoyesBearer tokens for the servers, when they want one.
EMBEDDINGS_TIMEOUT_MS, EMBEDDINGS_QUERY_TIMEOUT_MS, RERANKER_TIMEOUT_MSapi, workernonoHow long a call may take: embedding documents (default 60000), embedding a query (5000) and reranking (5000). A query and a reranking count the wait for their turn in it, since a search waits for them; a call embedding documents may wait that long for its turn and then has the whole time, up to the ten minutes EMBEDDINGS_TIMEOUT_MS may be set to: nothing else ends a call the server has not answered yet. A search whose query cannot be embedded or reranked in time is answered by words alone; a worker whose call fails tries the slice again later.
EMBEDDINGS_QUERY_TOKENSapi, workernonoWhat a query is cut to before it is embedded, in the tokens they are estimated to be (default 128, ADR-0109): some hundred words of English, 160 characters of Korean. Its words are searched whole. A server embeds a query more slowly the longer it is, and three queries in a row that run out of EMBEDDINGS_QUERY_TIMEOUT_MS leave every search of the process to the words for ten seconds; raise it where the server embeds a long query within that time.
EMBEDDINGS_NEAR, EMBEDDINGS_FARapinonoWhat the embedding model's similarity means, for the search to say how a result matches (ADR-0138): the cosine similarity from which a section is near a query, which makes its result a close match, and the one under which a result is far from it, which counts against it. No default, since the scale is the model's own: unset, the search judges nothing by meaning, and says only what the words and the reranker tell it. What the models of the profiles measured, and how another model is measured, is under the model profiles. -1 to 1, the second not over the first. Read only with EMBEDDINGS_URL.
EMBEDDINGS_CONCURRENCY, RERANKER_CONCURRENCYapi, workernonoCalls one process has in flight at once to each server; the rest wait their turn within their timeout, and a call that cannot start in time is not sent. Default 2 each: enough to keep a server of several cores busy. After three failures in a row a server is left alone for ten seconds, then asked once. The worker runs as many slices of embedding at once as this.
EMBEDDINGS_BATCH_TEXTS, EMBEDDINGS_BATCH_CHARS, EMBEDDINGS_TEXT_CHARS, EMBEDDINGS_TEXT_TOKENSapi, workernonoHow sections are packed into one call, at most this many texts (default 16) and this many characters over them (32000), and what a text is cut to before it is embedded: this many characters (8000), and then this many tokens as they are estimated for its script (4096, ADR-0105), which leaves eight thousand characters of English whole and cuts Korean or a list of hashes near five thousand. The defaults suit a CPU of eight cores, where they were measured, and a GPU takes more. On two CPU cores the base embedder reads some fifty to sixty tokens a second, so that a call of the default batch runs for minutes, past the default EMBEDDINGS_TIMEOUT_MS: take EMBEDDINGS_BATCH_TEXTS=2, EMBEDDINGS_BATCH_CHARS=8000, EMBEDDINGS_CONCURRENCY=1 and EMBEDDINGS_TIMEOUT_MS=180000 there. The timeout has to cover the longest single text as well, which no batch setting shortens: a text of the full EMBEDDINGS_TEXT_CHARS in a script that spends a token on every character is several thousand tokens, and a server reads a long text more slowly a token than a short one. A call that does not end in time is made again a text at a time, each cut to a quarter of EMBEDDINGS_TEXT_TOKENS, and the worker logs a call of the embedder ran out of time, so its sections were embedded from their beginnings with the file: where that line keeps coming, raise EMBEDDINGS_TIMEOUT_MS, to its most (600000) if need be, or lower EMBEDDINGS_TEXT_TOKENS. The timeout is the whole of what bounds a call: the server may take as long as it says to begin its answer. Keep EMBEDDINGS_TEXT_TOKENS within what the server takes as one input. A section already embedded keeps its vector when the setting changes; one whose text was cut is found again by the text as it was cut, so after the setting is raised such a section is embedded anew the next time its file changes, and until then its vector is that of its beginning.
RERANKER_URL, RERANKER_MODELapinonoThe reranking server of the search by meaning (ADR-0065): the endpoint of the common reranking shape (POST <url> with query and the candidates, spelled documents and texts both, answered with each candidate's index and its relevance_score or score) and its model. Optional beside the embeddings server: unset, the fused results are not reranked.
RERANKER_CANDIDATESapinonoHow many of the first results of a search the reranker scores before the page is cut, each by its title, heading path and the start of its best section. Default 10, at most 32: about what a CPU server scores within RERANKER_TIMEOUT_MS; a GPU takes more.
RERANKER_RELEVANT, RERANKER_IRRELEVANTapinonoWhat the reranker's score means, in the scale its server answers in, a probability from one and a logit from another (ADR-0138): the score from which a result is relevant, which makes it a close match, and the one under which it is irrelevant, which counts against it. No default: unset, the reranker only orders. Either may be set alone, for a reranker trusted to say yes and not no. Read only with RERANKER_URL.
HUB_SEARCHapi, workernonoWhether the root of the deployment is searched across every public pack it serves, over MCP and at GET /api/v1/search (ADR-0070). Default true; false leaves the route and the server out, and keeps no copy of the entries that search reads (the worker): set it the same on both roles.
HUB_SEARCH_TIMEOUT_MS, HUB_SEARCH_CANDIDATESapinonoHow long each statement of that search over every pack may take before the database cancels it (default 2000, 100 to 60000), and how many entries the words, and the meaning, each bring to the fusion of a search (default 50, 5 to 200). A deployment with many packs raises the time or lowers the candidates as it measures. The meaning running out leaves the words to answer, and is not asked again for a minute; the words running out leave the meaning to answer alone, which the answer says (ranking.words: false) and no cache keeps; 503 search.timeout where neither answered (ADR-0091). A statement that runs out of its time is named in the log of api, at warning (statement: count, words or meaning), and an answer that took longer than this limit says there, at info, how long each of its parts took in milliseconds (took: packs, count, words, embed, meaning, items, rerank).
HUB_SEARCH_PARTSapinonoHow many parts of the packs' documents that search picks by meaning before it compares their sections (ADR-0092): a part is eight consecutive sections of a document, compared by the mean of their vectors. Default 200, 0 to 10000. More parts find a little more and read more sections, eight for each, from their copies at half precision (ADR-0103); 0 compares every section of every pack, as before the parts, which a deployment of a few packs can afford and one of many cannot. Needs nothing set up: the worker makes the vectors of the parts from those of the sections (the worker), on a database whose vector extension is 0.7.0 or newer; on an older one every section is compared.
SEARCH_CACHE_SECONDS, SEARCH_CACHE_ENTRIESapinonoHow long the answer to a search across packs is kept (ADR-0075): in each process, where the same question asked within the time is answered from what was kept, and as what the page of a term and GET /api/v1/search tell a cache in front of the deployment (public, max-age=60, s-maxage=<seconds>, stale-while-revalidate=<seconds>). Defaults 300 and 1000 answers per process; 0 keeps nothing and answers no-store. An answer that came without its words or without its meaning is never kept, whatever is set here (ADR-0096): while the embeddings server is away, every search is answered from the database. Nor is one that left out a result because the git host could not say in time whether its repository is still public (ADR-0097).
SEARCH_CONCURRENCYapinonoHow many searches across packs one process runs at once (default 8); past that a search, on the page or on the API, is refused with 503 search.busy and retry-after. The same question asked twice at once runs once.
SEARCH_SITEMAP_TERMSapinonoTerms, comma-separated, whose pages of results (/search/<term>) the sitemap lists in every language. Default: none. A page of results is offered to search engines only when it has at least three results, whether listed here or not.
LANDING_SECTIONSapinonoThe sections the front page shows after its first screen, comma-separated from agents, organizations, showcase, console, packs, steps, builders, faq and cta, in the page's own order; none for the first screen alone. Unset: every section. Written into the head of every page, which the pages read; the pages that depend on it are rendered per request rather than served prerendered. packs,faq is a plain front page for an installation of your own.
INDEX_MAX_*, READ_MAX_FILE_BYTESapi, worker, checknonoLimits on the work one repository may cause, including the unpacked size of a commit archive; see .env.example. A file over READ_MAX_FILE_BYTES is not served: the skill is listed without it and names it with where to fetch it (ADR-0033). The decision is made when a commit is indexed, so a changed limit shows after re-indexing. Of this table, check and the skillcdn check command read these and nothing else; the command has two variables of its own, which its page names.

Invalid configuration stops the process with exit code 78 and a message that names the variable and the rule, never the value.

Every secret NAME may instead be provided as NAME_FILE, a path to a file holding the value, so secret mounts work. Secrets are injected at runtime by the platform (for example a task definition that references a secret store). They are never build arguments, image layers or committed files.

Packs from a directory of the deployment

A deployment serves packs from its own filesystem as well as from the git host (ADR-0071), for an installation whose packs live where no git host can be read from. PACKS_DIR names a directory whose children are owners and their children packs: the directory acme/handbook under it is served at /local/acme/handbook, to MCP, the REST API, the pages and the search across every pack, indexed and searched like a repository. Mount the directory into the api and the worker containers at the same path and set the variable to it; the server reads it with its own permissions and nothing outside it, executes nothing in it, and follows no symbolic link. Names are letters, digits, ., _ and -, with no leading dot.

A pack has no commits: the hash of its tree stands in for one, and a changed file is a new commit, seen by the next request once the ref's time is up (REF_TTL_SECONDS), by the worker every INDEX_AHEAD_MINUTES with nobody asking (the worker), or when an administrator asks for an index now (the admin API); the commit before answers until the new one is indexed. A directory copied in is found by the worker within a minute and indexed before anyone asks for it, so that the search across packs finds it. Every directory pack is public to everyone the deployment serves and counts as verified: whoever writes to the directory decides what is served. The files of a pack that are not text, its pictures and the originals its documents were made from, are sent from the directory as attachments by GET /api/v1/raw/<address>?path= (REST, ADR-0077), whatever their size, with the headers that keep a browser from running anything in them; a read of such a file names that route, and the pictures a pack declares are loaded from it. Feature a pack or vouch for it as any repository. Set PUBLIC_URL, so that the source a result names for a file of such a pack is a page visitors can open.

Packs that not everyone may read. With PACKS_ACCESS=token every pack of the directory is one that is not public (ADR-0088, permissions): nobody is served it without a token, the search across packs and the pages never name it, and an agent reads it by presenting, in its authorization header, a token you made for it:

curl -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: application/json" \
  --data '{"address":"/local/acme/handbook","label":"the survey agent","expiresInDays":90}' \
  http://127.0.0.1:11188/admin/v1/pack-tokens

The answer holds the token, this once; the deployment keeps its hash. "address":"/local" makes a token for every pack of the directory, and leaving expiresInDays out one without an end. Give each agent a token of its own, so that one can be ended without the others, and keep a token as you keep a password: in the agent's own settings, never in a pack. The switch is for the whole directory; turning it on closes at start what was served to everyone before. With the search by meaning, such packs are embedded only where EMBEDDINGS_SCOPE is all, since their text then goes to the embedding server, which is yours. A proxy in front has to pass the authorization header through.

The inference server and the model profiles

The search by meaning runs on open-weight models the deployment serves itself (ADR-0065), through the common embeddings and reranking shapes the adapters speak: any server that speaks them serves, and the adapters know none by name. The one measured here, and the one the compose bundle runs (Running with compose), is llama.cpp's llama-server with the models as GGUF files, which runs on a CPU or a GPU from one image and is the one server that scores the Qwen3 reranker as its authors intend. A GGUF of that reranker converted before llama.cpp knew the reranker, in September 2025, scores at random: take a file whose header carries the reranking metadata (qwen3.pooling_type, tokenizer.chat_template.rerank), such as the ones named below.

Two profiles, named by the reranker they run, recommended as of 2026-10-23 from a measurement on one machine over two invented packs (ADR-0067, what the models measured); they share the embedder, so moving between them is a change of the reranker's settings and no backfill. Which one a deployment runs, and whether an alternative below suits its packs better, is its own choice, made by configuration and checked on its own packs with the evaluation command.

ProfileEmbedderRerankerRuns on
baseQwen3-Embedding-0.6B: Qwen/Qwen3-Embedding-0.6B-GGUF, Qwen3-Embedding-0.6B-Q8_0.gguf (0.6 GB)Qwen3-Reranker-0.6B: ggml-org/Qwen3-Reranker-0.6B-Q8_0-GGUF, qwen3-reranker-0.6b-q8_0.gguf (0.6 GB)the embedder on a few CPU cores or any GPU; the reranker on a GPU, where a search takes a quarter of a second, since on a CPU it takes five to ten seconds, so a deployment on CPUs alone leaves it out, or runs bge-reranker-v2-m3 with RERANKER_CANDIDATES of five, two to three seconds a search within the default timeout, for most of the reranker's gain
qualitythe sameQwen3-Reranker-4B from a current conversion: giladgd/Qwen3-Reranker-4B-GGUF, Qwen3-Reranker-4B.Q8_0.gguf (4.3 GB) or Qwen3-Reranker-4B.Q4_K_M.gguf (2.5 GB)one GPU: the 8-bit file with 6 GB free (-np 1 -b 1024 -ub 1024), the 4-bit file beside the embedder in 4 GB; a search takes about a second

The alternatives of ADR-0065 and ADR-0067, measured beside the profiles: KURE-v1 as the embedder (Bingsu/KURE-v1-Q8_0-GGUF, kure-v1-q8_0.gguf, a fine-tune of BGE-M3: --pooling cls, no query instruction, 1024 dimensions, an input of 8192 tokens), the best embedder measured on both evaluation sets, alone and with either reranker, and so the one to prefer on CPUs alone and for packs that are Korean above all (the file named is a community conversion; the official weights at nlpai-lab/KURE-v1 convert with the current llama.cpp as the harrier models do); harrier-oss-v1-0.6b as the embedder (microsoft/harrier-oss-v1-0.6b, MIT, no official GGUF: converted with the current llama.cpp, convert_hf_to_gguf.py --outtype q8_0), served exactly as the base embedder is, --pooling last, the same query instruction and 1024 dimensions, the best embedder within one language and on codes and designations and one that does not search across languages; and bge-reranker-v2-m3 as the lighter reranker (gpustack/bge-reranker-v2-m3-GGUF, bge-reranker-v2-m3-Q8_0.gguf), a quarter of a second on a GPU and two and a half to five seconds on a CPU. Qwen3-Embedding-4B (Qwen/Qwen3-Embedding-4B-GGUF) measured equal to the 0.6B embedder on both sets and is no longer a profile; a deployment that runs it keeps working, and changes it with a backfill when it wants to.

How the two servers of a profile are started, the ports and the path as examples:

# The embedder: pooled embeddings, with a context that holds a whole section.
docker run -d -p 8080:8080 -v ./models:/models:ro ghcr.io/ggml-org/llama.cpp:server \
  -m /models/Qwen3-Embedding-0.6B-Q8_0.gguf --embeddings --pooling last -c 8192 -b 8192 -ub 8192 --no-webui
# The reranker.
docker run -d -p 8081:8080 -v ./models:/models:ro ghcr.io/ggml-org/llama.cpp:server \
  -m /models/qwen3-reranker-0.6b-q8_0.gguf --reranking -c 8192 -b 8192 -ub 8192 --no-webui

On a GPU, the :server-cuda image with --gpus all and -ngl 99. Then EMBEDDINGS_URL=http://<host>:8080/v1/embeddings and RERANKER_URL=http://<host>:8081/v1/rerank; EMBEDDINGS_MODEL and RERANKER_MODEL name the models, which this server takes as any name and answers with the model it loaded, so give the name once and keep it for the model's life, since the vectors are keyed by it; EMBEDDINGS_QUERY_INSTRUCTION as in .env.example for the Qwen3 and harrier embedders and unset for KURE-v1. What the profiles and the alternatives measured on the two evaluation sets, and the defaults that follow for a CPU and for a GPU, are in the evaluation sets' page.

What the numbers of a model mean

A search says which of its results match the query closely and says so when none does (ADR-0138, how a result matches). By the words it does so on every deployment. By the meaning and by the reranker it does so only where the deployment says what their numbers mean, since the scale of a similarity is the embedding model's own and the scale of a score the reranker's and its server's: EMBEDDINGS_NEAR and EMBEDDINGS_FAR, RERANKER_RELEVANT and RERANKER_IRRELEVANT, which have no default. A bound that does not fit the model is worse than none: one too high for it tells every search that nothing matches.

What the models measured here take, as of 2026-12-01 and from these files through llama.cpp (how a match was measured); the compose overlays set the base profile's:

ModelBounds
Qwen3-Embedding-0.6B, with the query instruction of .env.exampleEMBEDDINGS_NEAR=0.6, EMBEDDINGS_FAR=0.45
KURE-v1the same two
Qwen3-Reranker-0.6B, which answers a probabilityRERANKER_RELEVANT=0.5, RERANKER_IRRELEVANT=0.01
bge-reranker-v2-m3, which answers a logit through this serverRERANKER_RELEVANT=0, RERANKER_IRRELEVANT=-9, or the second left unset where packs are asked in another language than they are written in, which is where this reranker is least sure

The other models named above were not measured for it, and neither is any model on a deployment's own packs: eval:search with --foreign, the questions of a pack the measured one does not answer, says where the similarities and the scores of a model stand for the questions a pack answers and for those it does not, and with --near, --far, --relevant and --irrelevant what the bounds come to. Near belongs where the foreign questions end and far under where the pack's own begin; until a model is measured its bounds stay unset, and the search judges by the words.

The worker

The worker role runs the jobs of the deployment (ADR-0064), kept by pg-boss in the database, in the schema pgboss that migrate installs. It takes the same environment as api and needs no port. One worker is enough; several share the queue, and a worker that is stopped hands its running jobs back within SHUTDOWN_GRACE_SECONDS.

docker run -d --env-file .env skillcdn worker

What it runs, first to last in the order the queue takes them (ADR-0072):

  • A repository indexed on request. An address is resolved as everyone sees the name, indexed if it is not, and its sections are then embedded ahead of everything else, whatever the repository. POST /admin/v1/embeddings/index/<address> asks for it (the admin API), which also reads how the queues stand; so does a person who administers the repository at the git host, from its page, for a repository that is not public as well (REST).
  • A pack, ahead of the requests for it (ADR-0085), unless INDEX_AHEAD is none. Every minute a pass queues the repositories with a ref that is due, one job each, and the job asks the git host where the refs somebody asked for point, the ten asked of it last, and indexes a commit that has no index. A ref is due when the git host announced a push, for every pack whose owner installed the app (signing in); when the host was not asked about it for INDEX_AHEAD_MINUTES, for the packs of PACKS_DIR and the listed repositories, and under packs for every pack; and when its commit has no index under this build's reading rules, so that a deployment of new rules is rebuilt by the worker, by rank, while every pack is served from the index it had. While packs it looks at are left to index under the rules in force, the worker logs packs looked at ahead of requests are left to index under the reading rules in force with how many, each time the number changes, and every pack looked at ahead of requests is indexed under the reading rules in force when none is: after a release, the time of that line is when the rebuilding ended. A directory of PACKS_DIR nobody asked for is found and indexed. A repository with neither a manifest nor a skill is left to the requests for it. One look per repository waits and one runs; a pass queues at most INDEX_AHEAD_LIMIT; a git host that limits its answers or gives none is left alone for the time it names, five minutes at least. What the worker indexes is then embedded as below.
  • The copy of the entries searched across the packs (ADR-0104), every minute: the findable entries of the commits the search across packs covers, with their search vectors, which its words are counted and matched in. An index the search covers is copied as it is written; the pass copies what no write did (a default branch moved back to a commit indexed before, a repository public again) and drops what the search covers no longer. After the update that brought it, the first pass copies everything the search covers, which takes about as long as reading those entries once, and until a pack is copied its words are read from the entries of every commit, as before. The copy takes about 1.3 times what the vectors of those entries take; with HUB_SEARCH false nothing is copied, and the pass drops what was. Its line, the entries of the search across packs were copied, says how many snapshots it copied (copied), dropped (dropped) and left for the next pass (left), and is written only when it did something.
  • The indexes nothing keeps, removed (ADR-0086), hourly, unless INDEX_RETENTION_DAYS is 0: the index of a commit that no ref of a pack points at or pointed at last, once nobody has read it for that many days, with the stored bodies and the vectors that no index names any more. What a ref of a pack serves is never among them, a pack being what the worker ranks as one: a pack of PACKS_DIR, a repository on your lists, one that is not public, and one that holds a manifest or a skill. An address pinned to a commit keeps its index by being read, and so does a repository that is no pack, its default branch included (ADR-0145): either is indexed again when it is next asked for after going unread for the time, and such a repository is searched across packs only while its index is there. Each index goes in a transaction of its own, its entries a thousand at a time, so that an index of a large repository is removed like any other (ADR-0139); a pass removes indexes for five minutes and five hundred at most, the longest unread first, and the next goes on with what is left, so a backlog, such as the one that falls due a retention time after the update that brought retention, drains over the hours after. Its line, indexes nothing points at and nobody read were removed, says how many indexes, entries and bodies went. An index whose removal failed is kept whole, counted as read at that moment, so that the pass goes on and the next does not start with it, and named in a warning, an index nothing keeps could not be removed, and is kept as if it was read now, with what failed. The update that brought this builds an index of the entries by their body during migrate, while the old version keeps writing, as the rollout contract says.
  • The sections of an indexed commit, where EMBEDDINGS_URL is set, EMBEDDINGS_SCOPE admits the repository and the database has the vector extension, by the repository's rank: the repositories the operator lists (the admin API) and the packs of its own directory first; then the packs that declare themselves with a SKILLCDN.md, and the private repositories where the scope embeds them; then the repositories that hold a SKILL.md. Within a rank, what a search by meaning just asked for comes first, then what api just indexed, then the backfill. A repository that is none of these is embedded only when a search by meaning reaches it, behind everything else, or on request; until then it is searched by words, and the search across packs finds it by words alone. The worker asks the scope, the Entitlements port and the rank again before it embeds, stops at the bounds they name, leaves out the documents a manifest keeps to the words, and embeds the Markdown documents and skills of the commit body by body, in slices of five minutes, or of 256 sections where the server is faster, each slice a job of its own that goes back to the queue at its priority, so that a large pack takes turns with the others of its rank and a restart loses at most the body it was at. The queue hears from a running slice every half minute, so a slice whose worker died is tried again within a couple of minutes; an attempt counts as failed only past four hours, far beyond the largest body on two cores, and a slice whose attempt is failed stops before its next call to the embeddings server. A body embedded once serves every commit, ref and fork that holds the same bytes. The embedder's calls stay within EMBEDDINGS_BATCH_*; a call that fails is tried again with a delay that doubles, and what was written stays.
  • The sweep, once at start and every hour: the snapshots served right now, the ready index of the commit a ref points at, of the ranked repositories, that have no complete embedding under the configured model are queued as the backfill, by rank. After a change of EMBEDDINGS_MODEL or EMBEDDINGS_DIMENSIONS that is every served pack, the backfill of ADR-0065; once nothing is left to embed under the new model, the vectors of the old one are dropped, and not before, so that a configuration turned back finds them whole. To change the model: set the new one on api and worker, redeploy, and let the sweep run; nothing else. While a pack waits for its vectors under the new model its search answers by words alone, and its results say how they were ranked: a query is embedded by the configured model and compared with that model's vectors, so the old ones answer nothing meanwhile. A change of model is a time of search by words for each pack, as long as its backfill takes, and is made when that is acceptable. Searching by the old vectors until the new are whole would take the old model's server beside the new one and twice the vectors; nothing does that, and it is left until a change of model asks for it. Before it queues anything, a sweep gives every embedding job that waits the priority this build gives it, by the rank its repository has now, and queues nothing for a snapshot whose slice waits: what a build before queued, while a rollout ran the two side by side, and what waits since the operator listed its repository, are in order after the next sweep (ADR-0073). The worker runs the sweep at start in its own process, before it takes a slice, so that a worker of the build before, still running, cannot take it. A section whose text was embedded before under the model, in any body, is given that vector and costs no call (ADR-0093): a pushed file costs the sections that changed, and the line a slice logs, embedding slice done, says how many it wrote so (reused). The vectors written before the update that brought this are not found by their text, so a file's first change after it embeds the file whole once more. A sweep also makes the vectors of the parts of what is embedded, which a search across the packs compares first (ADR-0092), and a copy of each section's vector at half precision, which it compares the sections of the parts it picked by (ADR-0103), wherever they are missing: after the update that brought them, for everything embedded before it, in batches and without calling the model; a slice writes them with the sections from then on. Until that first sweep is through, a search across the packs finds by meaning only what it has reached, and compares the sections that have no copy yet with their own vectors. The copies take about two and a half kilobytes a section, beside the four of the section's own vector. A skill is embedded as its sections and as its head, its name and description as one text (ADR-0094): a slice writes the head with the sections, and the hourly sweep gives the skills embedded before the update that brought this theirs, one short text a skill, for at most five minutes a sweep and those a search reads now first, so a deployment with thousands of skills on a CPU takes many sweeps to have them all; the sweep's line, embeddings swept, says how many it gave (heads) and how many are still without one (headsLeft), 0 once it is done. A sweep that gave none while some are left had an embedder that did not answer, which a warning beside it says. Nothing else is embedded again for it, and the sweep at start embeds nothing.

Which repositories the worker looks at ahead is yours to set (INDEX_AHEAD), and it follows from whose repositories the deployment serves:

  • An installation that serves its own organization's repositories sets packs. Every pack is then asked about every INDEX_AHEAD_MINUTES, whether or not its pushes are announced, which they are not where the git host cannot reach the installation with its events; and a release with new reading rules is rebuilt for all of them before anyone asks. The packs are the organization's own, so what it costs, one question to the git host per ref per interval, is bounded by what the organization has. Give the deployment a token (GITHUB_TOKEN) or the app, so that the questions are not asked on the anonymous allowance.
  • A deployment that serves other people's repositories to the public stays at listed, the default. Under packs it would ask the git host about every pack anybody ever asked it for, every interval, whether or not anyone still reads it, out of the allowance of its own token, and anyone adds to that by publishing a manifest and asking for it once. The repositories that are to be fresh before anyone asks are the ones you list (the admin API); the push of a repository whose owner installed the app is followed under both settings.
  • An installation whose packs are all in PACKS_DIR needs neither: the packs of the directory are looked at under every setting but none.

Without EMBEDDINGS_URL the worker indexes, on request and ahead of requests, and embeds nothing. With it and without the extension it says so and embeds nothing; so does EMBEDDINGS_SCOPE=none. Every slice adds the bytes, sections and tokens it embedded to the account's day, and tells the UsageSink port the tokens the model read, for whoever meters the deployment. The queue's own maintenance, the deletion of finished jobs after a week among it, runs in the worker as well.

The admin API

The operator's lists and the takedown (ADR-0026) are managed through /admin/v1, which exists only while ADMIN_TOKEN is set and answers to nothing else than that token as a bearer token. Keep it off the public internet where you can: it is meant for an operator's shell. A page of your own may call it too (below), with the token typed into the page by whoever has it: the token is then in that browser, and is good for everything this API does. Every answer is JSON and never cached.

RequestWhat it does
`GET /admin/v1/repositories[?kind=verifiedfeatured
PUT /admin/v1/repositories/<kind>/gh/<owner>/<repo>[@<ref>][/path]Adds an entry and answers with the address it was stored under. A verified or blocked entry names a repository, without a ref or a path; a featured one is any address. Adding what is already there changes nothing.
DELETE /admin/v1/repositories/<kind>/gh/<owner>/<repo>[@<ref>][/path]Removes an entry; 404 when there was none.
POST /admin/v1/purge/gh/<owner>/<repo>Removes what was indexed for the repository: its snapshots, their index entries, its cached refs, and the file bodies nothing references any more. Answers with the counts, or 404 when the repository was never indexed. The next request for the repository indexes it again, unless it is blocked as well.
GET /admin/v1/indexes/repositories[?limit=]Where the indexes went and what keeps them (ADR-0086), the most index entries first: per repository its address and visibility; its tier, the rank the worker gives it, listed, declared, skills, or other for a repository that is no pack; the snapshots kept of it and how many of them are held by a ref the deployment remembers, which keeps them whatever their age where the repository is a pack and not otherwise; their entries, one for each file of each commit read, which is what the largest table of the database grows by; the bytes they index; the refs remembered; and lastReadAt. Private repositories are named here, to their operator. limit is up to 500, 50 unless said.
GET /admin/v1/embeddingsThe search by meaning (ADR-0064): configured, the model, its dimensions, the scope and the reranking model, or null where it is not configured; vectors, whether the database keeps them; pending, the served snapshots within the scope the sweep has still to embed under the model, those of the ranked repositories (the worker); queues, each with queued, active, failed, total and oldestWaitSeconds, how long the oldest job ready to run has waited as of the queue's last pass; and failures, the jobs that failed for good, newest first, each with the queue, what the job carried, its priority, attempts and error. The last three are null where this process has no queue.
GET /admin/v1/embeddings/repositories[?limit=]Where the embedding went, the most bytes first: per repository its address, visibility, snapshots with an embedding and how many are completed, and the bodies, sections, bytes and tokens they took, with lastEmbeddedAt. Private repositories are named here, to their operator. limit is up to 500, 50 unless said. Empty where the search by meaning is not configured.
GET /admin/v1/embeddings/usage[?from=&to=]What was embedded per day over every account: bytes, sections and tokens, under the same from and to as the usage statistics.
POST /admin/v1/embeddings/index/<address>Asks the worker to index the address now and embed it ahead of everything else, the designated indexing of ADR-0064: /gh/<owner>/<repo>[@ref], or /local/<owner>/<name> for a pack of the deployment's directory, which is how a pack just written or changed there is read at once and not at the worker's next look. Answers 202 with the address and whether it was queued, false when the same address waits in the queue already; 400 for an address with a path; 503 where this process has no queue. The worker resolves a repository as everyone sees it: one that is not public is not indexed this way, only from its page by someone who administers it. A pack of the directory is the deployment's own to index, whoever may read it.
POST /admin/v1/embeddings/importWrites vectors computed elsewhere, for an operator who runs a model in bulk: a JSON body with the model, dimensions and sectioningVersion they were made under, which must be what the deployment embeds with, and items, up to 2,000, each the blobSha the index names a stored body by, the section index as the sectioning rules count it, or -1 for the head of a skill, the vector of its name and description as one text, its heading path, offset and length, and the vector. Answers with how many were written and how many were skipped as there already; 409 with embeddings.other_model for another key, 400 with embeddings.unknown_bodies for bodies not stored here, since a vector is reached only through an index entry, 503 where the search by meaning is not configured or the database keeps no vectors. The body may be up to 48 MiB.
GET /admin/v1/pack-tokensWhere the packs of the directory are read with a token only (PACKS_ACCESS=token, ADR-0088), the tokens that have not ended, newest first: id, the address each reads, /local/<owner>/<name> or /local for every pack, its label, createdAt, expiresAt or null, and lastUsedAt, noted every five minutes at most. Never a token. The three routes do not exist where the directory is served to everyone.
POST /admin/v1/pack-tokensMakes a token from a JSON body: the address it reads, a pack of the directory or /local for every pack; a label of up to 100 characters, whose agent holds it; and optionally expiresInDays, 1 to 366, or null or left out for a token without an end. Answers 201 with the token, shown this once, and the item as the list shows it; 400 token.not_a_pack for any other address, 400 token.invalid for anything else, 409 token.limit when the deployment holds a thousand.
DELETE /admin/v1/pack-tokens/<id>Removes a token, which ends it at once: 204, or 404 when there was none.
GET /admin/v1/showcaseThe entries the front page leads with and the organizations named beside them (ADR-0028), as GET /api/v1/showcase shows them to everyone.
PUT /admin/v1/showcase/<id>Writes the entry named <id> (a lowercase slug) from a JSON body, replacing what was there; the body is described below. Answers with the entry as the pages read it, or 400 with problems that say what is wrong.
DELETE /admin/v1/showcase/<id>Removes the entry. Its uploads stay.
GET /admin/v1/organizationsThe organizations the front page names beside the showcase, in order.
PUT /admin/v1/organizations/<id>Writes the organization named <id> (a lowercase slug) from a JSON body with its name, its url (where its mark leads) and logo, the hash of an uploaded picture, with an optional position; replaces what was there. Until the operator writes one, the pages show the organization that operates the reference deployment.
DELETE /admin/v1/organizations/<id>Removes the organization. Its upload stays.
GET /admin/v1/imagesThe pictures of addresses (ADR-0031): the address, the upload's hash or null, and the URL the pages load the picture from.
PUT /admin/v1/images/gh/<owner>/<repo>[@ref][/path]Gives the address a picture, replacing what was there, from a JSON body with exactly one of media (the hash of an upload that is a picture) and url (an https URL). The explorer's card and the page of that address, and of every address of that repository when the picture is the repository's, show it in place of what the repository's manifest declares. A URL keeps the picture's traffic off the deployment; an upload is served from it.
DELETE /admin/v1/images/gh/<owner>/<repo>[@ref][/path]Removes the picture; 404 when there was none. The repository's own picture, when it declares one, shows again.
GET /admin/v1/mediaThe uploads: hash, type, size, URL, and which entries and addresses use each.
POST /admin/v1/mediaStores the request body as an upload of the content-type sent: video/mp4, video/webm, image/avif, image/webp, image/png, image/jpeg, image/gif or application/pdf, at most 16 MiB. Answers with its sha, the SHA-256 of the bytes, and the url it is served at for everyone, /media/<sha>, immutably. The same bytes are the same upload.
DELETE /admin/v1/media/<sha>Removes an upload; 409 while an entry or the picture of an address uses it.
GET /admin/v1/legalThe deployment's own pages that have been written (ADR-0029): its terms of service and its privacy policy.
PUT /admin/v1/legal/<kind>Writes the page of <kind> (terms or privacy) from a JSON body, replacing what was there: texts by language tag, each with a title and a body in Markdown, and an optional revised date (YYYY-MM-DD). The page is then served at /terms or /privacy on the deployment's own origin, and every page links to it.
DELETE /admin/v1/legal/<kind>Removes the page. The configured URL, when there is one, is linked again.
GET /admin/v1/usage[?from=&to=]The usage statistics (architecture) of the deployment as a whole, per day: items of day, metric (connection, tool_call, skill_load, file_read, client, client_app), subject (the tool, or the REST route as rest/<route>; the name of the client app; or empty) and count. Every read of the statistics takes from and to, days as YYYY-MM-DD in UTC, both included and at most 366 apart; left out, the last thirty days.
GET /admin/v1/usage/repositories?metric=[&from=&to=&limit=]The public repositories with the highest total of one metric (connection, tool_call, skill_load, file_read, client), most first: address, with host, owner and name as the host spells them, and count. limit is up to 500, 50 unless said.
GET /admin/v1/usage/subjects?metric=[&from=&to=&limit=]The subjects of one metric (tool_call, skill_load, file_read) with the highest totals across public repositories, each with its repository as above and its subject: the most loaded skills by directory, the most read files by path, the most called tools and REST routes.
GET /admin/v1/usage/gh/<owner>/<repo>[?from=&to=]What was counted for one public repository, summed over the days: items of metric, subject and count. 404 for a repository that is unknown or not public, which read the same.

What the lists do: a verified repository carries no provenance notice on its default branch; a featured address is shown by the explorer, and while there is none the reference repository of this project is; a blocked repository answers exactly like one that does not exist. The sitemap lists the featured addresses and the verified repositories, minus anything blocked. A process sees a change made through another process within thirty seconds.

curl -X PUT -H "Authorization: Bearer $ADMIN_TOKEN" https://skills.example.com/admin/v1/repositories/blocked/gh/owner/repo
curl -X POST -H "Authorization: Bearer $ADMIN_TOKEN" https://skills.example.com/admin/v1/purge/gh/owner/repo

The same purge runs without the API, from a shell with the database configured: node dist/main.js purge /gh/owner/repo.

What the front page leads with is the showcase: a list of entries the operator writes, each a card with a result, the way to the result itself and the way to the skill it came from, in order. Until the operator writes one, the page shows the build's own showcase: real results of the reference repository's skills. Upload the media first, then write the entry that names it; a result that is a document, a deck as PDF, say, is uploaded the same way and named by the entry's link:

curl -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: image/webp" --data-binary @poster.webp https://skills.example.com/admin/v1/media
curl -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: video/mp4" --data-binary @clip.mp4 https://skills.example.com/admin/v1/media
curl -X PUT -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: application/json" --data @entry.json https://skills.example.com/admin/v1/showcase/spring-ad

An entry is a JSON document:

  • address: the skill the result was made with, any address such as /gh/owner/repo or /gh/owner/repo@main/skills/ad. The card leads to its pack: the address without its path.
  • link: where the result itself is: an https URL, or a path of the deployment such as an upload (/media/<sha>). The card leads to the address, not here; llms.txt names the result beside the entry.
  • origin: whose work the entry shows: pack, a result made with the pack at the address (the default), or builder, a builder's own case running on their site, made with that pack.
  • position: its place in the list, lowest first; 0 when left out.
  • width and height: the pixel size of the clip and its poster.
  • media: uploads by hash. poster is required, a picture of the result at 16:10; clip (a video of it), animation (the clip as an animated image, for browsers that will not play video) and social (a 1200 x 630 picture for link previews) are optional; reference and picture are kept for an entry written before the pages stopped showing the example conversation. A clip needs durationMs, one pass of it, and published, its date as YYYY-MM-DD. An upload may also be a PDF (application/pdf), which no slot takes and link points at.
  • texts: the words by language tag (en, ko), at least one language. Each has title (what was asked, in quotes, is what the cards of the build say), body (what came back) and action (the words of the way to the result, or to the address without a link), and optionally tags (up to four), requirement (what the skill needs besides the AI app), clip (what the poster or the clip shows, for whoever cannot see it), credit (what the result came from, said beside whose work it is) and demo, an example conversation the pages no longer show. A visitor is shown their language, else the default language of the pages.
  • cuts: optional, by language tag: the result cut in that language, for a result with words in it. Each cut has a link and media with any of poster, clip, animation and social, uploads by hash as above; a page in that language shows them in place of the entry's own, and what a cut leaves out is the entry's own. A clip in a cut is the same length as the entry's: durationMs and published are the entry's.
{
  "address": "/gh/owner/repo/marketing/skills/short-ad",
  "link": "https://example.com/ads/spring",
  "origin": "builder",
  "width": 1440,
  "height": 900,
  "durationMs": 9500,
  "published": "2026-10-01",
  "media": { "poster": "<sha of poster.webp>", "clip": "<sha of clip.mp4>" },
  "cuts": {
    "ko": {
      "link": "https://example.com/ads/spring-ko",
      "media": { "poster": "<sha of poster-ko.webp>", "clip": "<sha of clip-ko.mp4>" }
    }
  },
  "texts": {
    "en": {
      "title": "“Make a 15-second ad for this product”",
      "body": "A product picture went in; a vertical ad with captions came back.",
      "tags": ["15 seconds", "Captions"],
      "action": "Watch the ad",
      "credit": "Example Co. · marketing"
    }
  }
}

The organizations named beside the showcase are written the same way, each with an uploaded picture as its mark:

curl -X POST -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: image/png" --data-binary @mark.png https://skills.example.com/admin/v1/media
curl -X PUT -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: application/json" --data '{"name":"Example Co.","url":"https://example.com","logo":"<sha of mark.png>"}' https://skills.example.com/admin/v1/organizations/example

A repository declares its own picture in its manifest (format). To show another one on a repository's card and page, give its address a picture: an https URL, or an upload from POST /admin/v1/media.

curl -X PUT -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: application/json" --data '{"url":"https://example.com/pictures/skills.png"}' https://skills.example.com/admin/v1/images/gh/owner/repo
curl -X PUT -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: application/json" --data '{"media":"<sha of banner.webp>"}' https://skills.example.com/admin/v1/images/gh/owner/repo@main/skills/ad

The deployment's own pages take the same shape in miniature. Writing them here keeps their URLs on your own origin, /terms and /privacy, which is what the head, the footer and the consent banner then link to; TERMS_URL and PRIVACY_URL are for pages hosted elsewhere. A visitor reads their language, else the default language of the pages.

curl -X PUT -H "Authorization: Bearer $ADMIN_TOKEN" -H "content-type: application/json" --data @terms.json https://skills.example.com/admin/v1/legal/terms
{
  "revised": "2026-10-01",
  "texts": {
    "en": { "title": "Terms of service", "body": "## Scope\n\nThese terms govern ..." },
    "ko": { "title": "이용약관", "body": "## 적용 범위\n\n이 약관은 ..." }
  }
}

Signing in and private repositories

Without the variables below a deployment serves public repositories to everyone and knows nobody. With them, people sign in with their GitHub account, open the private repositories GitHub lets them see, and connect their AI apps to them (specs/permissions.md). It needs the web UI (WEB_ROOT, which the image sets) and PUBLIC_URL, over TLS for anything but local development.

Register a GitHub App (not an OAuth app) under the account that operates the deployment:

SettingValue
Homepage URLPUBLIC_URL
Callback URLPUBLIC_URL/auth/gh/callback
Expire user authorization tokensOn. The server renews them.
Request user authorization (OAuth) during installationOff. People sign in from the deployment's own pages; an authorization that starts at GitHub is not one this server asked for and is refused.
Setup URLPUBLIC_URL/account/repositories, with "Redirect on update" on, so that whoever installs the app comes back to the page that lists what they can now open.
WebhookActive, with the URL PUBLIC_URL/webhooks/gh and a secret of your making (openssl rand -base64 48), which is also GITHUB_APP_WEBHOOK_SECRET. Not active: the server receives nothing, and everything it remembers ends when its time is up.
Subscribe to eventsPush and Repository. What the app is told about installations and revoked authorizations comes without subscribing.
Repository permissionsContents: read-only. Metadata: read-only. Nothing else, and no account permissions.
Organization permissionsNone: reading needs no more, and an app should hold nothing it can do without. A change of collaborators, teams or members then takes effect within PERMISSION_TTL_SECONDS. An operator who wants it at once adds Members: read-only, with the events Member, Membership, Team, Team add and Organization, and has to decide that before accounts install the app: a permission added later has to be accepted again by every account that installed it, and does not apply to an installation until it is.
Where can this GitHub App be installed?Any account for a deployment open to others; only this account for a private one.

Then set GITHUB_APP_ID and GITHUB_APP_CLIENT_ID from the app's page, generate a client secret for GITHUB_APP_CLIENT_SECRET and a private key for GITHUB_APP_PRIVATE_KEY, and make up AUTH_SECRET (openssl rand -base64 48). On GitHub Enterprise Server, GITHUB_API_URL names the installation and the app is registered there.

What then happens, and what to know when operating it:

  • A person signs in from the deployment's own pages, and every time GitHub shows its account picker first, so that they see which account they continue with before they are back (ADR-0042). Nothing is configured for it.
  • An owner installs the app on the repositories it may read. A person signs in, and the server asks GitHub, as that person, whether they can see a repository; content is read with the app's installation token, never with a person's. A private repository without the app installed is not found, for its members too.
  • The person's GitHub token is stored encrypted under AUTH_SECRET and used for nothing but asking. Sessions, authorization codes and the tokens of AI apps are stored as hashes. AUTH_SECRET is the one value to guard: keep it with your other secrets, the same on every replica.
  • PERMISSION_TTL_SECONDS is the staleness bound for whatever the git host does not announce. With the webhook active, a push is served by the next request, or indexed by the worker with nobody asking (the worker), a repository made private or deleted closes at once, a person who revokes the app is signed out, and taking the app off a repository that is not public removes what was indexed of it. GitHub does not send a failed delivery again by itself: the lifetimes cover a delivery that never arrived, and an operator can send one again from the app's settings for a few days.
  • A delivery only ever ends what is remembered, so the receiver needs no protection beyond the signature: an unsigned request is refused after one hash over at most 4 MiB, and a signed one that is sent twice makes the server ask GitHub again.
  • The deployment is the OAuth authorization server of its own addresses: /.well-known/oauth-authorization-server/oauth, /.well-known/oauth-protected-resource/..., /oauth/* and /auth/* have to reach the server, like /gh/*. Serve nothing of your own at /.well-known/oauth-authorization-server, /.well-known/openid-configuration or /.well-known/oauth-protected-resource: the server leaves them empty on purpose, so that a public address looks to every client like one that needs no sign-in. AI apps register themselves; a registration grants nothing until a person agrees on the consent page. POST /oauth/register is the one place where anyone can write a row: the server keeps the number of unused clients bounded and removes them after a week, and limiting how fast one client can ask is for what you put in front, as for every other anonymous endpoint.
  • A person can make a token for an agent that has nobody to sign in: a scheduled job, a server (ADR-0040). It reads one repository, as that person, until it expires or they remove it, and it is checked against GitHub like every other request of theirs. Nothing is configured for it. A proxy in front has to pass the authorization header of such an agent through, as it does for an app that signed in.
  • To read an app's metadata document the server makes one kind of request to a URL somebody else chose: over TLS, to public addresses only. An installation without outbound internet access still works with the apps that register themselves instead.
  • A process removes expired sessions, codes, tokens and stale answers on its own, every quarter of an hour; nothing has to be scheduled.

Operating a public deployment

Everything above suits a private installation as it comes. A deployment that serves other people's repositories to the public has more to say and to answer for. Before opening one up:

  • Set PUBLIC_URL to the origin visitors use, so that canonical links and the sitemap are yours.
  • Publish terms of service and a privacy policy: write them into the deployment through the admin API, which serves them at /terms and /privacy in every language you write them in, or host them elsewhere and set TERMS_URL and PRIVACY_URL. Set CONTACT_EMAIL to an address that reads takedown requests and content reports. The pages show all three in the footer and carry them in the head. Where people sign in, the button they sign in with says under it that continuing agrees to the terms and the privacy policy, each where you have one, so have them in place before you let people in: the first sign-in is what makes an account.
  • Know what the service does with content, and say it where your visitors can read it: it reads, indexes and serves what a repository publishes, keeps copies only to serve them, and serves or describes a skill by the license it carries (format). A takedown is one entry on the blocked list and one purge through the admin API; keep ADMIN_TOKEN where only the operator can reach it.
  • Decide what you vouch for. A verified repository is served in full on its default branch whatever its license says, and carries no provenance notice: put only repositories there whose owners agreed.
  • Analytics ask first where the visitor's region asks, and run elsewhere with the footer offering to turn them off (ADR-0051); name the header your proxy or CDN sets with the visitor's country in CLIENT_COUNTRY_HEADER, or every visitor is asked. Say in your privacy policy what GOOGLE_ANALYTICS_ID sends where, that analytics run unless the visitor is asked first or turns them off in the footer, and that a browser signaling Global Privacy Control is left alone; or leave it unset. What the pages send names no repository that is not public and nothing a visitor typed (ADR-0050), and the property is set up to match, once (below). The banner asks for analytics and nothing else: advertising would be a consent of its own.
  • The access log (ACCESS_LOG) holds client addresses. Give it a retention that your privacy policy states, or turn it off. The usage statistics hold none: set USAGE_HASH_SECRET so that distinct clients count once across replicas, and keep it with your other secrets (ADR-0027).
  • Put TLS, caching and rate limiting in front of the image (below), and a token without scopes in GITHUB_TOKEN so that the anonymous rate limit of the git host is not what your visitors get. The page of an account lists from the git host on behalf of whoever opens it, search engines included, which is one more reason for the token.
  • Leave INDEX_AHEAD at listed, and list the repositories that are to be fresh before anyone asks: under packs the deployment would go on asking the git host about every pack anyone ever asked it for (the worker).
  • Crawlers and link previews that say what they are in their User-Agent index nothing: they are shown what is indexed already, and a repository nobody has opened is not even asked of the git host for them (ADR-0074); the REST API answers them the same way, for a crawler that runs the pages' script, and refuses what it holds no index of with 403 mount.not_read (ADR-0144). So what the deployment indexes is what people and agents opened, and what you list; and what it keeps of a repository that is no pack is what was read within INDEX_RETENTION_DAYS, which GET /admin/v1/indexes/repositories shows by repository (ADR-0145). A known limitation follows: a link to a repository nobody has opened yet unfurls in a chat with the site's own card, and with the repository's once someone has opened it.
  • Where the search by meaning is on (EMBEDDINGS_URL), the text of every document embedded leaves the image for the embedding server you run, and a query does too (ADR-0064, ADR-0065): say in your privacy policy where that server runs and that the text goes no further. EMBEDDINGS_SCOPE=public keeps private repositories out of it; all sends their text too, so set it only where the server is yours and the people whose repositories they are know. A repository keeps its documents out with search: { meaning: false } in its manifest.
  • Where people sign in (above), say in your privacy policy what is kept about them: their account's id, name and login at the git host, the encrypted token, their sessions, which apps they allowed to read which address, and the tokens they made for their agents, as hashes. Signing out ends a session; removing an app ends its access; when GitHub stops vouching for a person, everything of theirs is deleted.

Listing an address in an app directory

Claude and ChatGPT each keep a directory from which people add an MCP server to the app, and check a server before they list it. What they check of the server itself needs nothing from you: every tool carries a title and states its hints (tools), a public address asks for no sign-in, and a wrong input is answered with what to do next. Both ask for a privacy policy, which is the one of a public deployment. Two more things are the operator's:

  • Proof of the hostname. ChatGPT's directory gives whoever submits an address a token, and reads it back as plain text from https://<host>/.well-known/openai-apps-challenge. Set OPENAI_APPS_CHALLENGE to the token and restart the api; where a proxy in front routes by path, the path has to reach the server, like /gh/*. The answer is the token and nothing else, and says no-store. The path belongs to the hostname, not to an address, and holds one token: the directory says to give a second listing another hostname or a parent domain, and not to replace a token that is in use. The server knows one token and answers it at whatever hostname it is reached by, so the token of a second listing is answered in front of it. Whoever lists a pack on a deployment they do not operate cannot prove its hostname.
  • Being reachable. A directory, and an app that runs at its maker's, calls from the maker's network and not from the person's. A firewall, a bot rule or a rate limit in front that answers it 403 or 429 looks to the person like a server that cannot be connected: let the ranges the makers publish through, or keep such rules off the paths of addresses.

The analytics property

With GOOGLE_ANALYTICS_ID set, the pages send their own page views and the events of one funnel, naming only what is public (ADR-0050; the events and their parameters are listed in the web UI's README), and a visitor is asked first only where their region asks (ADR-0051). The property has to be set up to match, once:

  1. Enhanced measurement. Turn off Page changes based on browser history events: the pages count their own page changes, and with it on every page is counted twice, the second time with the raw URL and title. Turn off Site search: it reads the search term out of the URL. The rest (scrolls, outbound clicks, file downloads, video, forms) may stay on.
  2. Custom dimensions, event-scoped, one per parameter the pages send: view, visibility, outcome, skill, site_language, kind, id, client, method, from, approved. Without them the parameters arrive but cannot be reported on.
  3. Key events. Mark connect_start, login, token_create and app_consent as key events: they are the funnel's conversions.
  4. No advertising. Leave Google signals and ads personalization off, and link no advertising account: the consent the pages ask for is for analytics only, and the consent mode denies advertising storage everywhere. Advertising would be a consent of its own, with new words in the banner.
  5. Data retention and the privacy policy. Choose the retention your privacy policy states, and say in it what is sent: page views as public addresses or stand-ins, the events, and nothing a visitor typed; that visitors in the regions that ask are asked first; that elsewhere analytics run until turned off in the footer's cookie settings; and that a browser signaling Global Privacy Control is left alone.
  6. Check it. In the property's DebugView, from a browser with the debugging extension: the page_location of a page_view is the address of a public repository or /gh/-/-, never a private name; /oauth/consent arrives without its query and /connect/<code> as /connect; a search arrives as the address with view set to search and no term; the connection guide's install and copy actions send connect_start; and a visitor placed outside the regions that ask sees no banner and sends from the first page.

A UI with pages of your own

The image's web UI is the product's pages. An installation that needs screens of its own, for its operator or for its people, builds the same pages with those among them and serves that build instead (ADR-0099, the web workspace); nothing of the server changes, and no fork is kept.

  1. Write the pages in a directory of your own: a configuration file that names each page, its address under /pages/, its word in the menu and what it shows, with the page's components and style sheets beside it. A page is given the REST client of the deployment, the language and the way to move between pages.
  2. Build with the published pages of the release your image is (ADR-0101): in that directory, npm install @skillcdn/web@<release> vite @vitejs/plugin-react (Node.js 24), then npx skillcdn-web build --config site.config.tsx --out web. The output is web; the directory is emptied first. A checkout of this repository at the release builds the same: SKILLCDN_WEB_CONFIG=/path/to/site.config.tsx pnpm --filter @skillcdn/web run build, into apps/web/dist.
  3. Serve it: copy the output over /app/web in an image made FROM the release's, or mount it there, or point WEB_ROOT at where it is. The server reads a build once, when it starts.
  • A page is yours, and so is what it does. It is drawn in the browser, is never listed for a search engine, and is as public as the deployment: there is no sign-in in front of /pages/. A screen for an operator asks for what it needs, the admin token for one, and shows nothing without it; keep it off the public internet with the admin API it calls.
  • A page reaches the deployment's own origin and nothing else, by the content security policy of every page. A service you run beside the deployment is reached where your reverse proxy puts it under the same origin, a path of its own that the server does not answer.
  • A build is of one release. The pages and the server change together: build again with the package of the release you move to. The version of routes.json is what the server checks. The documentation the pages show is that release's, carried in the package.
  • The marks stay as the pages show them. A build made with the package may show the SkillCDN name and logos where the pages do, as the UI of your deployment; they remain KDX Labs' marks, and your own pages may not use them for anything of yours (trademark policy).

Behind a reverse proxy

The api role speaks plain HTTP and expects TLS, caching and per-client rate limiting to happen in front of it. What the server needs to know about that front:

  • Who the proxies are. List their addresses or networks in TRUSTED_PROXIES. Forwarding headers are believed only when the peer on the socket is on that list; from anyone else they are ignored, because anyone can send them. With x-forwarded-for the client is the nearest address in the chain that is not a trusted proxy. If your proxy passes the client address in a header of its own, name it in CLIENT_IP_HEADER; it is then read as a single address. Make sure the proxy overwrites that header instead of passing on what the client sent.
  • Request ids. A trusted proxy's id (REQUEST_ID_HEADER) is adopted; otherwise the server makes one. Either way it is in every log line of the request and in the x-request-id response header, so a report from a user can be matched to the logs.
  • Where visitors are. If your proxy or CDN adds a header with the visitor's country, name it in CLIENT_COUNTRY_HEADER: it decides whether a page asks before analytics run (ADR-0051), and is read only from trusted proxies, like the address. Make sure the proxy overwrites it rather than passing on what the client sent; a visitor it could not place, or sent no header for, is asked.
  • Idle connections. Keep HTTP_KEEP_ALIVE_SECONDS above the idle timeout of the proxy. When the server closes an idle connection first, the proxy occasionally sends a request into it and answers its client with a gateway error.
  • Slow answers. A tool call may wait up to INDEX_WAIT_MS for an index. The proxy's response timeout has to be longer than that.
  • Streaming. MCP responses may be event streams. Do not buffer or transform text/event-stream responses.
  • Cross-origin calls. The REST API under /api/ and the MCP endpoint under /gh/ answer browsers on any origin by themselves: pass OPTIONS requests and access-control-* headers through.
  • Events. Where the app's webhook is active, POST /webhooks/gh has to reach the server from the git host, with bodies of up to 4 MiB and without anything in front asking for a credential: the server verifies the host's signature itself, over the body exactly as it arrived, so nothing in front may rewrite it.
  • Credentials. Where people sign in, pass cookie, set-cookie, authorization and www-authenticate through untouched, and never cache a response that says private or no-store: the page and the answers of a private repository are one person's. Pass the browser's sec-fetch-site request header through as it came, too: by it the server tells a sign-in begun on its own pages from a link that was followed from somewhere else, which it only offers to sign in (ADR-0041). A /gh/... path answers differently with and without a session, which the response says with its own cache headers rather than with Vary; a cache must revalidate, as the page asks.
  • Pages. With a web UI, set PUBLIC_URL. A page URL with the lang query parameter, and every file, has exactly one representation and may be cached by URL, query string included. A page URL without the parameter is answered in the language the request's Accept-Language asks for, else the default, and says vary: accept-language (ADR-0021): a cache that ignores Vary must not cache it. HTML asks to be revalidated; files under /assets/ never change. Every file answers byte ranges (Accept-Ranges: bytes), which video playback on phones depends on: a cache in front passes Range through, or serves whole files itself. On an address (/gh/...) the response depends on the request: a GET that accepts text/html gets a page rendered with what the address serves, everything else is MCP. The page says vary: accept, and accept-language as well without the parameter, and asks to be revalidated; MCP responses say no-store. A cache that honors both may cache the path; one that ignores Vary must not.
  • Probes. GET /healthz and GET /readyz are not written to the access log.

The access log is one JSON line per request: request id, method, path without its query string, status, duration until the response started, client address and user agent.

Building a release

The release workflow publishes the image of each release, ghcr.io/skillcdn/skillcdn:<version> and latest, built from the commit the packages of that version were published from, for linux/amd64 and linux/arm64, with the build's provenance and a list of what it contains attached (ADR-0087); docker buildx imagetools inspect shows both. Should the image job of a release fail after the packages are published, nothing has to be done by hand: the next push to main builds the image from the commit of the release, and a version the registry has is never built again (ADR-0116). A deployment that follows main between releases, or keeps its images in a registry of its own, builds the image itself:

  1. Pin a commit of this repository, preferably one whose CI run is green. main is kept releasable, so any green commit is a candidate.
  2. Build deploy/Dockerfile from the repository root for the platforms you run (docker buildx build --platform linux/arm64 -f deploy/Dockerfile .). The build needs no secrets and no arguments. The server of the image says what it was built from (SERVER_VERSION): the version of the packages in the tree with the commit, as 1.2.3+abc1234 (ADR-0134). The build reads the commit from the head of the checkout it is given, .git/HEAD and the branch it names, which with packed-refs are all of .git that .dockerignore lets through. From a build context without them, such as an archive or a worktree, the server says 1.2.3+source, and the commit says nothing of changes that were not committed. The build argument VERSION names a version instead, which is how the workflow names the release; one that is no version fails the build.
  3. Tag the image with the commit it was built from, keep tags immutable in your registry, and deploy by digest.

The image carries what it is distributed under at /app: LICENSE.md, THIRD-PARTY-NOTICES.md and TRADEMARKS.md; the web build carries the licenses of its bundled packages at /licenses/npm.txt, linked from every page, and the notices of its fonts and icons next to it.

Rollout contract

Whatever rolls the image out must do this, in this order:

  1. Run the new image with the migrate command to completion. A non-zero exit aborts the rollout. It brings the database's schema and the job queue's up to this build. An index of a large table is built while the old version keeps writing to it, which takes as long as reading the table twice; a run that is cut short is finished by the next one.
  2. Roll api and worker to the new image. Old and new versions overlap, which is why migrations are backward compatible (see the rules in packages/db/README.md).
  3. Gate traffic on GET /readyz, restart on GET /healthz failures, and send SIGTERM with a grace period before killing.
  4. Roll back by redeploying the previous digest. Because migrations only expand, the previous version keeps working.

api is stateless and scales horizontally behind any load balancer without session affinity; indexing in flight is handed back to the database on shutdown, so a replica may be stopped at any moment. So may a worker: its running jobs go back to the queue, and the next worker takes them.

Repository settings checklist

Set once in GitHub; none of it can be expressed in files here.

  • Branch protection on main is intentionally off for now: maintainers push directly. When the team moves to pull requests, require them together with the CI checks and a linear history.
  • Enable secret scanning with push protection, Dependabot alerts and private vulnerability reporting.
  • Actions: default GITHUB_TOKEN permission read-only; require approval before running workflows from first-time contributors. Allow GitHub Actions to create and approve pull requests (Actions > General): the release workflow opens its version pull request with that.
  • On npm, each package under the @skillcdn scope has this repository registered as its trusted publisher, and then requires two-factor authentication with tokens disallowed. The publisher is GitHub Actions with organization skillcdn, repository skillcdn, workflow filename release.yml (the file name alone, not its path) and no environment name, and its allowed actions include publish. The four fields must match the run exactly: otherwise the registry answers the publish with 404 Not Found. Without the publish action it answers 403 OIDC permission denied for this action, since only staged publishes are allowed by default. Either way the Publish job fails within a second and nothing is published, so the run can be repeated once the publisher is right. A registration is pending until the workflow publishes through it once, and expires after two days unused: a package that saw no release in that time needs it registered again before its next one. The publisher can be registered only for a package the registry has, so a maintainer first publishes a new package by hand as a placeholder 0.0.0 that holds the name and nothing else: a package.json with the name, the license and the repository, a README.md that says to install a later version, and LICENSE.md, published with npm publish --access public from a directory outside the checkout. Every version with content is the workflow's (ADR-0102).
  • The container package skillcdn of this repository, which the release workflow pushes the image to with the token of its own job: after the first release that publishes it, set its visibility to public and leave this repository as the one with write access to it (Package settings > Manage Actions access). Until it is public, docker pull asks for a sign-in and install.sh without --build fails at the pull.
  • No cloud credentials, environments or deployment secrets belong to this repository. If a workflow here ever asks for one, that is a mistake.

Rules

For whoever changes deploy/ or .github/: read the root AGENTS.md first.

  • This repository ends at an image that builds, and at the image of a release given to everyone. A deployment's registries, deployment pipelines, infrastructure definitions, DNS, CDN, TLS, environment-specific values and rollout automation do not belong here (ADR-0008). Do not add Terraform, CDK, CloudFormation, Kubernetes manifests, a login to any registry but the repository's own, or real hostnames.
  • No identifiers and no cloud credentials. No workflow here logs in to a cloud account, and none holds a secret. The one workflow that publishes anything is release.yml: the npm packages through the registry's trusted publishing, a short-lived identity the job proves and no stored token (ADR-0046), and the image of the release to the container registry of this repository's own host, with the token of its job (ADR-0087). Account ids, role ARNs, a deployment's registry hosts, bucket names and domains have no place in this repository, not even as GitHub variables.
  • One image. Do not add a second Dockerfile or per-role images without an ADR. Roles are container commands.
  • Image hygiene: non-root user, production dependencies only, no secrets in ARG or ENV (use BuildKit secret mounts if a build ever needs one), nothing copied that .dockerignore should exclude. When you add a file type that must ship (for example migrations), check the package's files field.
  • Workflows: pin every action to a full commit hash with the version in a comment, declare minimal permissions, never use pull_request_target, never echo secrets, and pass untrusted values (branch names, PR titles) through env, not inline in run.
  • CI needs no secrets, so it is safe on pull requests from forks. Keep it that way.
  • Compose files are for development and self-hosting. Bind ports to 127.0.0.1; label throwaway credentials as such.
  • The scripts take no secret and print none. install.sh makes the secrets an installation needs and writes them to its settings file; bundle.sh puts no settings and no secret into a bundle, and refuses a .env among what its maker adds (ADR-0115). A script that travels to a host without internet runs on what that host has: bash, docker and coreutils, nothing fetched.
  • Verify what you change. Build the image and run the smoke test locally (docker build -f deploy/Dockerfile .), and bring compose changes up and down once. A workflow edit you could not run must say so in the commit message.
  • Keep deploy/README.md in step: the environment table, how to build a release and the rollout contract are read by whoever operates the service.

Gotchas

  • .dockerignore drops every *.md except the root README.md, the three notices and the files docs/nav.json publishes. A Markdown file the image must carry has to be re-included there, or the build fails only in the image job of CI: pnpm check never builds the image. A file listed in docs/nav.json is covered by a test of the web app (apps/web/dev/docs.test.ts), which reads the rules as the build does; for anything else, build the image locally before pushing a Dockerfile or .dockerignore change.
  • A .git in the tree the image is built in breaks the build of the pages, which takes a tree with .git for a whole checkout: every link of the documentation to a file .dockerignore left out is then a dead link, and the build fails on it. .dockerignore lets three things of .git into the build context, for the commit the server says (ADR-0134); the Dockerfile takes them out of the tree right after the copy and reads them from the context in its last build step. Anything more of .git that is ever let through has to stay out of the tree the same way.
  • The image job of CI asks the running image for pages by path and checks what comes back. A change to what a path answers breaks it without touching this directory, and pnpm check never runs it: when one segment short of an address became the page of an account, the job's "not an address" was that path. After changing what a path answers, read the job's steps and replay them against a local build before pushing: a throwaway database in the compose PostgreSQL, migrate and api on the compose network with a published port, and the same requests.