2023-06-07 18:17:00 +00:00
{
"openapi" : "3.0.3" ,
"info" : {
"title" : "Tabby Server" ,
2023-11-10 20:09:07 +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-06-07 18:17:00 +00:00
"license" : {
"name" : "Apache 2.0" ,
"url" : "https://github.com/TabbyML/tabby/blob/main/LICENSE"
} ,
2023-11-10 20:09:07 +00:00
"version" : "0.5.5"
2023-06-07 18:17:00 +00:00
} ,
"servers" : [
{
2023-06-24 01:55:23 +00:00
"url" : "https://playground.app.tabbyml.com" ,
2023-06-13 20:13:03 +00:00
"description" : "Playground server"
2023-06-07 18:17:00 +00:00
}
] ,
"paths" : {
"/v1/completions" : {
"post" : {
"tags" : [
"v1"
] ,
"operationId" : "completion" ,
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CompletionRequest"
}
}
} ,
"required" : true
} ,
"responses" : {
"200" : {
"description" : "Success" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CompletionResponse"
}
}
}
} ,
"400" : {
"description" : "Bad Request"
}
}
}
} ,
"/v1/events" : {
"post" : {
"tags" : [
"v1"
] ,
"operationId" : "event" ,
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/LogEventRequest"
}
}
} ,
"required" : true
} ,
"responses" : {
"200" : {
"description" : "Success"
} ,
"400" : {
"description" : "Bad Request"
}
}
}
2023-06-11 19:28:23 +00:00
} ,
"/v1/health" : {
2023-10-14 08:31:32 +00:00
"get" : {
2023-06-11 19:28:23 +00:00
"tags" : [
"v1"
] ,
"operationId" : "health" ,
"responses" : {
"200" : {
2023-06-13 20:13:03 +00:00
"description" : "Success" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/HealthState"
}
}
}
2023-06-11 19:28:23 +00:00
}
}
}
2023-06-07 18:17:00 +00:00
}
} ,
"components" : {
"schemas" : {
2023-10-14 08:31:32 +00:00
"ChatCompletionChunk" : {
"type" : "object" ,
"required" : [
"content"
] ,
"properties" : {
"content" : {
"type" : "string"
}
}
} ,
"ChatCompletionRequest" : {
"type" : "object" ,
"required" : [
"messages"
] ,
"properties" : {
"messages" : {
"type" : "array" ,
"items" : {
"$ref" : "#/components/schemas/Message"
}
}
} ,
"example" : {
"messages" : [
{
"content" : "What is tail recursion?" ,
"role" : "user"
} ,
{
"content" : "It's a kind of optimization in compiler?" ,
"role" : "assistant"
} ,
{
"content" : "Could you share more details?" ,
"role" : "user"
}
]
}
} ,
2023-06-07 18:17:00 +00:00
"Choice" : {
"type" : "object" ,
"required" : [
"index" ,
"text"
] ,
"properties" : {
"index" : {
"type" : "integer" ,
"format" : "int32" ,
2023-06-16 20:49:45 +00:00
"minimum" : 0
2023-06-07 18:17:00 +00:00
} ,
"text" : {
"type" : "string"
}
}
} ,
"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
} ,
"segments" : {
"allOf" : [
{
"$ref" : "#/components/schemas/Segments"
}
] ,
"nullable" : true
2023-06-16 10:29:28 +00:00
} ,
"user" : {
"type" : "string" ,
2023-10-14 08:31:32 +00:00
"description" : "A unique identifier representing your end-user, which can help Tabby to monitor & generating\nreports." ,
2023-06-16 10:29:28 +00:00
"nullable" : true
}
} ,
"example" : {
"language" : "python" ,
"segments" : {
2023-06-16 20:49:45 +00:00
"prefix" : "def fib(n):\n " ,
2023-06-16 10:29:28 +00:00
"suffix" : "\n return fib(n - 1) + fib(n - 2)"
2023-06-07 18:17:00 +00:00
}
}
} ,
"CompletionResponse" : {
"type" : "object" ,
"required" : [
"id" ,
"choices"
] ,
"properties" : {
"id" : {
"type" : "string"
} ,
"choices" : {
"type" : "array" ,
"items" : {
"$ref" : "#/components/schemas/Choice"
}
}
2023-10-14 08:31:32 +00:00
} ,
"example" : {
"choices" : [
{
"index" : 0 ,
"text" : "string"
}
] ,
"id" : "string"
2023-06-07 18:17:00 +00:00
}
} ,
2023-06-13 20:13:03 +00:00
"HealthState" : {
"type" : "object" ,
"required" : [
"model" ,
"device" ,
2023-08-31 02:29:56 +00:00
"arch" ,
"cpu_info" ,
"cpu_count" ,
"cuda_devices" ,
"version"
2023-06-13 20:13:03 +00:00
] ,
"properties" : {
"model" : {
"type" : "string"
} ,
2023-10-14 08:31:32 +00:00
"chat_model" : {
"type" : "string" ,
"nullable" : true
2023-06-13 20:13:03 +00:00
} ,
2023-10-14 08:31:32 +00:00
"device" : {
2023-06-13 20:13:03 +00:00
"type" : "string"
2023-08-31 02:29:56 +00:00
} ,
"arch" : {
"type" : "string"
} ,
"cpu_info" : {
"type" : "string"
} ,
"cpu_count" : {
"type" : "integer" ,
"minimum" : 0
} ,
"cuda_devices" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"version" : {
"$ref" : "#/components/schemas/Version"
2023-06-13 20:13:03 +00:00
}
}
} ,
2023-10-14 08:31:32 +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
}
}
} ,
"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-06-07 18:17:00 +00:00
"LogEventRequest" : {
"type" : "object" ,
"required" : [
"type" ,
"completion_id" ,
"choice_index"
] ,
"properties" : {
"type" : {
"type" : "string" ,
"description" : "Event type, should be `view` or `select`." ,
"example" : "view"
} ,
"completion_id" : {
"type" : "string"
} ,
"choice_index" : {
"type" : "integer" ,
"format" : "int32" ,
2023-06-16 20:49:45 +00:00
"minimum" : 0
2023-06-07 18:17:00 +00:00
}
}
} ,
2023-10-14 08:31:32 +00:00
"Message" : {
"type" : "object" ,
"required" : [
"role" ,
"content"
] ,
"properties" : {
"role" : {
"type" : "string"
} ,
"content" : {
"type" : "string"
}
}
} ,
"SearchResponse" : {
"type" : "object" ,
"required" : [
"num_hits" ,
"hits"
] ,
"properties" : {
"num_hits" : {
"type" : "integer" ,
"minimum" : 0
} ,
"hits" : {
"type" : "array" ,
"items" : {
"$ref" : "#/components/schemas/Hit"
}
}
}
} ,
2023-06-07 18:17:00 +00:00
"Segments" : {
"type" : "object" ,
"required" : [
"prefix"
] ,
"properties" : {
"prefix" : {
"type" : "string" ,
2023-06-16 10:29:28 +00:00
"description" : "Content that appears before the cursor in the editor window."
2023-06-07 18:17:00 +00:00
} ,
"suffix" : {
"type" : "string" ,
"description" : "Content that appears after the cursor in the editor window." ,
"nullable" : true
}
}
2023-08-31 02:29:56 +00:00
} ,
2023-10-14 08:31:32 +00:00
"Snippet" : {
"type" : "object" ,
"required" : [
"filepath" ,
"body" ,
"score"
] ,
"properties" : {
"filepath" : {
"type" : "string"
} ,
"body" : {
"type" : "string"
} ,
"score" : {
"type" : "number" ,
"format" : "float"
}
}
} ,
2023-08-31 02:29:56 +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-06-07 18:17:00 +00:00
}
}
}
2023-06-16 20:49:45 +00:00
}