2023-07-11 06:02:58 +00:00
{
"openapi" : "3.0.3" ,
"info" : {
"title" : "Tabby Server" ,
2023-11-17 04:30:04 +00:00
"description" : "\n[](https://github.com/TabbyML/tabby)\n[](https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA)\n\nInstall following IDE / Editor extensions to get started with [Tabby](https://github.com/TabbyML/tabby).\n* [VSCode Extension](https://github.com/TabbyML/tabby/tree/main/clients/vscode) – Install from the [marketplace](https://marketplace.visualstudio.com/items?itemName=TabbyML.vscode-tabby), or [open-vsx.org](https://open-vsx.org/extension/TabbyML/vscode-tabby)\n* [VIM Extension](https://github.com/TabbyML/tabby/tree/main/clients/vim)\n* [IntelliJ Platform Plugin](https://github.com/TabbyML/tabby/tree/main/clients/intellij) – Install from the [marketplace](https://plugins.jetbrains.com/plugin/22379-tabby)\n" ,
2023-09-05 07:06:35 +00:00
"license" : { "name" : "Apache 2.0" , "url" : "https://github.com/TabbyML/tabby/blob/main/LICENSE" } ,
2023-11-17 04:30:04 +00:00
"version" : "0.5.5"
2023-07-11 06:02:58 +00:00
} ,
2023-11-17 04:30:04 +00:00
"servers" : [ { "url" : "/" , "description" : "Server" } ] ,
2023-07-11 06:02:58 +00:00
"paths" : {
"/v1/completions" : {
"post" : {
2023-07-13 08:31:20 +00:00
"tags" : [ "v1" ] ,
2023-07-11 06:02:58 +00:00
"operationId" : "completion" ,
"requestBody" : {
2023-09-05 07:06:35 +00:00
"content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CompletionRequest" } } } ,
2023-07-11 06:02:58 +00:00
"required" : true
} ,
"responses" : {
"200" : {
"description" : "Success" ,
2023-08-17 14:28:41 +00:00
"content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CompletionResponse" } } }
2023-07-11 06:02:58 +00:00
} ,
2023-08-17 14:28:41 +00:00
"400" : { "description" : "Bad Request" }
2023-07-11 06:02:58 +00:00
}
}
} ,
"/v1/events" : {
"post" : {
2023-07-13 08:31:20 +00:00
"tags" : [ "v1" ] ,
2023-07-11 06:02:58 +00:00
"operationId" : "event" ,
"requestBody" : {
2023-08-17 14:28:41 +00:00
"content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/LogEventRequest" } } } ,
2023-07-11 06:02:58 +00:00
"required" : true
} ,
2023-08-17 14:28:41 +00:00
"responses" : { "200" : { "description" : "Success" } , "400" : { "description" : "Bad Request" } }
2023-07-11 06:02:58 +00:00
}
} ,
"/v1/health" : {
2023-11-17 04:30:04 +00:00
"get" : {
2023-07-13 08:31:20 +00:00
"tags" : [ "v1" ] ,
2023-07-11 06:02:58 +00:00
"operationId" : "health" ,
"responses" : {
"200" : {
"description" : "Success" ,
2023-08-17 14:28:41 +00:00
"content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/HealthState" } } }
2023-07-11 06:02:58 +00:00
}
}
}
2023-11-17 04:30:04 +00:00
} ,
"/v1beta/search" : {
"get" : {
"tags" : [ "v1beta" ] ,
"operationId" : "search" ,
"parameters" : [
{ "name" : "q" , "in" : "query" , "required" : true , "schema" : { "type" : "string" , "default" : "get" } } ,
{
"name" : "limit" ,
"in" : "query" ,
"required" : false ,
"schema" : { "type" : "integer" , "default" : 20 , "nullable" : true , "minimum" : 0.0 }
} ,
{
"name" : "offset" ,
"in" : "query" ,
"required" : false ,
"schema" : { "type" : "integer" , "default" : 0 , "nullable" : true , "minimum" : 0.0 }
}
] ,
"responses" : {
"200" : {
"description" : "Success" ,
"content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/SearchResponse" } } }
} ,
"501" : { "description" : "When code search is not enabled, the endpoint will returns 501 Not Implemented" }
}
}
2023-07-11 06:02:58 +00:00
}
} ,
"components" : {
"schemas" : {
"Choice" : {
"type" : "object" ,
2023-07-13 08:31:20 +00:00
"required" : [ "index" , "text" ] ,
2023-07-11 06:02:58 +00:00
"properties" : {
2023-08-17 14:28:41 +00:00
"index" : { "type" : "integer" , "format" : "int32" , "minimum" : 0.0 } ,
"text" : { "type" : "string" }
2023-07-11 06:02:58 +00:00
}
} ,
"CompletionRequest" : {
"type" : "object" ,
"properties" : {
"language" : {
"type" : "string" ,
"description" : "Language identifier, full list is maintained at\nhttps://code.visualstudio.com/docs/languages/identifiers" ,
"example" : "python" ,
"nullable" : true
} ,
2023-08-17 14:28:41 +00:00
"segments" : { "allOf" : [ { "$ref" : "#/components/schemas/Segments" } ] , "nullable" : true } ,
2023-11-17 04:30:04 +00:00
"user" : {
"type" : "string" ,
"description" : "A unique identifier representing your end-user, which can help Tabby to monitor & generating\nreports." ,
"nullable" : true
} ,
"debug_options" : { "allOf" : [ { "$ref" : "#/components/schemas/DebugOptions" } ] , "nullable" : true }
2023-07-11 06:02:58 +00:00
} ,
"example" : {
"language" : "python" ,
2023-08-17 14:28:41 +00:00
"segments" : { "prefix" : "def fib(n):\n " , "suffix" : "\n return fib(n - 1) + fib(n - 2)" }
2023-07-11 06:02:58 +00:00
}
} ,
"CompletionResponse" : {
"type" : "object" ,
2023-07-13 08:31:20 +00:00
"required" : [ "id" , "choices" ] ,
2023-07-11 06:02:58 +00:00
"properties" : {
2023-08-17 14:28:41 +00:00
"id" : { "type" : "string" } ,
2023-11-17 04:30:04 +00:00
"choices" : { "type" : "array" , "items" : { "$ref" : "#/components/schemas/Choice" } } ,
"debug_data" : { "allOf" : [ { "$ref" : "#/components/schemas/DebugData" } ] , "nullable" : true }
} ,
"example" : { "choices" : [ { "index" : 0 , "text" : "string" } ] , "id" : "string" }
} ,
"DebugData" : {
"type" : "object" ,
"properties" : {
"snippets" : { "type" : "array" , "items" : { "$ref" : "#/components/schemas/Snippet" } , "nullable" : true } ,
"prompt" : { "type" : "string" , "nullable" : true }
}
} ,
"DebugOptions" : {
"type" : "object" ,
"properties" : {
"raw_prompt" : {
"type" : "string" ,
"description" : "When `raw_prompt` is specified, it will be passed directly to the inference engine for completion. `segments` field in `CompletionRequest` will be ignored.\n\nThis is useful for certain requests that aim to test the tabby's e2e quality." ,
"nullable" : true
} ,
"return_snippets" : { "type" : "boolean" , "description" : "When true, returns `snippets` in `debug_data`." } ,
"return_prompt" : { "type" : "boolean" , "description" : "When true, returns `prompt` in `debug_data`." } ,
"disable_retrieval_augmented_code_completion" : {
"type" : "boolean" ,
"description" : "When true, disable retrieval augmented code completion."
}
2023-07-11 06:02:58 +00:00
}
} ,
"HealthState" : {
"type" : "object" ,
2023-11-17 04:30:04 +00:00
"required" : [ "model" , "device" , "arch" , "cpu_info" , "cpu_count" , "cuda_devices" , "version" ] ,
2023-07-11 06:02:58 +00:00
"properties" : {
2023-08-17 14:28:41 +00:00
"model" : { "type" : "string" } ,
2023-11-17 04:30:04 +00:00
"chat_model" : { "type" : "string" , "nullable" : true } ,
2023-08-17 14:28:41 +00:00
"device" : { "type" : "string" } ,
"arch" : { "type" : "string" } ,
"cpu_info" : { "type" : "string" } ,
2023-09-05 07:06:35 +00:00
"cpu_count" : { "type" : "integer" , "minimum" : 0.0 } ,
"cuda_devices" : { "type" : "array" , "items" : { "type" : "string" } } ,
"version" : { "$ref" : "#/components/schemas/Version" }
2023-07-11 06:02:58 +00:00
}
} ,
2023-11-17 04:30:04 +00:00
"Hit" : {
"type" : "object" ,
"required" : [ "score" , "doc" , "id" ] ,
"properties" : {
"score" : { "type" : "number" , "format" : "float" } ,
"doc" : { "$ref" : "#/components/schemas/HitDocument" } ,
"id" : { "type" : "integer" , "format" : "int32" , "minimum" : 0.0 }
}
} ,
"HitDocument" : {
"type" : "object" ,
"required" : [ "body" , "filepath" , "git_url" , "kind" , "language" , "name" ] ,
"properties" : {
"body" : { "type" : "string" } ,
"filepath" : { "type" : "string" } ,
"git_url" : { "type" : "string" } ,
"kind" : { "type" : "string" } ,
"language" : { "type" : "string" } ,
"name" : { "type" : "string" }
}
} ,
2023-07-11 06:02:58 +00:00
"LogEventRequest" : {
"type" : "object" ,
2023-07-13 08:31:20 +00:00
"required" : [ "type" , "completion_id" , "choice_index" ] ,
2023-07-11 06:02:58 +00:00
"properties" : {
2023-08-17 14:28:41 +00:00
"type" : { "type" : "string" , "description" : "Event type, should be `view` or `select`." , "example" : "view" } ,
"completion_id" : { "type" : "string" } ,
"choice_index" : { "type" : "integer" , "format" : "int32" , "minimum" : 0.0 }
2023-07-11 06:02:58 +00:00
}
} ,
2023-11-17 04:30:04 +00:00
"SearchResponse" : {
"type" : "object" ,
"required" : [ "num_hits" , "hits" ] ,
"properties" : {
"num_hits" : { "type" : "integer" , "minimum" : 0.0 } ,
"hits" : { "type" : "array" , "items" : { "$ref" : "#/components/schemas/Hit" } }
}
} ,
2023-07-11 06:02:58 +00:00
"Segments" : {
"type" : "object" ,
2023-07-13 08:31:20 +00:00
"required" : [ "prefix" ] ,
2023-07-11 06:02:58 +00:00
"properties" : {
2023-08-17 14:28:41 +00:00
"prefix" : { "type" : "string" , "description" : "Content that appears before the cursor in the editor window." } ,
2023-07-11 06:02:58 +00:00
"suffix" : {
"type" : "string" ,
"description" : "Content that appears after the cursor in the editor window." ,
"nullable" : true
}
}
2023-09-05 07:06:35 +00:00
} ,
2023-11-17 04:30:04 +00:00
"Snippet" : {
"type" : "object" ,
"required" : [ "filepath" , "body" , "score" ] ,
"properties" : {
"filepath" : { "type" : "string" } ,
"body" : { "type" : "string" } ,
"score" : { "type" : "number" , "format" : "float" }
}
} ,
2023-09-05 07:06:35 +00:00
"Version" : {
"type" : "object" ,
"required" : [ "build_date" , "build_timestamp" , "git_sha" , "git_describe" ] ,
"properties" : {
"build_date" : { "type" : "string" } ,
"build_timestamp" : { "type" : "string" } ,
"git_sha" : { "type" : "string" } ,
"git_describe" : { "type" : "string" }
}
2023-07-11 06:02:58 +00:00
}
}
}
}