mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-22 17:14:22 +00:00
2203 lines
75 KiB
JSON
2203 lines
75 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "llamactl is a control server for managing Llama Server instances.",
|
|
"title": "llamactl API",
|
|
"contact": {},
|
|
"license": {
|
|
"name": "MIT License",
|
|
"url": "https://opensource.org/license/mit/"
|
|
},
|
|
"version": "1.0"
|
|
},
|
|
"basePath": "/api/v1",
|
|
"paths": {
|
|
"/api/v1/auth/keys": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns a list of all API keys for the system user (excludes key hash and plain-text key)",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Keys"
|
|
],
|
|
"summary": "List all API keys",
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of API keys",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/server.KeyResponse"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Creates a new API key with the specified permissions and returns the plain-text key (only shown once)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Keys"
|
|
],
|
|
"summary": "Create a new API key",
|
|
"parameters": [
|
|
{
|
|
"description": "API key configuration",
|
|
"name": "key",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/server.CreateKeyRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created API key with plain-text key",
|
|
"schema": {
|
|
"$ref": "#/definitions/server.CreateKeyResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body or validation error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/keys/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns details for a specific API key by ID (excludes key hash and plain-text key)",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Keys"
|
|
],
|
|
"summary": "Get details of a specific API key",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Key ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "API key details",
|
|
"schema": {
|
|
"$ref": "#/definitions/server.KeyResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid key ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "API key not found",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Deletes an API key by ID",
|
|
"tags": [
|
|
"Keys"
|
|
],
|
|
"summary": "Delete an API key",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Key ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "API key deleted successfully"
|
|
},
|
|
"400": {
|
|
"description": "Invalid key ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "API key not found",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/keys/{id}/permissions": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns the instance-level permissions for a specific API key (includes instance names)",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Keys"
|
|
],
|
|
"summary": "Get API key permissions",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Key ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of key permissions",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/server.KeyPermissionResponse"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid key ID",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "API key not found",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/backends/llama-cpp/devices": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns a list of available devices for the llama server",
|
|
"tags": [
|
|
"Backends"
|
|
],
|
|
"summary": "List available devices for llama server",
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of devices",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/backends/llama-cpp/help": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns the help text for the llama server command",
|
|
"tags": [
|
|
"Backends"
|
|
],
|
|
"summary": "Get help for llama server",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Help text",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/backends/llama-cpp/parse-command": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Parses a llama-server command string into instance options",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Backends"
|
|
],
|
|
"summary": "Parse llama-server command",
|
|
"parameters": [
|
|
{
|
|
"description": "Command to parse",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/server.ParseCommandRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Parsed options",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Options"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request or command",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/backends/llama-cpp/version": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns the version of the llama server command",
|
|
"tags": [
|
|
"Backends"
|
|
],
|
|
"summary": "Get version of llama server",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Version information",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/backends/mlx/parse-command": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Parses MLX-LM server command string into instance options",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Backends"
|
|
],
|
|
"summary": "Parse mlx_lm.server command",
|
|
"parameters": [
|
|
{
|
|
"description": "Command to parse",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/server.ParseCommandRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Parsed options",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Options"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request or command",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/backends/vllm/parse-command": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Parses a vLLM serve command string into instance options",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Backends"
|
|
],
|
|
"summary": "Parse vllm serve command",
|
|
"parameters": [
|
|
{
|
|
"description": "Command to parse",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/server.ParseCommandRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Parsed options",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Options"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request or command",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/config": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns the current server configuration (sanitized)",
|
|
"tags": [
|
|
"System"
|
|
],
|
|
"summary": "Get server configuration",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Sanitized configuration",
|
|
"schema": {
|
|
"$ref": "#/definitions/config.AppConfig"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns a list of all instances managed by the server",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "List all instances",
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of instances",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances/{name}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns the details of a specific instance by name",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Get details of a specific instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Instance details",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Updates the configuration of a specific instance by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Update an instance's configuration",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Instance configuration options",
|
|
"name": "options",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Options"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated instance details",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Creates a new instance with the provided configuration options",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Create and start a new instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Instance configuration options",
|
|
"name": "options",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Options"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created instance details",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Stops and removes a specific instance by name",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Delete an instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content"
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances/{name}/logs": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns the logs from a specific instance by name with optional line limit",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Get logs from a specific instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Number of lines to retrieve (default: all lines)",
|
|
"name": "lines",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Instance logs",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format or lines parameter",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances/{name}/proxy": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Proxy requests to a specific instance, does not autostart instance if stopped",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Request successfully proxied to instance"
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Instance is not running",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Proxy requests to a specific instance, does not autostart instance if stopped",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Request successfully proxied to instance"
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Instance is not running",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances/{name}/restart": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Restarts a specific instance by name",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Restart a running instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Restarted instance details",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances/{name}/start": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Starts a specific instance by name",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Start a stopped instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Started instance details",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/instances/{name}/stop": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Stops a specific instance by name",
|
|
"tags": [
|
|
"Instances"
|
|
],
|
|
"summary": "Stop a running instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Stopped instance details",
|
|
"schema": {
|
|
"$ref": "#/definitions/instance.Instance"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid name format",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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": [
|
|
"System"
|
|
],
|
|
"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": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the llama.cpp UI for the specified instance",
|
|
"produces": [
|
|
"text/html"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp UI for the instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied HTML response",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/apply-template": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/completion": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/detokenize": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/embeddings": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/infill": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/metrics": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/props": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/reranking": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/slots": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/llama-cpp/{name}/tokenize": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Proxies requests to the specified llama.cpp server instance, starting it on-demand if configured",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Llama.cpp"
|
|
],
|
|
"summary": "Proxy requests to llama.cpp server instance",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Instance Name",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Proxied response",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid instance",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Handles all POST requests to /v1/*, routing to the appropriate instance based on the request body. Requires API key authentication via the `Authorization` header.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"OpenAI"
|
|
],
|
|
"summary": "OpenAI-compatible proxy endpoint",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OpenAI response"
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body or instance name",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/models": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns a list of instances in a format compatible with OpenAI API",
|
|
"tags": [
|
|
"OpenAI"
|
|
],
|
|
"summary": "List instances in OpenAI-compatible format",
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of OpenAI-compatible instances",
|
|
"schema": {
|
|
"$ref": "#/definitions/server.OpenAIListInstancesResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"auth.PermissionMode": {
|
|
"type": "string",
|
|
"enum": [
|
|
"allow_all",
|
|
"per_instance"
|
|
],
|
|
"x-enum-varnames": [
|
|
"PermissionModeAllowAll",
|
|
"PermissionModePerInstance"
|
|
]
|
|
},
|
|
"config.AppConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"auth": {
|
|
"$ref": "#/definitions/config.AuthConfig"
|
|
},
|
|
"backends": {
|
|
"$ref": "#/definitions/config.BackendConfig"
|
|
},
|
|
"build_time": {
|
|
"type": "string"
|
|
},
|
|
"commit_hash": {
|
|
"type": "string"
|
|
},
|
|
"data_dir": {
|
|
"description": "Directory where all llamactl data will be stored (database, instances, logs, etc.)",
|
|
"type": "string"
|
|
},
|
|
"database": {
|
|
"$ref": "#/definitions/config.DatabaseConfig"
|
|
},
|
|
"instances": {
|
|
"$ref": "#/definitions/config.InstancesConfig"
|
|
},
|
|
"local_node": {
|
|
"type": "string"
|
|
},
|
|
"nodes": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/config.NodeConfig"
|
|
}
|
|
},
|
|
"server": {
|
|
"$ref": "#/definitions/config.ServerConfig"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config.AuthConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"inference_keys": {
|
|
"description": "List of keys for OpenAI compatible inference endpoints",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"management_keys": {
|
|
"description": "List of keys for management endpoints",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"require_inference_auth": {
|
|
"description": "Require authentication for OpenAI compatible inference endpoints",
|
|
"type": "boolean"
|
|
},
|
|
"require_management_auth": {
|
|
"description": "Require authentication for management endpoints",
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"config.BackendConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"llama-cpp": {
|
|
"$ref": "#/definitions/config.BackendSettings"
|
|
},
|
|
"mlx": {
|
|
"$ref": "#/definitions/config.BackendSettings"
|
|
},
|
|
"vllm": {
|
|
"$ref": "#/definitions/config.BackendSettings"
|
|
}
|
|
}
|
|
},
|
|
"config.BackendSettings": {
|
|
"type": "object",
|
|
"properties": {
|
|
"args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"command": {
|
|
"type": "string"
|
|
},
|
|
"docker": {
|
|
"$ref": "#/definitions/config.DockerSettings"
|
|
},
|
|
"environment": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"response_headers": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"config.DatabaseConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"connection_max_lifetime": {
|
|
"type": "string",
|
|
"example": "1h"
|
|
},
|
|
"max_idle_connections": {
|
|
"type": "integer"
|
|
},
|
|
"max_open_connections": {
|
|
"description": "Connection settings",
|
|
"type": "integer"
|
|
},
|
|
"path": {
|
|
"description": "Database file path (relative to the top-level data_dir or absolute)",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config.DockerSettings": {
|
|
"type": "object",
|
|
"properties": {
|
|
"args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"environment": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"image": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config.InstancesConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"auto_create_dirs": {
|
|
"description": "Automatically create the data directory if it doesn't exist",
|
|
"type": "boolean"
|
|
},
|
|
"configs_dir": {
|
|
"description": "Instance config directory override (relative to data_dir if not absolute)",
|
|
"type": "string"
|
|
},
|
|
"default_auto_restart": {
|
|
"description": "Default auto-restart setting for new instances",
|
|
"type": "boolean"
|
|
},
|
|
"default_max_restarts": {
|
|
"description": "Default max restarts for new instances",
|
|
"type": "integer"
|
|
},
|
|
"default_on_demand_start": {
|
|
"description": "Default on-demand start setting for new instances",
|
|
"type": "boolean"
|
|
},
|
|
"default_restart_delay": {
|
|
"description": "Default restart delay for new instances (in seconds)",
|
|
"type": "integer"
|
|
},
|
|
"enable_lru_eviction": {
|
|
"description": "Enable LRU eviction for instance logs",
|
|
"type": "boolean"
|
|
},
|
|
"logs_dir": {
|
|
"description": "Logs directory override (relative to data_dir if not absolute)",
|
|
"type": "string"
|
|
},
|
|
"max_instances": {
|
|
"description": "Maximum number of instances that can be created",
|
|
"type": "integer"
|
|
},
|
|
"max_running_instances": {
|
|
"description": "Maximum number of instances that can be running at the same time",
|
|
"type": "integer"
|
|
},
|
|
"on_demand_start_timeout": {
|
|
"description": "How long to wait for an instance to start on demand (in seconds)",
|
|
"type": "integer"
|
|
},
|
|
"port_range": {
|
|
"description": "Port range for instances (e.g., 8000,9000)",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"timeout_check_interval": {
|
|
"description": "Interval for checking instance timeouts (in minutes)",
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"config.NodeConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"type": "string"
|
|
},
|
|
"api_key": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config.ServerConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"allowed_headers": {
|
|
"description": "Allowed headers for CORS (e.g., \"Accept\", \"Authorization\", \"Content-Type\", \"X-CSRF-Token\")",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"allowed_origins": {
|
|
"description": "Allowed origins for CORS (e.g., \"http://localhost:3000\")",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"enable_swagger": {
|
|
"description": "Enable Swagger UI for API documentation",
|
|
"type": "boolean"
|
|
},
|
|
"host": {
|
|
"description": "Server host to bind to",
|
|
"type": "string"
|
|
},
|
|
"port": {
|
|
"description": "Server port to bind to",
|
|
"type": "integer"
|
|
},
|
|
"response_headers": {
|
|
"description": "Response headers to send with responses",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"instance.Instance": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created": {
|
|
"description": "Unix timestamp when instance was created",
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"instance.Options": {
|
|
"type": "object",
|
|
"properties": {
|
|
"auto_restart": {
|
|
"description": "Auto restart",
|
|
"type": "boolean"
|
|
},
|
|
"command_override": {
|
|
"type": "string"
|
|
},
|
|
"docker_enabled": {
|
|
"description": "Execution context overrides",
|
|
"type": "boolean"
|
|
},
|
|
"environment": {
|
|
"description": "Environment variables",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"idle_timeout": {
|
|
"description": "Idle timeout",
|
|
"type": "integer"
|
|
},
|
|
"max_restarts": {
|
|
"type": "integer"
|
|
},
|
|
"on_demand_start": {
|
|
"description": "On demand start",
|
|
"type": "boolean"
|
|
},
|
|
"restart_delay": {
|
|
"description": "seconds",
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"server.CreateKeyRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"expires_at": {
|
|
"type": "integer"
|
|
},
|
|
"instance_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permission_mode": {
|
|
"$ref": "#/definitions/auth.PermissionMode"
|
|
}
|
|
}
|
|
},
|
|
"server.CreateKeyResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "integer"
|
|
},
|
|
"expires_at": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"key": {
|
|
"type": "string"
|
|
},
|
|
"last_used_at": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permission_mode": {
|
|
"$ref": "#/definitions/auth.PermissionMode"
|
|
},
|
|
"updated_at": {
|
|
"type": "integer"
|
|
},
|
|
"user_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server.KeyPermissionResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"instance_id": {
|
|
"type": "integer"
|
|
},
|
|
"instance_name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server.KeyResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "integer"
|
|
},
|
|
"expires_at": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_used_at": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permission_mode": {
|
|
"$ref": "#/definitions/auth.PermissionMode"
|
|
},
|
|
"updated_at": {
|
|
"type": "integer"
|
|
},
|
|
"user_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server.NodeResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server.OpenAIInstance": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"object": {
|
|
"type": "string"
|
|
},
|
|
"owned_by": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server.OpenAIListInstancesResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/server.OpenAIInstance"
|
|
}
|
|
},
|
|
"object": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server.ParseCommandRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"command": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"name": "X-API-Key",
|
|
"in": "header"
|
|
}
|
|
}
|
|
} |