2023-03-27 04:09:07 +00:00
< div align = "center" >
2023-03-27 04:45:59 +00:00
2023-03-27 04:09:07 +00:00
# 🐾 Tabby
2023-03-16 09:28:20 +00:00
[](https://opensource.org/licenses/Apache-2.0)
2023-03-16 09:26:43 +00:00
[](https://github.com/psf/black)
2023-03-22 15:20:24 +00:00

2023-04-09 10:08:07 +00:00
[](https://hub.docker.com/r/tabbyml/tabby)
2023-03-27 04:45:59 +00:00
2023-04-02 12:47:31 +00:00

2023-03-27 04:45:59 +00:00
2023-03-27 04:09:07 +00:00
< / div >
2023-03-16 09:26:43 +00:00
2023-04-06 11:18:09 +00:00
Self-hosted AI coding assistant. An opensource / on-prem alternative to GitHub Copilot.
2023-03-16 09:26:43 +00:00
> **Warning**
2023-04-06 18:51:55 +00:00
> Tabby is still in the alpha phase
2023-03-27 04:09:07 +00:00
## Features
* Self-contained, with no need for a DBMS or cloud service
* Web UI for visualizing and configuration models and MLOps.
* OpenAPI interface, easy to integrate with existing infrastructure (e.g Cloud IDE).
* Consumer level GPU supports (FP-16 weight loading with various optimization).
2023-03-16 10:23:45 +00:00
2023-04-06 16:30:35 +00:00
## Demo
2023-04-06 16:35:48 +00:00
< p align = "center" >
< a href = "https://huggingface.co/spaces/TabbyML/tabby" > < img alt = "Open in Spaces" src = "https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-md.svg" > < / a >
< / p >
2023-04-06 16:30:00 +00:00
< p align = "center" >
< img alt = "Demo" src = "https://user-images.githubusercontent.com/388154/230440226-9bc01d05-9f57-478b-b04d-81184eba14ca.gif" >
< / p >
2023-04-11 07:44:23 +00:00
## Get started: Server
2023-03-27 04:59:08 +00:00
### Docker
2023-04-09 10:31:32 +00:00
**NOTE**: Tabby requires [Pascal or newer ](https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ ) NVIDIA GPU.
2023-04-07 16:57:03 +00:00
2023-04-07 16:54:07 +00:00
Before running Tabby, ensure the installation of the [NVIDIA Container Toolkit ](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html ).
We suggest using NVIDIA drivers that are compatible with CUDA version 11.8 or higher.
2023-03-27 04:54:37 +00:00
```bash
2023-04-05 15:13:34 +00:00
# Create data dir and grant owner to 1000 (Tabby run as uid 1000 in container)
mkdir -p data/hf_cache & & chown -R 1000 data
2023-04-05 16:24:33 +00:00
docker run \
--gpus all \
-it --rm \
2023-04-10 16:12:34 +00:00
-v "/$(pwd)/data:/data" \
-v "/$(pwd)/data/hf_cache:/home/app/.cache/huggingface" \
2023-04-05 16:24:33 +00:00
-p 5000:5000 \
-e MODEL_NAME=TabbyML/J-350M \
-e MODEL_BACKEND=triton \
2023-04-07 16:54:07 +00:00
--name=tabby \
2023-04-05 16:24:33 +00:00
tabbyml/tabby
2023-03-29 04:57:03 +00:00
```
2023-04-05 16:25:16 +00:00
You can then query the server using `/v1/completions` endpoint:
```bash
curl -X POST http://localhost:5000/v1/completions -H 'Content-Type: application/json' --data '{
"prompt": "def binarySearch(arr, left, right, x):\n mid = (left +"
}'
```
2023-04-06 09:02:10 +00:00
We also provides an interactive playground in admin panel [localhost:5000/_admin ](http://localhost:5000/_admin )
2023-03-27 04:54:37 +00:00
2023-04-02 12:32:49 +00:00
### Skypilot
See [deployment/skypilot/README.md ](./deployment/skypilot/README.md )
2023-04-11 07:44:23 +00:00
## Getting Started: Client
We offer multiple methods to connect to Tabby Server, including using OpenAPI and editor extensions.
2023-03-27 04:59:08 +00:00
2023-04-11 07:44:23 +00:00
### API
2023-04-11 07:47:19 +00:00
Tabby has opened a FastAPI server at [localhost:5000 ](https://localhost:5000 ), which includes an OpenAPI documentation of the HTTP API. The same API documentation is also hosted at https://tabbyml.github.io/tabby
2023-04-11 07:44:23 +00:00
### Editor Extensions
* [VSCode Extension ](./clients/vscode )
2023-04-11 09:40:43 +00:00
* [VIM Extension ](./clients/vim )
2023-03-27 04:59:08 +00:00
2023-03-27 05:07:41 +00:00
## Development
Go to `development` directory.
2023-03-28 13:06:45 +00:00
```bash
2023-03-27 05:07:41 +00:00
make dev
```
or
2023-03-28 13:06:45 +00:00
```bash
2023-04-05 16:49:36 +00:00
make dev-triton # Turn on triton backend (for cuda env developers)
2023-03-27 05:07:41 +00:00
```