Skip to content

Local inference API

GET /api/v1/admin/local-inference · operation getLocalInference

T203 (local_inference): the pools of self-hosted model server replicas, the five flags, what this gateway may start (the boot settings of the gateway YAML, with executable paths left out) and the state of every replica on the gateway process that answers. Replica state is process memory: each gateway replica probes and supervises on its own, and nothing here is stored. Requires local_inference and local_inference:read (global admin, viewer and operator).

Authentication: adminSession

Responses

Status Description Body
200 Pools and replica state application/json: LocalInferenceView
401 Missing or invalid bearer key application/json: Error
403 Model not allowed application/json: Error
404 Feature disabled application/json: Error

PUT /api/v1/admin/local-inference · operation setLocalInferencePools

Store the pool list as a versioned, audited override that replaces the list of the gateway YAML on every gateway replica. Requires local_inference:manage (global admin). The list is validated against the boot settings, which this route cannot change: a supervised pool needs local_inference.supervise and its runtime, its weights must be inside local_inference.model_dirs and its image one of local_inference.container_images. extra_args and api_key_env are YAML-only decisions: they are accepted only unchanged, for a pool the YAML declares with the same backend, mode, weights, image and endpoints. One alias belongs to one pool. A replica may not take the ID of an existing provider connection. With gitops.source_of_truth file and pools declared in the YAML the route answers 409 source_of_truth_file. A change to how a replica is started replaces it after its requests in flight; any other change applies in place. Replicas of a changed pool are replaced. Body limit 256 KiB.

Authentication: adminSession

Parameters

Name In Type Description
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Request body (required)

  • application/json: object
    • version (integer (int64), required)
    • pools (array of LocalInferencePool, required, max items 16)

Responses

Status Description Body
200 Saved; the new view application/json: LocalInferenceView
400 Invalid input application/json: Error
403 Model not allowed application/json: Error
404 Feature disabled application/json: Error
409 Configuration version conflict —
422 Invalid pool list (invalid_local_inference); the message names the pool and the field —
503 Control storage unavailable —

DELETE /api/v1/admin/local-inference · operation revertLocalInferencePools

Remove the stored pool list and return to the pools the gateway YAML declares. Requires local_inference:manage.

Authentication: adminSession

Parameters

Name In Type Description
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Request body (required)

  • application/json: object
    • version (integer (int64), required)

Responses

Status Description Body
200 Reverted; the new view application/json: LocalInferenceView
400 Invalid input application/json: Error
403 Model not allowed application/json: Error
404 Feature disabled, or no stored pool list to remove (local_inference_override_not_found) —
409 Configuration version conflict —

POST /api/v1/admin/local-inference/pools/{id}/replicas/{replica}/{action}

Section titled “POST /api/v1/admin/local-inference/pools/{id}/replicas/{replica}/{action}”

POST /api/v1/admin/local-inference/pools/{id}/replicas/{replica}/{action} · operation actOnLocalInferenceReplica

Start, stop or restart one replica on the gateway process that answers. Requires local_inference:operate (global admin and operator). The action is accepted and applied by the supervisor; read the replica’s state from GET /api/v1/admin/local-inference. It is not stored: a gateway restart starts every replica again. A registered replica has no process here: stop and start take it out of and back into routing, and restart is refused.

Authentication: adminSession

Parameters

Name In Type Description
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.
id path string, required, pattern ^[a-z][a-z0-9-]{0,39}$ Pool ID
replica path integer, required, min 1, max 16 Replica number, from 1
action path string, required, one of "start", "stop", "restart" stop takes the replica out of routing, waits for its requests in flight up to stop_grace and ends its process; start brings it back and clears a failed state; restart replaces the process of a supervised replica

Request body (required)

  • application/json: object

Responses

Status Description Body
202 Accepted application/json: object
400 Invalid input application/json: Error
403 Model not allowed application/json: Error
404 Feature disabled, or no such replica or action —
409 restart of a registered replica (replica_not_supervised) —

Response 202 fields:

  • application/json: object
    • pool (string, required)
    • replica (string, required) — The replica’s connection ID, <pool>-r<n>
    • action (string, required, one of "start", "stop", "restart")
    • scope ("process", required)

m7gtwcontact@m7gtw.com