Skip to content

Reference

The commands, the endpoints, the error codes and the files.

CLI

Everything is diffuse-coordinator <noun> <verb>, and every noun removes with rm.

Setup

init --org "<name>"create the deployment and its authority
licence set <file>install a licence, verifying it first
licence showentitlement, and until when

Machines

token create --pool <p> --max-uses <n> --ttl <d>a join token
nodes / nodes --widethe pool; --wide adds the reason a slice failed
node revoke <id>refuse an identity from now on

On the machine itself: diffuse-node-agent enroll --token DFE1-...

Models

model list --availablethe catalogue, from the binary, no network
model pull <alias or owner/repo>fetch
model import --from <path>take a file you already have
model run <alias>pull, then serve
model serve <key> or <key>+<adapter>place it
model listwhat is here, with provenance
model rm <key>remove
deployment list / deployment rm <id>what is placed, and stop it

Training

finetune <model> <corpus.jsonl>import, choose, start
job watch <id>follow to the end, then what to do next
job list / job get <id> / job cancel <id>
adapter list / adapter export <key> --out <path> / adapter rm <key>
distill --teacher <t> --student <s> <corpus.jsonl>both stages
eval <suite> --model <model>+<adapter>score both sides
dataset import --from <file> --classification <word>

Access

apikey create --name <n> [--expires <d>] [--scope-models <list>]
apikey list / apikey revoke <handle>
login / logout / whoami / password
account create --login <l> --role <r> / account disable <l>
sessionswho is signed in, from where
audit --limit <n> [--actor <a>] [--since <d>] [--output json]

Every command takes --output json. --endpoint, --ca-cert, --cert and --key override the configuration file for a single invocation.

API

Base https://<host>:8443/v1, bearer token, OpenAI-compatible.

POST /chat/completionsstreaming with "stream": true
POST /completions
GET /modelsthe names requests must use
POST /filesa document, returns extracted text

The name in "model" is what GET /models lists. A deployment serving an adapter answers as <model>-<adapter> and not under the base name.

Error codes

HTTPcodeMeans
400invalid_request_errorthe request is malformed; the message says which field
401invalid_api_keyno key, or a key that is not recognised
403insufficient_scopea valid key, outside its scope. Re-sending will not help
404model_not_foundnothing of that name is served. GET /v1/models lists what is
413context_length_exceededthe prompt is longer than the deployment's context
429rate_limit_exceededthis key's limit. Retry-After says when
503node_unavailablea machine holding a slice could not load or has gone. The message names it
503no_capacityevery slot is busy. Not a fault
500server_errora fault on our side, with what was reported

A 503 naming a node is the same sentence an operator sees under nodes --wide. That is on purpose: when a developer forwards the error, the operator recognises it.

Files

Path
/etc/diffuse/coordinator.tomlendpoint, ports, state directory, pool defaults
/etc/diffuse/agent.tomlthe coordinator's address, and this machine's label
/etc/diffuse/api.envwhere the API finds the coordinator, and its limits
/etc/diffuse/ca.crtthe deployment CA, world-readable, for developers
/var/lib/diffuse-coordinatorthe deployment. Back this up
/var/lib/diffuse-node-agentthis machine's identity and its slices
/var/lib/diffuse-modelsdrop a model here to import it
/var/lib/diffuse/datasetsdrop a corpus here; an example and a README are already in it

Exit codes

0 success. 1 a refusal you can act on, with the reason on stderr. 2 the command was wrong, with usage. 77 a configuration error, which systemd is told not to restart, because looping on a bad configuration file hides it.

Diffuse Enterprise is commercial software. Diffuse Open is AGPL-3.0.