Update swagger docs

This commit is contained in:
2025-10-26 16:36:24 +01:00
parent eac4f834c0
commit 3ff87f24bd
3 changed files with 323 additions and 323 deletions

View File

@@ -19,7 +19,7 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/backends/llama-cpp/devices": {
"/api/v1/backends/llama-cpp/devices": {
"get": {
"security": [
{
@@ -47,7 +47,7 @@ const docTemplate = `{
}
}
},
"/backends/llama-cpp/help": {
"/api/v1/backends/llama-cpp/help": {
"get": {
"security": [
{
@@ -75,7 +75,7 @@ const docTemplate = `{
}
}
},
"/backends/llama-cpp/parse-command": {
"/api/v1/backends/llama-cpp/parse-command": {
"post": {
"security": [
{
@@ -132,7 +132,7 @@ const docTemplate = `{
}
}
},
"/backends/llama-cpp/version": {
"/api/v1/backends/llama-cpp/version": {
"get": {
"security": [
{
@@ -160,7 +160,7 @@ const docTemplate = `{
}
}
},
"/backends/mlx/parse-command": {
"/api/v1/backends/mlx/parse-command": {
"post": {
"security": [
{
@@ -208,7 +208,7 @@ const docTemplate = `{
}
}
},
"/backends/vllm/parse-command": {
"/api/v1/backends/vllm/parse-command": {
"post": {
"security": [
{
@@ -256,7 +256,7 @@ const docTemplate = `{
}
}
},
"/instances": {
"/api/v1/instances": {
"get": {
"security": [
{
@@ -287,7 +287,7 @@ const docTemplate = `{
}
}
},
"/instances/{name}": {
"/api/v1/instances/{name}": {
"get": {
"security": [
{
@@ -474,7 +474,7 @@ const docTemplate = `{
}
}
},
"/instances/{name}/logs": {
"/api/v1/instances/{name}/logs": {
"get": {
"security": [
{
@@ -523,7 +523,7 @@ const docTemplate = `{
}
}
},
"/instances/{name}/proxy": {
"/api/v1/instances/{name}/proxy": {
"get": {
"security": [
{
@@ -613,7 +613,7 @@ const docTemplate = `{
}
}
},
"/instances/{name}/restart": {
"/api/v1/instances/{name}/restart": {
"post": {
"security": [
{
@@ -656,7 +656,7 @@ const docTemplate = `{
}
}
},
"/instances/{name}/start": {
"/api/v1/instances/{name}/start": {
"post": {
"security": [
{
@@ -699,7 +699,7 @@ const docTemplate = `{
}
}
},
"/instances/{name}/stop": {
"/api/v1/instances/{name}/stop": {
"post": {
"security": [
{
@@ -742,6 +742,114 @@ const docTemplate = `{
}
}
},
"/api/v1/nodes": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns a map of all nodes configured in the server (node name -\u003e node config)",
"tags": [
"nodes"
],
"summary": "List all configured nodes",
"responses": {
"200": {
"description": "Map of nodes",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/server.NodeResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/nodes/{name}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the details of a specific node by name",
"tags": [
"nodes"
],
"summary": "Get details of a specific node",
"parameters": [
{
"type": "string",
"description": "Node Name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Node details",
"schema": {
"$ref": "#/definitions/server.NodeResponse"
}
},
"400": {
"description": "Invalid name format",
"schema": {
"type": "string"
}
},
"404": {
"description": "Node not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/version": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the version of the llamactl command",
"tags": [
"version"
],
"summary": "Get llamactl version",
"responses": {
"200": {
"description": "Version information",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/llama-cpp/{name}/": {
"get": {
"security": [
@@ -1303,86 +1411,6 @@ const docTemplate = `{
}
}
},
"/nodes": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns a map of all nodes configured in the server (node name -\u003e node config)",
"tags": [
"nodes"
],
"summary": "List all configured nodes",
"responses": {
"200": {
"description": "Map of nodes",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/server.NodeResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/nodes/{name}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the details of a specific node by name",
"tags": [
"nodes"
],
"summary": "Get details of a specific node",
"parameters": [
{
"type": "string",
"description": "Node Name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Node details",
"schema": {
"$ref": "#/definitions/server.NodeResponse"
}
},
"400": {
"description": "Invalid name format",
"schema": {
"type": "string"
}
},
"404": {
"description": "Node not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/v1/": {
"post": {
"security": [
@@ -1444,34 +1472,6 @@ const docTemplate = `{
}
}
}
},
"/version": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the version of the llamactl command",
"tags": [
"version"
],
"summary": "Get llamactl version",
"responses": {
"200": {
"description": "Version information",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {

View File

@@ -12,7 +12,7 @@
},
"basePath": "/api/v1",
"paths": {
"/backends/llama-cpp/devices": {
"/api/v1/backends/llama-cpp/devices": {
"get": {
"security": [
{
@@ -40,7 +40,7 @@
}
}
},
"/backends/llama-cpp/help": {
"/api/v1/backends/llama-cpp/help": {
"get": {
"security": [
{
@@ -68,7 +68,7 @@
}
}
},
"/backends/llama-cpp/parse-command": {
"/api/v1/backends/llama-cpp/parse-command": {
"post": {
"security": [
{
@@ -125,7 +125,7 @@
}
}
},
"/backends/llama-cpp/version": {
"/api/v1/backends/llama-cpp/version": {
"get": {
"security": [
{
@@ -153,7 +153,7 @@
}
}
},
"/backends/mlx/parse-command": {
"/api/v1/backends/mlx/parse-command": {
"post": {
"security": [
{
@@ -201,7 +201,7 @@
}
}
},
"/backends/vllm/parse-command": {
"/api/v1/backends/vllm/parse-command": {
"post": {
"security": [
{
@@ -249,7 +249,7 @@
}
}
},
"/instances": {
"/api/v1/instances": {
"get": {
"security": [
{
@@ -280,7 +280,7 @@
}
}
},
"/instances/{name}": {
"/api/v1/instances/{name}": {
"get": {
"security": [
{
@@ -467,7 +467,7 @@
}
}
},
"/instances/{name}/logs": {
"/api/v1/instances/{name}/logs": {
"get": {
"security": [
{
@@ -516,7 +516,7 @@
}
}
},
"/instances/{name}/proxy": {
"/api/v1/instances/{name}/proxy": {
"get": {
"security": [
{
@@ -606,7 +606,7 @@
}
}
},
"/instances/{name}/restart": {
"/api/v1/instances/{name}/restart": {
"post": {
"security": [
{
@@ -649,7 +649,7 @@
}
}
},
"/instances/{name}/start": {
"/api/v1/instances/{name}/start": {
"post": {
"security": [
{
@@ -692,7 +692,7 @@
}
}
},
"/instances/{name}/stop": {
"/api/v1/instances/{name}/stop": {
"post": {
"security": [
{
@@ -735,6 +735,114 @@
}
}
},
"/api/v1/nodes": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns a map of all nodes configured in the server (node name -\u003e node config)",
"tags": [
"nodes"
],
"summary": "List all configured nodes",
"responses": {
"200": {
"description": "Map of nodes",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/server.NodeResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/nodes/{name}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the details of a specific node by name",
"tags": [
"nodes"
],
"summary": "Get details of a specific node",
"parameters": [
{
"type": "string",
"description": "Node Name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Node details",
"schema": {
"$ref": "#/definitions/server.NodeResponse"
}
},
"400": {
"description": "Invalid name format",
"schema": {
"type": "string"
}
},
"404": {
"description": "Node not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/version": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the version of the llamactl command",
"tags": [
"version"
],
"summary": "Get llamactl version",
"responses": {
"200": {
"description": "Version information",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/llama-cpp/{name}/": {
"get": {
"security": [
@@ -1296,86 +1404,6 @@
}
}
},
"/nodes": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns a map of all nodes configured in the server (node name -\u003e node config)",
"tags": [
"nodes"
],
"summary": "List all configured nodes",
"responses": {
"200": {
"description": "Map of nodes",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/server.NodeResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/nodes/{name}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the details of a specific node by name",
"tags": [
"nodes"
],
"summary": "Get details of a specific node",
"parameters": [
{
"type": "string",
"description": "Node Name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Node details",
"schema": {
"$ref": "#/definitions/server.NodeResponse"
}
},
"400": {
"description": "Invalid name format",
"schema": {
"type": "string"
}
},
"404": {
"description": "Node not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/v1/": {
"post": {
"security": [
@@ -1437,34 +1465,6 @@
}
}
}
},
"/version": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns the version of the llamactl command",
"tags": [
"version"
],
"summary": "Get llamactl version",
"responses": {
"200": {
"description": "Version information",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {

View File

@@ -69,7 +69,7 @@ info:
title: llamactl API
version: "1.0"
paths:
/backends/llama-cpp/devices:
/api/v1/backends/llama-cpp/devices:
get:
description: Returns a list of available devices for the llama server
responses:
@@ -86,7 +86,7 @@ paths:
summary: List available devices for llama server
tags:
- backends
/backends/llama-cpp/help:
/api/v1/backends/llama-cpp/help:
get:
description: Returns the help text for the llama server command
responses:
@@ -103,7 +103,7 @@ paths:
summary: Get help for llama server
tags:
- backends
/backends/llama-cpp/parse-command:
/api/v1/backends/llama-cpp/parse-command:
post:
consumes:
- application/json
@@ -139,7 +139,7 @@ paths:
summary: Parse llama-server command
tags:
- backends
/backends/llama-cpp/version:
/api/v1/backends/llama-cpp/version:
get:
description: Returns the version of the llama server command
responses:
@@ -156,7 +156,7 @@ paths:
summary: Get version of llama server
tags:
- backends
/backends/mlx/parse-command:
/api/v1/backends/mlx/parse-command:
post:
consumes:
- application/json
@@ -186,7 +186,7 @@ paths:
summary: Parse mlx_lm.server command
tags:
- backends
/backends/vllm/parse-command:
/api/v1/backends/vllm/parse-command:
post:
consumes:
- application/json
@@ -216,7 +216,7 @@ paths:
summary: Parse vllm serve command
tags:
- backends
/instances:
/api/v1/instances:
get:
description: Returns a list of all instances managed by the server
responses:
@@ -235,7 +235,7 @@ paths:
summary: List all instances
tags:
- instances
/instances/{name}:
/api/v1/instances/{name}:
delete:
description: Stops and removes a specific instance by name
parameters:
@@ -354,7 +354,7 @@ paths:
summary: Update an instance's configuration
tags:
- instances
/instances/{name}/logs:
/api/v1/instances/{name}/logs:
get:
description: Returns the logs from a specific instance by name with optional
line limit
@@ -386,7 +386,7 @@ paths:
summary: Get logs from a specific instance
tags:
- instances
/instances/{name}/proxy:
/api/v1/instances/{name}/proxy:
get:
description: Forwards HTTP requests to the llama-server instance running on
a specific port
@@ -447,7 +447,7 @@ paths:
if stopped
tags:
- instances
/instances/{name}/restart:
/api/v1/instances/{name}/restart:
post:
description: Restarts a specific instance by name
parameters:
@@ -474,7 +474,7 @@ paths:
summary: Restart a running instance
tags:
- instances
/instances/{name}/start:
/api/v1/instances/{name}/start:
post:
description: Starts a specific instance by name
parameters:
@@ -501,7 +501,7 @@ paths:
summary: Start a stopped instance
tags:
- instances
/instances/{name}/stop:
/api/v1/instances/{name}/stop:
post:
description: Stops a specific instance by name
parameters:
@@ -528,6 +528,74 @@ paths:
summary: Stop a running instance
tags:
- instances
/api/v1/nodes:
get:
description: Returns a map of all nodes configured in the server (node name
-> node config)
responses:
"200":
description: Map of nodes
schema:
additionalProperties:
$ref: '#/definitions/server.NodeResponse'
type: object
"500":
description: Internal Server Error
schema:
type: string
security:
- ApiKeyAuth: []
summary: List all configured nodes
tags:
- nodes
/api/v1/nodes/{name}:
get:
description: Returns the details of a specific node by name
parameters:
- description: Node Name
in: path
name: name
required: true
type: string
responses:
"200":
description: Node details
schema:
$ref: '#/definitions/server.NodeResponse'
"400":
description: Invalid name format
schema:
type: string
"404":
description: Node not found
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- ApiKeyAuth: []
summary: Get details of a specific node
tags:
- nodes
/api/v1/version:
get:
description: Returns the version of the llamactl command
responses:
"200":
description: Version information
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- ApiKeyAuth: []
summary: Get llamactl version
tags:
- version
/llama-cpp/{name}/:
get:
description: Proxies requests to the llama.cpp UI for the specified instance
@@ -897,57 +965,6 @@ paths:
summary: Proxy requests to llama.cpp server instance
tags:
- backends
/nodes:
get:
description: Returns a map of all nodes configured in the server (node name
-> node config)
responses:
"200":
description: Map of nodes
schema:
additionalProperties:
$ref: '#/definitions/server.NodeResponse'
type: object
"500":
description: Internal Server Error
schema:
type: string
security:
- ApiKeyAuth: []
summary: List all configured nodes
tags:
- nodes
/nodes/{name}:
get:
description: Returns the details of a specific node by name
parameters:
- description: Node Name
in: path
name: name
required: true
type: string
responses:
"200":
description: Node details
schema:
$ref: '#/definitions/server.NodeResponse'
"400":
description: Invalid name format
schema:
type: string
"404":
description: Node not found
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- ApiKeyAuth: []
summary: Get details of a specific node
tags:
- nodes
/v1/:
post:
consumes:
@@ -989,23 +1006,6 @@ paths:
summary: List instances in OpenAI-compatible format
tags:
- openai
/version:
get:
description: Returns the version of the llamactl command
responses:
"200":
description: Version information
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- ApiKeyAuth: []
summary: Get llamactl version
tags:
- version
securityDefinitions:
ApiKeyAuth:
in: header