The configuration assistant
The configuration assistant turns a request in plain words ("poll the ERP every 30 seconds instead of 5", "use the new version of this Node Type") into a change to the draft. It does not write the whole config and it does not decide anything. A model proposes a short list of edits; the appliance applies them to a copy of the draft, runs the same checks a stage runs, and shows you the result. Nothing is saved until you say so, and nothing is staged until you say so again.
It is off until the site gives the management service an inference endpoint of its own. It calls that endpoint and no other address, so a plant with no route to the internet can use it, and a plant that wants no model on its network simply never turns it on.
What it never does
- The model never sees a credential. The draft the model is shown has every credential that is set replaced by
[redacted]. A credential is set only through the credential field of the configuration page, or the draft's own route; the assistant has no way to set, change, add or remove one. A change that tries is refused, and the value it tried is not handed back to the model or shown to you. - It refuses a request that holds a credential the draft already has. The request is checked on the appliance before anything is sent. The answer says so, nothing was sent to the model, and the page empties the request box. A credential the draft does not hold yet cannot be recognised, so do not type one into a request: credentials go in the credential field.
- It never saves or stages on its own. A request saves the change only when it says
apply: "draft"and stages it only when it saysapply: "stage", and then only through the draft routes' own logic: a save is a save of the whole document at the revision you name, and a stage is a stage (it never changes the staged file's name, and it is refused while a place of a starting point is open). A change that does not pass the checks is never applied. - It never restarts the Node, and it keeps no history, library or copy of anything. The repository is where configs, history and templates live, and the appliance still never commits or pushes.
- It writes no prompt and no reply to the Activity Log. An entry records who asked, the outcome and counts.
Turning it on
The assistant is configured in the management service's own environment (.env beside the other
MANAGEMENT_* settings). These are not the Node's settings: the Node never reads them.
| Setting | Meaning | Default |
|---|---|---|
MANAGEMENT_INFERENCE_ENDPOINT |
The site's own OpenAI-compatible chat completions server, http:// or https://, with no name, password or query in it |
unset (off) |
MANAGEMENT_INFERENCE_MODEL |
The model the server serves, named exactly as it lists it | unset |
MANAGEMENT_INFERENCE_CONTEXT_WINDOW_TOKENS |
The context window the server runs the model at (what it is set to, not what the model could do) | unset |
MANAGEMENT_INFERENCE_RESERVED_OUTPUT_TOKENS |
The most tokens the model may answer with; sent as the hard cap on its answer | unset |
MANAGEMENT_INFERENCE_TOKEN_FILE |
The path of a file holding the bearer token the model server needs (sent as Authorization: Bearer ...), for a server behind an authenticating gateway. One token on one line, a regular file only its owner can read (mode 0600). Only the path is in .env; the file is read for each request, so a changed token needs no restart |
unset (no header is sent) |
MANAGEMENT_INFERENCE_REASONING_EFFORT |
Sent as reasoning_effort when set; none on a server whose model loops while it thinks |
unset (not sent) |
MANAGEMENT_INFERENCE_TIMEOUT_SECONDS |
How long one call to the model may take | 120 |
MANAGEMENT_INFERENCE_MAX_ATTEMPTS |
How many times the model may be asked for one request | 3 |
MANAGEMENT_INFERENCE_TEMPERATURES, MANAGEMENT_INFERENCE_TOP_P |
The retry schedule, comma-separated: attempt n uses the nth value, the last one after that | 0.1,0.4,0.7 and 0.9,0.95,1.0 |
MANAGEMENT_INFERENCE_CHARS_PER_TOKEN, MANAGEMENT_INFERENCE_SAFETY_MARGIN |
How the prompt is sized to the window (the same estimate the Node's own model calls use) | 3.5 and 0.9 |
Rules for the settings
- The first four go together. Set all of them or none, or the service refuses to start and names the one that is missing.
- A value that cannot work stops the service at start. Examples are a non-positive timeout, an endpoint with a password in it, and a window too small to hold the instructions. The message does not repeat the value.
- An endpoint with a name or password is refused on purpose, so a credential is never in a URL, a log or
.env. A server that needs one is given its token throughMANAGEMENT_INFERENCE_TOKEN_FILE. - The token is the assistant's own credential for its model server. It is held to the same rules as a credential in the draft: it is never in a prompt, a log line, an Activity Log entry or an answer, and a request or a change that carries it is refused.
- A bad token file answers
503before the model is asked. That means a file that is missing, readable by others, empty, or not one plain token. - Send the token over
https://. With anhttp://endpoint it crosses the network in clear, anddeployment/doctor.shwarns.
Installing them. deployment/install_management_api.sh writes the settings for you:
sudo deployment/install_management_api.sh \
--inference-endpoint http://10.0.0.20:11434 \
--inference-model your-model-name \
--inference-context-tokens 32768 \
--inference-output-tokens 2048 \
--inference-reasoning-effort none \
--inference-token-file /home/kindred/.config/kindred/model-token
The last option is only for a model server that needs a token. The file is yours to make: one token on one line, mode 0600. The script never reads or creates it.
- Checking.
deployment/doctor.shreports, in itsassistantline, whether the settings are set and complete. It prints that they are set, never their values. - Restart the management service after changing them.
- Until they are set,
POST /v1/config/assistanswers503and nothing is called.
Choosing the model
Set the window and the output cap to what the server really runs. A larger window lets the assistant send the whole Configuration Schema. A smaller one makes it cut the schema to fit, and the answer says so (schema_cut).
The assistant works with a mid-sized local model, because the model only has to propose a few edits and every edit is checked. A model that is too small to follow the form will be refused attempt after attempt, and the answer will say that.
The schema's field help
A Node Type's schema carries a description on each field. That is the help the page shows, and the assistant sends the descriptions with the schema when they fit.
With an output cap of 2,048 tokens and the default sizing, the whole schema fits from a window of:
- about 22,000 tokens for the MES Node Type
- about 10,000 tokens for PLC / Generic Device
- about 7,000 tokens for ERP
- about 5,500 tokens for Production Scheduling
A smaller window is sent the schema without its descriptions. Its structure, limits and credential marks are all still there, and the answer says schema_cut. An MES answer therefore says so every time on a window under 22,000 tokens.
Asking
On the configuration page, Ask the assistant works on the saved draft: save your edits first, type the request, and press Ask the assistant. It can take a minute or more. The page shows the model's own summary, each edit, the values the model chose that your request did not give (check them), and anything else worth knowing. Accept into the draft saves the change as the draft's next revision, with Stage the draft as well if you ticked it; Throw it away drops it. A change made to one revision of the draft cannot be accepted after the draft has moved on, so ask again.
The same from a shell (the token carries configure; $REVISION is the saved draft's revision):
curl -sS -X POST "$BASE/v1/config/assist" -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"request\": \"Poll every 30 seconds instead of 5.\", \"revision\": $REVISION}"
| Field of the request | Meaning |
|---|---|
request |
What to change, in plain words, up to 4000 characters |
revision |
The saved draft's revision, as a save names it. A stale one is refused (409) before the model is asked |
starting_point, replace |
Start from a starting point instead, uploaded (document) or read from the repository (path, optional ref; this needs sync as well as configure). An existing draft needs replace and is not touched unless the change is applied |
node_type |
With no draft and no starting point: the Node Type to write a first config for (the running one when left out) |
apply |
none (the default) returns the change and saves nothing; draft saves it; stage saves it and stages the draft. The use for draft and stage is a script or a pipeline that drafts a change without a person at the page (an integrator's tool, a commissioning script): one call in place of reading the draft, asking, saving and staging, with no gap between the check and the save for another save to land in. The page does not use it, because a person looks at the change first |
sample, section, identity_field, event_type |
Captured source records, to preview the mapping over (below) |
The answer has the summary, the changes (each set or remove of a path), assumed (values the model chose),
document (the draft with the change made: send it as a save's document to keep it), findings, the preview,
how many attempts it took, and what was done (applied, draft_revision, staged). If a save or a stage you
asked for was refused, the change is still returned, applied says how far it got, and not_applied says why in
the service's own words. The route needs the configure scope; a token with read alone is refused with 403.
What is checked
The model's reply is read as a list of edits, each a path starting with config. that ends at a key (such as
config.rest.poll_interval_seconds, or config.nodes[0].name for a key inside a list item) and a set or a
remove. A list is changed by setting it whole. The only path outside config an edit may reach is
node_type_version, and only to the Node Type's own version. Each edit is applied to a copy of the draft; then,
on that copy:
- every problem it has against the Node Type's Configuration Schema is found, with no config value in the words;
- the offline check runs, which includes the check that every key a connector subscribes to is projected;
- with
samplerecords in the request, the mapping preview runs over them.
When the copy has a problem, the findings go back to the model for another attempt, up to
MANAGEMENT_INFERENCE_MAX_ATTEMPTS. A change that never passes is refused with 422, the last findings are in
the answer, and nothing is changed. A model that could not be reached, or that refused every request, gives 502.
Two things do not count as problems. A credential the schema requires and the draft does not hold yet is listed as still to be set (the schema needs it, but only you can give it). And a place a starting point left open is listed as still empty: the assistant fills a place only with a value your request gives, and never a credential's.
The mapping preview needs records
The preview runs a mapping over captured source records, which the appliance does not hold. It therefore runs only when the request carries a sample:
- a list of records, up to 1000;
identity_field, unless the Node Type fixes one;section, when the config has more than one connector.
The records stay on the appliance. The model is told only the names of keys and counts of records, never a value.
Gaps are advice, not a reason to refuse. A gap the preview finds goes into findings as advice. Examples are a key nothing reads, a rule no record can reach, records no rule matched, and a canonical field left empty. Record fields no mapping reads are listed as advice but not counted, since a plant often leaves them unread on purpose.
One chance at a better change. When a change is otherwise valid, the preview found gaps, and attempts remain, the gaps (names and counts, never a value) are given back to the model once.
- The better change is kept only if it is still valid and has fewer gaps.
- A worse one, an invalid one and an empty one leave the change that passed.
- A change with no gap is not asked about again.
Version changes
When the Node Type has moved to a newer version, a config written for the old one is refused on its version line alone. Start a draft from the staged config, then ask the assistant to bring it to the current version. The prompt carries what the migration read finds (every other problem the draft has against the running Node Type, no value in any message) and the version the Node Type is at, so the assistant proposes the edits the new version needs along with the version line. The change must pass the same checks as any other before it is shown.
Limits
- One request at a time. A second one while one runs answers
409. - A longer time limit than the other routes. The route is allowed the model's calls and their retries (the timeout times the attempts, plus 30 seconds), never more than 600 seconds. The others keep their 30 seconds. The assistant starts no attempt it cannot finish inside its limit.
- The prompt fits the model's window. The instructions, the request, the draft, the Configuration Schema and
the findings of the last attempt are sized to the window you set. The schema is cut first (its descriptions,
then its deepest parts, never the credential marks); a draft too large to leave room for even the top of the
schema is refused with
422before the model is asked. - The Activity Log must be reachable. A request is refused with
503before the model is asked when it is not, as every request that changes the draft is.
The Activity Log
Every call that reaches the model writes one entry, task type config_assist, with the token's id, the prompt
asset it used (name and version, such as config_assistant@0.1.0), the outcome and counts of attempts,
changes and findings. The outcome is proposed, draft or stage (how far it got),
proposed_not_applied, or a refusal such as rejected:no_valid_change or failed:model_failed. The request
text, the draft and the model's reply are never in it. When the assistant is off, or the Activity Log cannot be
reached, nothing is called and no entry is written.
What the answers mean
| Status | Meaning |
|---|---|
200 |
A change that passes the checks; applied says whether it was saved or staged |
403 |
The token lacks configure, or a starting point is read from the repository and it lacks sync |
409 |
Another request is running, or the revision does not match the saved draft (no draft at it, a stale one, a draft that exists and none named, or a starting point over a draft with no replace) |
422 |
The request holds a credential the draft has; the draft is too large for the model's window; no Node Type is known; a starting point is not usable; or no change passed the checks |
502 |
The model gave no usable answer to any attempt, or the repository could not be reached |
503 |
The assistant is off, the Activity Log cannot be reached, or the draft holds credentials and the appliance has no age key to check the request against them |
504 |
The request outran the assistant's own limit |
Release: v0.11.0