mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Update swagger docs
This commit is contained in:
82
docs/docs.go
82
docs/docs.go
@@ -21,6 +21,11 @@ const docTemplate = `{
|
|||||||
"paths": {
|
"paths": {
|
||||||
"/instances": {
|
"/instances": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns a list of all instances managed by the server",
|
"description": "Returns a list of all instances managed by the server",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -47,6 +52,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/instances/{name}": {
|
"/instances/{name}": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the details of a specific instance by name",
|
"description": "Returns the details of a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -83,6 +93,11 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Updates the configuration of a specific instance by name",
|
"description": "Updates the configuration of a specific instance by name",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -131,6 +146,11 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Creates a new instance with the provided configuration options",
|
"description": "Creates a new instance with the provided configuration options",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -179,6 +199,11 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Stops and removes a specific instance by name",
|
"description": "Stops and removes a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -214,6 +239,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/instances/{name}/logs": {
|
"/instances/{name}/logs": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the logs from a specific instance by name with optional line limit",
|
"description": "Returns the logs from a specific instance by name with optional line limit",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -258,6 +288,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/instances/{name}/proxy": {
|
"/instances/{name}/proxy": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -297,6 +332,11 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -338,6 +378,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/instances/{name}/restart": {
|
"/instances/{name}/restart": {
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Restarts a specific instance by name",
|
"description": "Restarts a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -376,6 +421,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/instances/{name}/start": {
|
"/instances/{name}/start": {
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Starts a specific instance by name",
|
"description": "Starts a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -414,6 +464,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/instances/{name}/stop": {
|
"/instances/{name}/stop": {
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Stops a specific instance by name",
|
"description": "Stops a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -452,6 +507,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/server/devices": {
|
"/server/devices": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns a list of available devices for the llama server",
|
"description": "Returns a list of available devices for the llama server",
|
||||||
"tags": [
|
"tags": [
|
||||||
"server"
|
"server"
|
||||||
@@ -475,6 +535,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/server/help": {
|
"/server/help": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the help text for the llama server command",
|
"description": "Returns the help text for the llama server command",
|
||||||
"tags": [
|
"tags": [
|
||||||
"server"
|
"server"
|
||||||
@@ -498,6 +563,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/server/version": {
|
"/server/version": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the version of the llama server command",
|
"description": "Returns the version of the llama server command",
|
||||||
"tags": [
|
"tags": [
|
||||||
"server"
|
"server"
|
||||||
@@ -521,7 +591,12 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/v1/": {
|
"/v1/": {
|
||||||
"post": {
|
"post": {
|
||||||
"description": "Handles all POST requests to /v1/*, routing to the appropriate instance based on the request body",
|
"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": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@@ -550,6 +625,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/v1/models": {
|
"/v1/models": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns a list of instances in a format compatible with OpenAI API",
|
"description": "Returns a list of instances in a format compatible with OpenAI API",
|
||||||
"tags": [
|
"tags": [
|
||||||
"openai"
|
"openai"
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"/instances": {
|
"/instances": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns a list of all instances managed by the server",
|
"description": "Returns a list of all instances managed by the server",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -40,6 +45,11 @@
|
|||||||
},
|
},
|
||||||
"/instances/{name}": {
|
"/instances/{name}": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the details of a specific instance by name",
|
"description": "Returns the details of a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -76,6 +86,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Updates the configuration of a specific instance by name",
|
"description": "Updates the configuration of a specific instance by name",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -124,6 +139,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Creates a new instance with the provided configuration options",
|
"description": "Creates a new instance with the provided configuration options",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -172,6 +192,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Stops and removes a specific instance by name",
|
"description": "Stops and removes a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -207,6 +232,11 @@
|
|||||||
},
|
},
|
||||||
"/instances/{name}/logs": {
|
"/instances/{name}/logs": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the logs from a specific instance by name with optional line limit",
|
"description": "Returns the logs from a specific instance by name with optional line limit",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -251,6 +281,11 @@
|
|||||||
},
|
},
|
||||||
"/instances/{name}/proxy": {
|
"/instances/{name}/proxy": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -290,6 +325,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
"description": "Forwards HTTP requests to the llama-server instance running on a specific port",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -331,6 +371,11 @@
|
|||||||
},
|
},
|
||||||
"/instances/{name}/restart": {
|
"/instances/{name}/restart": {
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Restarts a specific instance by name",
|
"description": "Restarts a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -369,6 +414,11 @@
|
|||||||
},
|
},
|
||||||
"/instances/{name}/start": {
|
"/instances/{name}/start": {
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Starts a specific instance by name",
|
"description": "Starts a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -407,6 +457,11 @@
|
|||||||
},
|
},
|
||||||
"/instances/{name}/stop": {
|
"/instances/{name}/stop": {
|
||||||
"post": {
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Stops a specific instance by name",
|
"description": "Stops a specific instance by name",
|
||||||
"tags": [
|
"tags": [
|
||||||
"instances"
|
"instances"
|
||||||
@@ -445,6 +500,11 @@
|
|||||||
},
|
},
|
||||||
"/server/devices": {
|
"/server/devices": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns a list of available devices for the llama server",
|
"description": "Returns a list of available devices for the llama server",
|
||||||
"tags": [
|
"tags": [
|
||||||
"server"
|
"server"
|
||||||
@@ -468,6 +528,11 @@
|
|||||||
},
|
},
|
||||||
"/server/help": {
|
"/server/help": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the help text for the llama server command",
|
"description": "Returns the help text for the llama server command",
|
||||||
"tags": [
|
"tags": [
|
||||||
"server"
|
"server"
|
||||||
@@ -491,6 +556,11 @@
|
|||||||
},
|
},
|
||||||
"/server/version": {
|
"/server/version": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns the version of the llama server command",
|
"description": "Returns the version of the llama server command",
|
||||||
"tags": [
|
"tags": [
|
||||||
"server"
|
"server"
|
||||||
@@ -514,7 +584,12 @@
|
|||||||
},
|
},
|
||||||
"/v1/": {
|
"/v1/": {
|
||||||
"post": {
|
"post": {
|
||||||
"description": "Handles all POST requests to /v1/*, routing to the appropriate instance based on the request body",
|
"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": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@@ -543,6 +618,11 @@
|
|||||||
},
|
},
|
||||||
"/v1/models": {
|
"/v1/models": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Returns a list of instances in a format compatible with OpenAI API",
|
"description": "Returns a list of instances in a format compatible with OpenAI API",
|
||||||
"tags": [
|
"tags": [
|
||||||
"openai"
|
"openai"
|
||||||
|
|||||||
@@ -399,6 +399,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: List all instances
|
summary: List all instances
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -422,6 +424,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Delete an instance
|
summary: Delete an instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -446,6 +450,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Get details of a specific instance
|
summary: Get details of a specific instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -478,6 +484,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Create and start a new instance
|
summary: Create and start a new instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -510,6 +518,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Update an instance's configuration
|
summary: Update an instance's configuration
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -540,6 +550,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Get logs from a specific instance
|
summary: Get logs from a specific instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -568,6 +580,8 @@ paths:
|
|||||||
description: Instance is not running
|
description: Instance is not running
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Proxy requests to a specific instance
|
summary: Proxy requests to a specific instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -595,6 +609,8 @@ paths:
|
|||||||
description: Instance is not running
|
description: Instance is not running
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Proxy requests to a specific instance
|
summary: Proxy requests to a specific instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -620,6 +636,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Restart a running instance
|
summary: Restart a running instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -645,6 +663,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Start a stopped instance
|
summary: Start a stopped instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -670,6 +690,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Stop a running instance
|
summary: Stop a running instance
|
||||||
tags:
|
tags:
|
||||||
- instances
|
- instances
|
||||||
@@ -685,6 +707,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: List available devices for llama server
|
summary: List available devices for llama server
|
||||||
tags:
|
tags:
|
||||||
- server
|
- server
|
||||||
@@ -700,6 +724,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Get help for llama server
|
summary: Get help for llama server
|
||||||
tags:
|
tags:
|
||||||
- server
|
- server
|
||||||
@@ -715,6 +741,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: Get version of llama server
|
summary: Get version of llama server
|
||||||
tags:
|
tags:
|
||||||
- server
|
- server
|
||||||
@@ -723,7 +751,8 @@ paths:
|
|||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Handles all POST requests to /v1/*, routing to the appropriate
|
description: Handles all POST requests to /v1/*, routing to the appropriate
|
||||||
instance based on the request body
|
instance based on the request body. Requires API key authentication via the
|
||||||
|
`Authorization` header.
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OpenAI response
|
description: OpenAI response
|
||||||
@@ -735,6 +764,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: OpenAI-compatible proxy endpoint
|
summary: OpenAI-compatible proxy endpoint
|
||||||
tags:
|
tags:
|
||||||
- openai
|
- openai
|
||||||
@@ -751,6 +782,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
summary: List instances in OpenAI-compatible format
|
summary: List instances in OpenAI-compatible format
|
||||||
tags:
|
tags:
|
||||||
- openai
|
- openai
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ func NewHandler(im InstanceManager, config Config) *Handler {
|
|||||||
// @Summary Get help for llama server
|
// @Summary Get help for llama server
|
||||||
// @Description Returns the help text for the llama server command
|
// @Description Returns the help text for the llama server command
|
||||||
// @Tags server
|
// @Tags server
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces text/plain
|
// @Produces text/plain
|
||||||
// @Success 200 {string} string "Help text"
|
// @Success 200 {string} string "Help text"
|
||||||
// @Failure 500 {string} string "Internal Server Error"
|
// @Failure 500 {string} string "Internal Server Error"
|
||||||
@@ -50,6 +51,7 @@ func (h *Handler) HelpHandler() http.HandlerFunc {
|
|||||||
// @Summary Get version of llama server
|
// @Summary Get version of llama server
|
||||||
// @Description Returns the version of the llama server command
|
// @Description Returns the version of the llama server command
|
||||||
// @Tags server
|
// @Tags server
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces text/plain
|
// @Produces text/plain
|
||||||
// @Success 200 {string} string "Version information"
|
// @Success 200 {string} string "Version information"
|
||||||
// @Failure 500 {string} string "Internal Server Error"
|
// @Failure 500 {string} string "Internal Server Error"
|
||||||
@@ -71,6 +73,7 @@ func (h *Handler) VersionHandler() http.HandlerFunc {
|
|||||||
// @Summary List available devices for llama server
|
// @Summary List available devices for llama server
|
||||||
// @Description Returns a list of available devices for the llama server
|
// @Description Returns a list of available devices for the llama server
|
||||||
// @Tags server
|
// @Tags server
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces text/plain
|
// @Produces text/plain
|
||||||
// @Success 200 {string} string "List of devices"
|
// @Success 200 {string} string "List of devices"
|
||||||
// @Failure 500 {string} string "Internal Server Error"
|
// @Failure 500 {string} string "Internal Server Error"
|
||||||
@@ -92,6 +95,7 @@ func (h *Handler) ListDevicesHandler() http.HandlerFunc {
|
|||||||
// @Summary List all instances
|
// @Summary List all instances
|
||||||
// @Description Returns a list of all instances managed by the server
|
// @Description Returns a list of all instances managed by the server
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Success 200 {array} Instance "List of instances"
|
// @Success 200 {array} Instance "List of instances"
|
||||||
// @Failure 500 {string} string "Internal Server Error"
|
// @Failure 500 {string} string "Internal Server Error"
|
||||||
@@ -116,6 +120,7 @@ func (h *Handler) ListInstances() http.HandlerFunc {
|
|||||||
// @Summary Create and start a new instance
|
// @Summary Create and start a new instance
|
||||||
// @Description Creates a new instance with the provided configuration options
|
// @Description Creates a new instance with the provided configuration options
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
@@ -157,6 +162,7 @@ func (h *Handler) CreateInstance() http.HandlerFunc {
|
|||||||
// @Summary Get details of a specific instance
|
// @Summary Get details of a specific instance
|
||||||
// @Description Returns the details of a specific instance by name
|
// @Description Returns the details of a specific instance by name
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Success 200 {object} Instance "Instance details"
|
// @Success 200 {object} Instance "Instance details"
|
||||||
@@ -189,6 +195,7 @@ func (h *Handler) GetInstance() http.HandlerFunc {
|
|||||||
// @Summary Update an instance's configuration
|
// @Summary Update an instance's configuration
|
||||||
// @Description Updates the configuration of a specific instance by name
|
// @Description Updates the configuration of a specific instance by name
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
@@ -229,6 +236,7 @@ func (h *Handler) UpdateInstance() http.HandlerFunc {
|
|||||||
// @Summary Start a stopped instance
|
// @Summary Start a stopped instance
|
||||||
// @Description Starts a specific instance by name
|
// @Description Starts a specific instance by name
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Success 200 {object} Instance "Started instance details"
|
// @Success 200 {object} Instance "Started instance details"
|
||||||
@@ -261,6 +269,7 @@ func (h *Handler) StartInstance() http.HandlerFunc {
|
|||||||
// @Summary Stop a running instance
|
// @Summary Stop a running instance
|
||||||
// @Description Stops a specific instance by name
|
// @Description Stops a specific instance by name
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Success 200 {object} Instance "Stopped instance details"
|
// @Success 200 {object} Instance "Stopped instance details"
|
||||||
@@ -293,6 +302,7 @@ func (h *Handler) StopInstance() http.HandlerFunc {
|
|||||||
// @Summary Restart a running instance
|
// @Summary Restart a running instance
|
||||||
// @Description Restarts a specific instance by name
|
// @Description Restarts a specific instance by name
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Success 200 {object} Instance "Restarted instance details"
|
// @Success 200 {object} Instance "Restarted instance details"
|
||||||
@@ -325,6 +335,7 @@ func (h *Handler) RestartInstance() http.HandlerFunc {
|
|||||||
// @Summary Delete an instance
|
// @Summary Delete an instance
|
||||||
// @Description Stops and removes a specific instance by name
|
// @Description Stops and removes a specific instance by name
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Success 204 "No Content"
|
// @Success 204 "No Content"
|
||||||
// @Failure 400 {string} string "Invalid name format"
|
// @Failure 400 {string} string "Invalid name format"
|
||||||
@@ -351,6 +362,7 @@ func (h *Handler) DeleteInstance() http.HandlerFunc {
|
|||||||
// @Summary Get logs from a specific instance
|
// @Summary Get logs from a specific instance
|
||||||
// @Description Returns the logs from a specific instance by name with optional line limit
|
// @Description Returns the logs from a specific instance by name with optional line limit
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Param lines query string false "Number of lines to retrieve (default: all lines)"
|
// @Param lines query string false "Number of lines to retrieve (default: all lines)"
|
||||||
// @Produces text/plain
|
// @Produces text/plain
|
||||||
@@ -398,6 +410,7 @@ func (h *Handler) GetInstanceLogs() http.HandlerFunc {
|
|||||||
// @Summary Proxy requests to a specific instance
|
// @Summary Proxy requests to a specific instance
|
||||||
// @Description Forwards HTTP requests to the llama-server instance running on a specific port
|
// @Description Forwards HTTP requests to the llama-server instance running on a specific port
|
||||||
// @Tags instances
|
// @Tags instances
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Param name path string true "Instance Name"
|
// @Param name path string true "Instance Name"
|
||||||
// @Success 200 "Request successfully proxied to instance"
|
// @Success 200 "Request successfully proxied to instance"
|
||||||
// @Failure 400 {string} string "Invalid name format"
|
// @Failure 400 {string} string "Invalid name format"
|
||||||
@@ -462,6 +475,7 @@ func (h *Handler) ProxyToInstance() http.HandlerFunc {
|
|||||||
// @Summary List instances in OpenAI-compatible format
|
// @Summary List instances in OpenAI-compatible format
|
||||||
// @Description Returns a list of instances in a format compatible with OpenAI API
|
// @Description Returns a list of instances in a format compatible with OpenAI API
|
||||||
// @Tags openai
|
// @Tags openai
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Success 200 {object} OpenAIListInstancesResponse "List of OpenAI-compatible instances"
|
// @Success 200 {object} OpenAIListInstancesResponse "List of OpenAI-compatible instances"
|
||||||
// @Failure 500 {string} string "Internal Server Error"
|
// @Failure 500 {string} string "Internal Server Error"
|
||||||
@@ -499,8 +513,9 @@ func (h *Handler) OpenAIListInstances() http.HandlerFunc {
|
|||||||
|
|
||||||
// OpenAIProxy godoc
|
// OpenAIProxy godoc
|
||||||
// @Summary OpenAI-compatible proxy endpoint
|
// @Summary OpenAI-compatible proxy endpoint
|
||||||
// @Description Handles all POST requests to /v1/*, routing to the appropriate instance based on the request body
|
// @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.
|
||||||
// @Tags openai
|
// @Tags openai
|
||||||
|
// @Security ApiKeyAuth
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produces json
|
// @Produces json
|
||||||
// @Success 200 "OpenAI response"
|
// @Success 200 "OpenAI response"
|
||||||
|
|||||||
Reference in New Issue
Block a user