docs(models): document the queued manual imports — swagger, specs, docs

- swagger: annotate POST /models/import (untyped body: documenting it
  as config.ModelConfig would inline the whole type graph, ~5.5k
  generated lines; the description spells out the dual response) and
  regenerate the spec
- tests: pin the admission contract of the queued branch — job id +
  status URL, job queryable before the worker runs, config not written
  at admission, preload-matching filenames, checksum passthrough, and
  the untouched synchronous path
- docs: the Writing YAML section explains when Create queues and what
  the API answers in each case

Assisted-by: Claude:claude-fable-5
Signed-off-by: Plamen K. Kosseff <p.kosseff@gmail.com>
(cherry picked from commit aec658a998)
This commit is contained in:
Plamen K. Kosseff authored and Ettore Di Giacinto committed 2026-10-13 08:14:30 +00:00
1 parent 28c4bb9277
commit a50eb4e68a
6 files changed
+219

No files matched your search

+40
View File
@@ -2857,6 +2857,46 @@ const docTemplate = `{
}
}
},
"/models/import": {
"post": {
"description": "Writes the posted model configuration. A config referencing\nremote assets (download_files entries, URI-valued model/mmproj)\nis enqueued on the gallery job queue and answered with a job id\nplus status URL to poll, like a gallery install; a config with\nno downloads is written synchronously and answered with a\nplain success response.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"models"
],
"summary": "Import a model from a raw YAML or JSON configuration",
"parameters": [
{
"description": "model configuration (YAML or JSON body)",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "remote assets present: job id and status URL",
"schema": {
"$ref": "#/definitions/schema.GalleryResponse"
}
},
"400": {
"description": "invalid or incomplete configuration",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
}
}
}
},
"/models/jobs": {
"get": {
"tags": [
+40
View File
@@ -2854,6 +2854,46 @@
}
}
},
"/models/import": {
"post": {
"description": "Writes the posted model configuration. A config referencing\nremote assets (download_files entries, URI-valued model/mmproj)\nis enqueued on the gallery job queue and answered with a job id\nplus status URL to poll, like a gallery install; a config with\nno downloads is written synchronously and answered with a\nplain success response.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"models"
],
"summary": "Import a model from a raw YAML or JSON configuration",
"parameters": [
{
"description": "model configuration (YAML or JSON body)",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "remote assets present: job id and status URL",
"schema": {
"$ref": "#/definitions/schema.GalleryResponse"
}
},
"400": {
"description": "invalid or incomplete configuration",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
}
}
}
},
"/models/jobs": {
"get": {
"tags": [
+32
View File
@@ -5618,6 +5618,38 @@ paths:
summary: List all Galleries
tags:
- models
/models/import:
post:
consumes:
- application/json
description: |-
Writes the posted model configuration. A config referencing
remote assets (download_files entries, URI-valued model/mmproj)
is enqueued on the gallery job queue and answered with a job id
plus status URL to poll, like a gallery install; a config with
no downloads is written synchronously and answered with a
plain success response.
parameters:
- description: model configuration (YAML or JSON body)
in: body
name: request
required: true
schema:
type: object
produces:
- application/json
responses:
"200":
description: 'remote assets present: job id and status URL'
schema:
$ref: '#/definitions/schema.GalleryResponse'
"400":
description: invalid or incomplete configuration
schema:
$ref: '#/definitions/localai.ModelResponse'
summary: Import a model from a raw YAML or JSON configuration
tags:
- models
/models/jobs:
get:
responses: