LoRA adapters trained on the nodes: llmgw ctl train

A job names the catalog model the adapter is for, the safetensors weights to
train on, the node and the MiB of a card it needs, and question/answer pairs.
The control plane sends it when the node's agent is there and nothing else
trains on it; the agent trains with its installed vLLM's torch and a pinned
overlay of peft and accelerate (no second environment), as the engines'
user, on the card with that much free — beside an engine, if it leaves that
much — converts the adapter to GGUF with the installed llama.cpp's own
conversion code when the model is served by llama.cpp, and sends what it
made back in pieces, kept in the store to download. Progress, loss and peak
card memory are reported as it goes; a node that goes fails its job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-08 20:25:57 +02:00
1 parent ae95ac8261
commit 79b3e9f887
24 files changed
+3185 -72

No files matched your search

+368
View File
@@ -95,6 +95,9 @@
{
"name": "summary"
},
{
"name": "train"
},
{
"name": "updates"
},
@@ -3689,6 +3692,254 @@
}
}
},
"/api/v1/train/jobs": {
"post": {
"operationId": "postTrainJobs",
"summary": "Queue a LoRA adapter's training on a node",
"description": "The node trains when its agent is there, nothing else trains on it, and a card has gpu_memory_mib free; the pairs are NDJSON of {\"q\", \"a\"}. An adapter learns how answers sound far better than what they say.",
"tags": [
"train"
],
"parameters": [
{
"$ref": "#/components/parameters/Actor"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TrainRequest"
}
}
}
},
"responses": {
"201": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TrainJobView"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
},
"get": {
"operationId": "getTrainJobs",
"summary": "Training jobs, newest first",
"tags": [
"train"
],
"parameters": [
{
"name": "limit",
"in": "query",
"description": "How many; 50 when absent.",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TrainJobView"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/api/v1/train/jobs/{id}": {
"get": {
"operationId": "getTrainJobsId",
"summary": "One training job: how it goes, and what it made",
"tags": [
"train"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The job's ID, as starting it answered.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TrainJobView"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
},
"delete": {
"operationId": "deleteTrainJobsId",
"summary": "Remove an ended training job and what it made",
"tags": [
"train"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The job's ID, as starting it answered.",
"schema": {
"type": "string"
}
},
{
"$ref": "#/components/parameters/Actor"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/api/v1/train/jobs/{id}/artifacts/{kind}": {
"get": {
"operationId": "getTrainJobsIdArtifactsKind",
"summary": "What a training job made: peft (a gzipped tar) or gguf",
"tags": [
"train"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The job's ID, as starting it answered.",
"schema": {
"type": "string"
}
},
{
"name": "kind",
"in": "path",
"required": true,
"description": "What the job made: peft, a gzipped tar of the PEFT adapter, or gguf, the adapter for llama.cpp.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/api/v1/train/jobs/{id}/cancel": {
"post": {
"operationId": "postTrainJobsIdCancel",
"summary": "Stop a training job",
"tags": [
"train"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The job's ID, as starting it answered.",
"schema": {
"type": "string"
}
},
{
"$ref": "#/components/parameters/Actor"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TrainJobView"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/api/v1/updates": {
"get": {
"operationId": "getUpdates",
@@ -6816,6 +7067,123 @@
}
}
},
"TrainJobView": {
"type": "object",
"description": "TrainJobView is a job as listed.",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"model": {
"type": "string"
},
"base_repo": {
"type": "string"
},
"base_revision": {
"type": "string"
},
"node": {
"type": "string"
},
"gpu_memory_mib": {
"type": "integer"
},
"params": {
"type": "string"
},
"gguf": {
"type": "boolean"
},
"pairs": {
"type": "integer"
},
"state": {
"type": "string"
},
"step": {
"type": "integer"
},
"steps": {
"type": "integer"
},
"loss": {
"type": "number"
},
"message": {
"type": "string"
},
"peak_mib": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"started_at": {
"type": "string",
"format": "date-time"
},
"finished_at": {
"type": "string",
"format": "date-time"
},
"created_by": {
"type": "string"
},
"artifacts": {
"type": "array",
"items": {
"type": "string"
},
"description": "Artifacts are what it made: peft (a gzipped tar), gguf."
}
}
},
"TrainRequest": {
"type": "object",
"description": "TrainRequest queues a job.",
"properties": {
"name": {
"type": "string",
"description": "Name is the adapter's: what requests will ask for it by."
},
"model": {
"type": "string",
"description": "Model is the catalog model the adapter is for."
},
"base_repo": {
"type": "string",
"description": "BaseRepo and BaseRevision are the weights trained on: the model's own on its registry, in safetensors (Hugging Face), not a GGUF."
},
"base_revision": {
"type": "string"
},
"node": {
"type": "string",
"description": "Node trains it; GPUMemoryMiB is what it needs of a card, which can be what an engine there leaves free."
},
"gpu_memory_mib": {
"type": "integer"
},
"data": {
"type": "string",
"description": "Data is the pairs, NDJSON of {\"q\", \"a\"} (llmgw ctl kb dataset)."
},
"params": {
"type": "object",
"additionalProperties": {},
"description": "Params tune the trainer: rank, alpha, dropout, epochs, lr, batch, max_len, seed."
},
"gguf": {
"type": "boolean",
"description": "GGUF also makes the adapter in llama.cpp's format; when absent, it does when the model is served by llama.cpp."
}
}
},
"UpgradeRequest": {
"type": "object",
"description": "UpgradeRequest names the release a node should run.",