// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"

const docTemplate = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "contact": {},
        "license": {
            "name": "MIT License",
            "url": "https://opensource.org/license/mit/"
        },
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/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": {
        "config.AppConfig": {
            "type": "object",
            "properties": {
                "auth": {
                    "$ref": "#/definitions/config.AuthConfig"
                },
                "backends": {
                    "$ref": "#/definitions/config.BackendConfig"
                },
                "build_time": {
                    "type": "string"
                },
                "commit_hash": {
                    "type": "string"
                },
                "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.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",
                    "type": "string"
                },
                "data_dir": {
                    "description": "Directory where all llamactl data will be stored (instances.json, logs, etc.)",
                    "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",
                    "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 the instance was created",
                    "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.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"
        }
    }
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
	Version:          "1.0",
	Host:             "",
	BasePath:         "/api/v1",
	Schemes:          []string{},
	Title:            "llamactl API",
	Description:      "llamactl is a control server for managing Llama Server instances.",
	InfoInstanceName: "swagger",
	SwaggerTemplate:  docTemplate,
	LeftDelim:        "{{",
	RightDelim:       "}}",
}

func init() {
	swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
