2024-04-25 14:10:08 +00:00
|
|
|
// Package swagger Code generated by swaggo/swag. DO NOT EDIT
|
2024-03-29 21:29:33 +00:00
|
|
|
package swagger
|
|
|
|
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
|
|
|
|
const docTemplate = `{
|
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"description": "{{escape .Description}}",
|
|
|
|
"title": "{{.Title}}",
|
|
|
|
"contact": {
|
2024-03-29 21:48:58 +00:00
|
|
|
"name": "LocalAI",
|
|
|
|
"url": "https://localai.io"
|
2024-03-29 21:29:33 +00:00
|
|
|
},
|
|
|
|
"license": {
|
|
|
|
"name": "MIT",
|
2024-03-29 21:48:58 +00:00
|
|
|
"url": "https://raw.githubusercontent.com/mudler/LocalAI/master/LICENSE"
|
2024-03-29 21:29:33 +00:00
|
|
|
},
|
|
|
|
"version": "{{.Version}}"
|
|
|
|
},
|
|
|
|
"host": "{{.Host}}",
|
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
|
"paths": {
|
2024-07-15 23:39:48 +00:00
|
|
|
"/api/p2p": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Returns available P2P nodes",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.P2PNodesResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/api/p2p/token": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Show the P2P token",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"/backend/monitor": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Backend monitor endpoint",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Backend statistics request",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.BackendMonitorRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/proto.StatusResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/backend/shutdown": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Backend monitor endpoint",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Backend statistics request",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.BackendMonitorRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/metrics": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Prometheus metrics endpoint",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Gallery details",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 21:44:18 +00:00
|
|
|
"/models/apply": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Install models to LocalAI.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/localai.GalleryModel"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.GalleryResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/models/available": {
|
|
|
|
"get": {
|
|
|
|
"summary": "List installable models.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/gallery.GalleryModel"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/models/delete/{name}": {
|
|
|
|
"post": {
|
|
|
|
"summary": "delete models to LocalAI.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Model name",
|
|
|
|
"name": "name",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.GalleryResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/models/galleries": {
|
|
|
|
"get": {
|
|
|
|
"summary": "List all Galleries",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"post": {
|
|
|
|
"summary": "Adds a gallery in LocalAI",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Gallery details",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"summary": "removes a gallery from LocalAI",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Gallery details",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"/models/jobs": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Returns all the jobs status progress",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": {
|
|
|
|
"$ref": "#/definitions/gallery.GalleryOpStatus"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/models/jobs/{uuid}": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Returns the job status",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/gallery.GalleryOpStatus"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-09-05 22:21:24 +00:00
|
|
|
"/system": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Show the LocalAI instance information",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.SystemInformationResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-11-14 21:36:53 +00:00
|
|
|
"/tokenMetrics": {
|
|
|
|
"get": {
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"audio/x-wav"
|
|
|
|
],
|
|
|
|
"summary": "Get TokenMetrics for Active Slot.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "generated audio/wav file",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-06-01 22:04:01 +00:00
|
|
|
"/tts": {
|
|
|
|
"post": {
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"audio/x-wav"
|
|
|
|
],
|
|
|
|
"summary": "Generates audio from the input text.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.TTSRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "generated audio/wav file",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"/v1/assistants": {
|
2024-07-18 11:42:45 +00:00
|
|
|
"get": {
|
|
|
|
"summary": "List available assistents",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "integer",
|
|
|
|
"description": "Limit the number of assistants returned",
|
|
|
|
"name": "limit",
|
|
|
|
"in": "query"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Order of assistants returned",
|
|
|
|
"name": "order",
|
|
|
|
"in": "query"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Return assistants created after the given ID",
|
|
|
|
"name": "after",
|
|
|
|
"in": "query"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Return assistants created before the given ID",
|
|
|
|
"name": "before",
|
|
|
|
"in": "query"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/openai.Assistant"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"post": {
|
|
|
|
"summary": "Create an assistant with a model and instructions.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/openai.AssistantRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/openai.Assistant"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"/v1/assistants/{assistant_id}": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Get assistent data",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/openai.Assistant"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"summary": "Delete assistents",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.DeleteAssistantResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"/v1/audio/speech": {
|
|
|
|
"post": {
|
2024-06-01 22:04:01 +00:00
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"audio/x-wav"
|
|
|
|
],
|
2024-03-29 21:29:33 +00:00
|
|
|
"summary": "Generates audio from the input text.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.TTSRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2024-06-01 22:04:01 +00:00
|
|
|
"description": "generated audio/wav file",
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/v1/audio/transcriptions": {
|
|
|
|
"post": {
|
|
|
|
"consumes": [
|
|
|
|
"multipart/form-data"
|
|
|
|
],
|
|
|
|
"summary": "Transcribes audio into the input language.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "model",
|
|
|
|
"name": "model",
|
|
|
|
"in": "formData",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"description": "file",
|
|
|
|
"name": "file",
|
|
|
|
"in": "formData",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/v1/chat/completions": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Generate a chat completions for a given prompt and model.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/v1/completions": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Generate completions for a given prompt and model.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"/v1/edits": {
|
|
|
|
"post": {
|
|
|
|
"summary": "OpenAI edit endpoint",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"/v1/embeddings": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"/v1/files": {
|
|
|
|
"get": {
|
|
|
|
"summary": "List files.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ListFiles"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-11 08:56:55 +00:00
|
|
|
"/v1/files/{file_id}": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Returns information about a specific file.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
2024-07-18 11:42:45 +00:00
|
|
|
"$ref": "#/definitions/schema.File"
|
2024-07-11 08:56:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"summary": "Delete a file.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/openai.DeleteStatus"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/v1/files/{file_id}/content": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Returns information about a specific file.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "file",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"/v1/images/generations": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Creates an image given a prompt.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-11 08:56:55 +00:00
|
|
|
"/v1/models": {
|
|
|
|
"get": {
|
|
|
|
"summary": "List and describe the various models available in the API.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ModelsDataResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 21:44:18 +00:00
|
|
|
"/v1/rerank": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Reranks a list of phrases by relevance to a given text query.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.JINARerankRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.JINARerankResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-08-24 21:53:18 +00:00
|
|
|
"/v1/sound-generation": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Generates audio from the input text.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ElevenLabsSoundGenerationRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"/v1/text-to-speech/{voice-id}": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Generates audio from the input text.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Account ID",
|
|
|
|
"name": "voice-id",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.TTSRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-14 21:36:53 +00:00
|
|
|
},
|
|
|
|
"/v1/tokenMetrics": {
|
|
|
|
"get": {
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"audio/x-wav"
|
|
|
|
],
|
|
|
|
"summary": "Get TokenMetrics for Active Slot.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "generated audio/wav file",
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/v1/tokenize": {
|
|
|
|
"post": {
|
|
|
|
"summary": "Tokenize the input.",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.TokenizeResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-20 22:10:51 +00:00
|
|
|
},
|
|
|
|
"/vad": {
|
|
|
|
"post": {
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"summary": "Detect voice fragments in an audio stream",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "query params",
|
|
|
|
"name": "request",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.VADRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Response",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/proto.VADResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
2024-07-14 21:44:18 +00:00
|
|
|
"config.Gallery": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-04-25 14:10:08 +00:00
|
|
|
"functions.Function": {
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"description": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"parameters": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
2024-08-07 21:54:27 +00:00
|
|
|
},
|
|
|
|
"strict": {
|
|
|
|
"type": "boolean"
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 21:20:52 +00:00
|
|
|
"functions.Item": {
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"properties": {
|
2024-05-12 21:00:18 +00:00
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
|
|
|
},
|
2024-07-18 21:20:52 +00:00
|
|
|
"type": {
|
|
|
|
"type": "string"
|
2024-05-12 21:00:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 21:20:52 +00:00
|
|
|
"functions.JSONFunctionStructure": {
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"$defs": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
|
|
|
},
|
|
|
|
"anyOf": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
2024-07-18 21:20:52 +00:00
|
|
|
"$ref": "#/definitions/functions.Item"
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"oneOf": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
2024-07-18 21:20:52 +00:00
|
|
|
"$ref": "#/definitions/functions.Item"
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-04-25 14:10:08 +00:00
|
|
|
"functions.Tool": {
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"function": {
|
2024-04-25 14:10:08 +00:00
|
|
|
"$ref": "#/definitions/functions.Function"
|
2024-03-29 21:29:33 +00:00
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 21:44:18 +00:00
|
|
|
"gallery.File": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"filename": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"sha256": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"uri": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"gallery.GalleryModel": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"config_file": {
|
|
|
|
"description": "config_file is read in the situation where URL is blank - and therefore this is a base config.",
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
|
|
|
},
|
|
|
|
"description": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"files": {
|
|
|
|
"description": "AdditionalFiles are used to add additional files to the model",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/gallery.File"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"gallery": {
|
|
|
|
"description": "Gallery is a reference to the gallery which contains the model",
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"icon": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"installed": {
|
|
|
|
"description": "Installed is used to indicate if the model is installed or not",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"license": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"overrides": {
|
|
|
|
"description": "Overrides are used to override the configuration of the model located at URL",
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
|
|
|
},
|
|
|
|
"tags": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"urls": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"gallery.GalleryOpStatus": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"deletion": {
|
|
|
|
"description": "Deletion is true if the operation is a deletion",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"downloaded_size": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"error": {},
|
|
|
|
"file_name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"file_size": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"gallery_model_name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"message": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"processed": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"progress": {
|
|
|
|
"type": "number"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 21:44:18 +00:00
|
|
|
"localai.GalleryModel": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"config_file": {
|
|
|
|
"description": "config_file is read in the situation where URL is blank - and therefore this is a base config.",
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
|
|
|
},
|
|
|
|
"config_url": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"description": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"files": {
|
|
|
|
"description": "AdditionalFiles are used to add additional files to the model",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/gallery.File"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"gallery": {
|
|
|
|
"description": "Gallery is a reference to the gallery which contains the model",
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/config.Gallery"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"icon": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"installed": {
|
|
|
|
"description": "Installed is used to indicate if the model is installed or not",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"license": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"overrides": {
|
|
|
|
"description": "Overrides are used to override the configuration of the model located at URL",
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": true
|
|
|
|
},
|
|
|
|
"tags": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"urls": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"openai.Assistant": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"created": {
|
|
|
|
"description": "The time at which the assistant was created.",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"description": {
|
|
|
|
"description": "The description of the assistant.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"file_ids": {
|
|
|
|
"description": "A list of file IDs attached to this assistant.",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"description": "The unique identifier of the assistant.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"instructions": {
|
|
|
|
"description": "The system instructions that the assistant uses.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"metadata": {
|
|
|
|
"description": "Set of key-value pairs attached to the assistant.",
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"model": {
|
|
|
|
"description": "The model ID used by the assistant.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"description": "The name of the assistant.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"description": "Object type, which is \"assistant\".",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"tools": {
|
|
|
|
"description": "A list of tools enabled on the assistant.",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/openai.Tool"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"openai.AssistantRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"description": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"file_ids": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"instructions": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"metadata": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"model": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"tools": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/openai.Tool"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-11 08:56:55 +00:00
|
|
|
"openai.DeleteStatus": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"deleted": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"openai.Tool": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"$ref": "#/definitions/openai.ToolType"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"openai.ToolType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"code_interpreter",
|
|
|
|
"retrieval",
|
|
|
|
"function"
|
|
|
|
],
|
|
|
|
"x-enum-varnames": [
|
|
|
|
"CodeInterpreter",
|
|
|
|
"Retrieval",
|
|
|
|
"Function"
|
|
|
|
]
|
|
|
|
},
|
2024-07-15 23:39:48 +00:00
|
|
|
"p2p.NodeData": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"lastSeen": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2024-08-20 20:54:04 +00:00
|
|
|
"serviceID": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2024-07-15 23:39:48 +00:00
|
|
|
"tunnelAddress": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"proto.MemoryUsageData": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"breakdown": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"total": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"proto.StatusResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"memory": {
|
|
|
|
"$ref": "#/definitions/proto.MemoryUsageData"
|
|
|
|
},
|
|
|
|
"state": {
|
|
|
|
"$ref": "#/definitions/proto.StatusResponse_State"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"proto.StatusResponse_State": {
|
|
|
|
"type": "integer",
|
|
|
|
"enum": [
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
-1
|
|
|
|
],
|
|
|
|
"x-enum-varnames": [
|
|
|
|
"StatusResponse_UNINITIALIZED",
|
|
|
|
"StatusResponse_BUSY",
|
|
|
|
"StatusResponse_READY",
|
|
|
|
"StatusResponse_ERROR"
|
|
|
|
]
|
|
|
|
},
|
2024-11-20 22:10:51 +00:00
|
|
|
"proto.VADResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"segments": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/proto.VADSegment"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"proto.VADSegment": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"end": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"start": {
|
|
|
|
"type": "number"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"schema.BackendMonitorRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"model": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema.Choice": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"delta": {
|
|
|
|
"$ref": "#/definitions/schema.Message"
|
|
|
|
},
|
|
|
|
"finish_reason": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"index": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"message": {
|
|
|
|
"$ref": "#/definitions/schema.Message"
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"schema.DeleteAssistantResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"deleted": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-08-24 21:53:18 +00:00
|
|
|
"schema.ElevenLabsSoundGenerationRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"do_sample": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"duration_seconds": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"model_id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"prompt_influence": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"schema.File": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"bytes": {
|
|
|
|
"description": "Size of the file in bytes",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"created_at": {
|
|
|
|
"description": "The time at which the file was created",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"filename": {
|
|
|
|
"description": "The name of the file",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"description": "Unique identifier for the file",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"description": "Type of the object (e.g., \"file\")",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"purpose": {
|
|
|
|
"description": "The purpose of the file (e.g., \"fine-tune\", \"classifications\", etc.)",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema.FunctionCall": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"arguments": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 21:44:18 +00:00
|
|
|
"schema.GalleryResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"status": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"uuid": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema.Item": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"b64_json": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"embedding": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "number"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"index": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"description": "Images",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 21:44:18 +00:00
|
|
|
"schema.JINADocumentResult": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"document": {
|
|
|
|
"$ref": "#/definitions/schema.JINAText"
|
|
|
|
},
|
|
|
|
"index": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"relevance_score": {
|
|
|
|
"type": "number"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.JINARerankRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"documents": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"model": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"query": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"top_n": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.JINARerankResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"model": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"results": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.JINADocumentResult"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"usage": {
|
|
|
|
"$ref": "#/definitions/schema.JINAUsageInfo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.JINAText": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"text": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.JINAUsageInfo": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"prompt_tokens": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"total_tokens": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-18 11:42:45 +00:00
|
|
|
"schema.ListFiles": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.File"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema.Message": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"content": {
|
|
|
|
"description": "The message content"
|
|
|
|
},
|
|
|
|
"function_call": {
|
|
|
|
"description": "A result of a function call"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"description": "The message name (used for tools calls)",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"role": {
|
|
|
|
"description": "The message role",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2024-09-20 08:49:32 +00:00
|
|
|
"string_audios": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"string_content": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"string_images": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
2024-09-20 08:49:32 +00:00
|
|
|
"string_videos": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"tool_calls": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.ToolCall"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-11 08:56:55 +00:00
|
|
|
"schema.ModelsDataResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIModel"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.OpenAIModel": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema.OpenAIRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"file"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"backend": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"batch": {
|
|
|
|
"description": "Custom parameters - not present in the OpenAI API",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"clip_skip": {
|
|
|
|
"description": "Diffusers",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"echo": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"file": {
|
|
|
|
"description": "whisper",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"frequency_penalty": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"function_call": {
|
|
|
|
"description": "might be a string or an object"
|
|
|
|
},
|
|
|
|
"functions": {
|
|
|
|
"description": "A list of available functions to call",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
2024-04-25 14:10:08 +00:00
|
|
|
"$ref": "#/definitions/functions.Function"
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"grammar": {
|
|
|
|
"description": "A grammar to constrain the LLM output",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"grammar_json_functions": {
|
2024-07-18 21:20:52 +00:00
|
|
|
"$ref": "#/definitions/functions.JSONFunctionStructure"
|
2024-03-29 21:29:33 +00:00
|
|
|
},
|
|
|
|
"ignore_eos": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"input": {},
|
|
|
|
"instruction": {
|
|
|
|
"description": "Edit endpoint",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"language": {
|
|
|
|
"description": "Also part of the OpenAI official spec",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"max_tokens": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"messages": {
|
|
|
|
"description": "Messages is read only by chat/completion API calls",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.Message"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"mode": {
|
|
|
|
"description": "Image (not supported by OpenAI)",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"model": {
|
|
|
|
"description": "Also part of the OpenAI official spec",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"model_base_name": {
|
|
|
|
"description": "AutoGPTQ",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"n": {
|
|
|
|
"description": "Also part of the OpenAI official spec. use it for returning multiple results",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"n_keep": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"negative_prompt": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"negative_prompt_scale": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"presence_penalty": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"prompt": {
|
|
|
|
"description": "Prompt is read only by completion/image API calls"
|
|
|
|
},
|
2024-06-26 23:12:53 +00:00
|
|
|
"repeat_last_n": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"repeat_penalty": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"response_format": {
|
2024-05-30 08:11:05 +00:00
|
|
|
"description": "whisper/image"
|
2024-03-29 21:29:33 +00:00
|
|
|
},
|
|
|
|
"rope_freq_base": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"rope_freq_scale": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"seed": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"size": {
|
|
|
|
"description": "image",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"step": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"stop": {},
|
|
|
|
"stream": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"temperature": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"tfz": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"tokenizer": {
|
|
|
|
"description": "RWKV (?)",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"tool_choice": {},
|
|
|
|
"tools": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
2024-04-25 14:10:08 +00:00
|
|
|
"$ref": "#/definitions/functions.Tool"
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"top_k": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"top_p": {
|
|
|
|
"description": "Common options between all the API calls, part of the OpenAI spec",
|
|
|
|
"type": "number"
|
|
|
|
},
|
2024-06-25 08:50:52 +00:00
|
|
|
"translate": {
|
|
|
|
"description": "Only for audio transcription",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"typical_p": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"use_fast_tokenizer": {
|
|
|
|
"description": "AutoGPTQ",
|
|
|
|
"type": "boolean"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.OpenAIResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"choices": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.Choice"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"created": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"data": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/schema.Item"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"model": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"usage": {
|
|
|
|
"$ref": "#/definitions/schema.OpenAIUsage"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.OpenAIUsage": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"completion_tokens": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"prompt_tokens": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"total_tokens": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-15 23:39:48 +00:00
|
|
|
"schema.P2PNodesResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"federated_nodes": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/p2p.NodeData"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nodes": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/p2p.NodeData"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-11-14 21:36:53 +00:00
|
|
|
"schema.SysInfoModel": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-09-05 22:21:24 +00:00
|
|
|
"schema.SystemInformationResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"backends": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
2024-09-26 08:57:40 +00:00
|
|
|
},
|
|
|
|
"loaded_models": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
2024-11-14 21:36:53 +00:00
|
|
|
"$ref": "#/definitions/schema.SysInfoModel"
|
2024-09-26 08:57:40 +00:00
|
|
|
}
|
2024-09-05 22:21:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-29 21:29:33 +00:00
|
|
|
"schema.TTSRequest": {
|
2024-06-01 22:04:01 +00:00
|
|
|
"description": "TTS request body",
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"backend": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"input": {
|
2024-06-01 22:04:01 +00:00
|
|
|
"description": "text input",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"language": {
|
|
|
|
"description": "(optional) language to use with TTS model",
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"model": {
|
2024-06-01 22:04:01 +00:00
|
|
|
"description": "model name or full path",
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "string"
|
|
|
|
},
|
2024-11-14 21:36:53 +00:00
|
|
|
"response_format": {
|
|
|
|
"description": "(optional) output format",
|
2024-03-29 21:29:33 +00:00
|
|
|
"type": "string"
|
2024-11-02 19:13:35 +00:00
|
|
|
},
|
2024-11-14 21:36:53 +00:00
|
|
|
"voice": {
|
|
|
|
"description": "voice audio file or speaker id",
|
2024-11-02 19:13:35 +00:00
|
|
|
"type": "string"
|
2024-11-14 21:36:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.TokenizeResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"tokens": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.ToolCall": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"function": {
|
|
|
|
"$ref": "#/definitions/schema.FunctionCall"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"index": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2024-11-20 22:10:51 +00:00
|
|
|
},
|
|
|
|
"schema.VADRequest": {
|
|
|
|
"description": "VAD request body",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"audio": {
|
|
|
|
"description": "model name or full path",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "number"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"model": {
|
|
|
|
"description": "model name or full path",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2024-03-29 21:29:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"securityDefinitions": {
|
|
|
|
"BearerAuth": {
|
|
|
|
"type": "apiKey",
|
|
|
|
"name": "Authorization",
|
|
|
|
"in": "header"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
var SwaggerInfo = &swag.Spec{
|
|
|
|
Version: "2.0.0",
|
2024-03-30 11:04:41 +00:00
|
|
|
Host: "",
|
2024-03-29 21:29:33 +00:00
|
|
|
BasePath: "/",
|
|
|
|
Schemes: []string{},
|
|
|
|
Title: "LocalAI API",
|
2024-03-29 21:48:58 +00:00
|
|
|
Description: "The LocalAI Rest API.",
|
2024-03-29 21:29:33 +00:00
|
|
|
InfoInstanceName: "swagger",
|
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
|
LeftDelim: "{{",
|
|
|
|
RightDelim: "}}",
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
|
}
|