parent
28922bf9d9
commit
ef483564fe
|
|
@ -51,9 +51,16 @@ COPY poetry.lock pyproject.toml ./
|
|||
RUN poetry export --without-hashes > requirements.txt
|
||||
RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL --no-dependencies -r requirements.txt
|
||||
|
||||
|
||||
COPY tabby ./tabby
|
||||
|
||||
# Install caddy
|
||||
RUN <<EOF
|
||||
curl -L "https://github.com/caddyserver/caddy/releases/download/v2.6.4/caddy_2.6.4_linux_amd64.tar.gz" -o caddy.tar.gz
|
||||
tar zxvf caddy.tar.gz
|
||||
mv caddy ~/.bin/
|
||||
rm caddy.tar.gz README.md LICENSE
|
||||
EOF
|
||||
|
||||
# Setup file permissions
|
||||
USER root
|
||||
RUN mkdir -p /var/lib/vector
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ docker run \
|
|||
-v ./data:/data \
|
||||
-v ./data/hf_cache:/home/app/.cache/huggingface \
|
||||
-p 5000:5000 \
|
||||
-p 8501:8501 \
|
||||
-p 8080:8080 \
|
||||
-e MODEL_NAME=TabbyML/J-350M \
|
||||
tabbyml/tabby
|
||||
```
|
||||
|
|
@ -50,8 +48,6 @@ docker run \
|
|||
-v ./data:/data \
|
||||
-v ./data/hf_cache:/home/app/.cache/huggingface \
|
||||
-p 5000:5000 \
|
||||
-p 8501:8501 \
|
||||
-p 8080:8080 \
|
||||
-e MODEL_NAME=TabbyML/J-350M \
|
||||
-e MODEL_BACKEND=triton \
|
||||
tabbyml/tabby
|
||||
|
|
@ -65,7 +61,7 @@ curl -X POST http://localhost:5000/v1/completions -H 'Content-Type: application/
|
|||
}'
|
||||
```
|
||||
|
||||
We also provides an interactive playground in admin panel [localhost:8501](http://localhost:8501)
|
||||
We also provides an interactive playground in admin panel [localhost:5000/_admin](http://localhost:5000/_admin)
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ services:
|
|||
MODEL_NAME: ${MODEL_NAME}
|
||||
ports:
|
||||
- "5000:5000"
|
||||
- "8080:8080"
|
||||
- "8501:8501"
|
||||
volumes:
|
||||
- ${DATA_VOLUME}
|
||||
- ${HF_VOLUME}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ services:
|
|||
UVICORN_RELOAD: true
|
||||
VECTOR_WATCH_CONFIG: true
|
||||
STREAMLIT_RUN_ON_SAVE: true
|
||||
CADDY_WATCH_CONFIG: true
|
||||
volumes:
|
||||
- ../tabby:/home/app/tabby
|
||||
|
|
|
|||
|
|
@ -4,24 +4,35 @@ from utils.service_info import ServiceInfo
|
|||
SERVICES = [
|
||||
ServiceInfo(label="triton", health_url="http://localhost:8002/metrics"),
|
||||
ServiceInfo(label="vector", health_url="http://localhost:8686/health"),
|
||||
ServiceInfo(
|
||||
label="dagu", health_url="http://localhost:8080", url="http://localhost:8080"
|
||||
),
|
||||
ServiceInfo(
|
||||
label="server", health_url="http://localhost:5000", url="http://localhost:5000"
|
||||
),
|
||||
ServiceInfo(label="dagu", health_url="http://localhost:8083"),
|
||||
ServiceInfo(label="server", health_url="http://localhost:8081"),
|
||||
]
|
||||
|
||||
|
||||
def make_badge_markdown(x: ServiceInfo):
|
||||
badge = f""
|
||||
if x.url:
|
||||
return f"[{badge}]({x.url})"
|
||||
else:
|
||||
return badge
|
||||
return f""
|
||||
|
||||
|
||||
st.set_page_config(page_title="Tabby Admin - Home")
|
||||
st.set_page_config(page_title="Tabby Admin - Home", layout="wide")
|
||||
|
||||
st.markdown("## Tabby")
|
||||
st.markdown(" $~$ ".join(map(make_badge_markdown, SERVICES)))
|
||||
badges = " ".join(map(make_badge_markdown, SERVICES))
|
||||
st.markdown(
|
||||
"""
|
||||
## Tabby
|
||||
{badges}
|
||||
---
|
||||
|
||||
**Congrats, your server is live!**
|
||||
|
||||
you can now 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 +"
|
||||
}'
|
||||
```
|
||||
|
||||
""".replace(
|
||||
"{badges}", badges
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"files": {
|
||||
"main.js": "./static/js/main.0db4b0d6.js",
|
||||
"main.js": "./static/js/main.13cf5263.js",
|
||||
"index.html": "./index.html"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/main.0db4b0d6.js"
|
||||
"static/js/main.13cf5263.js"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><title>Streamlit Component</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Streamlit Component"/><link rel="stylesheet" href="bootstrap.min.css"/><script defer="defer" src="./static/js/main.0db4b0d6.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><title>Streamlit Component</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Streamlit Component"/><link rel="stylesheet" href="bootstrap.min.css"/><script defer="defer" src="./static/js/main.13cf5263.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -12,7 +12,7 @@ export default function MonacoEditor() {
|
|||
if (renderData.args.tabby_server_url) {
|
||||
TabbyServerURL = renderData.args.tabby_server_url
|
||||
} else {
|
||||
TabbyServerURL = `${window.location.protocol}//${window.location.hostname}:5000`
|
||||
TabbyServerURL = `${window.location.protocol}//${window.location.host}`
|
||||
}
|
||||
|
||||
const monaco = useMonaco()
|
||||
|
|
|
|||
|
|
@ -1999,11 +1999,6 @@
|
|||
resolved "https://registry.npmmirror.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0"
|
||||
integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==
|
||||
|
||||
"@types/prop-types@*":
|
||||
version "15.7.5"
|
||||
resolved "https://registry.npmmirror.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
|
||||
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
|
||||
|
||||
"@types/q@^1.5.1":
|
||||
version "1.5.5"
|
||||
resolved "https://registry.npmmirror.com/@types/q/-/q-1.5.5.tgz#75a2a8e7d8ab4b230414505d92335d1dcb53a6df"
|
||||
|
|
@ -2019,22 +2014,6 @@
|
|||
resolved "https://registry.npmmirror.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc"
|
||||
integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==
|
||||
|
||||
"@types/react-dom@^18.0.11":
|
||||
version "18.0.11"
|
||||
resolved "https://registry.npmmirror.com/@types/react-dom/-/react-dom-18.0.11.tgz#321351c1459bc9ca3d216aefc8a167beec334e33"
|
||||
integrity sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react@*", "@types/react@^18.0.29":
|
||||
version "18.0.29"
|
||||
resolved "https://registry.npmmirror.com/@types/react/-/react-18.0.29.tgz#4cead505172c0020c5b51940199e31fc6ff2f63a"
|
||||
integrity sha512-wXHktgUABxplw1+UnljseDq4+uztQyp2tlWZRIxHlpchsCFqiYkvaDS8JR7eKOQm8wziTH/el5qL7D6gYNkYcw==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/resolve@1.17.1":
|
||||
version "1.17.1"
|
||||
resolved "https://registry.npmmirror.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
|
||||
|
|
@ -2047,11 +2026,6 @@
|
|||
resolved "https://registry.npmmirror.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d"
|
||||
integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==
|
||||
|
||||
"@types/scheduler@*":
|
||||
version "0.16.3"
|
||||
resolved "https://registry.npmmirror.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5"
|
||||
integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==
|
||||
|
||||
"@types/semver@^7.3.12":
|
||||
version "7.3.13"
|
||||
resolved "https://registry.npmmirror.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
|
||||
|
|
@ -3554,11 +3528,6 @@ cssstyle@^2.3.0:
|
|||
dependencies:
|
||||
cssom "~0.3.6"
|
||||
|
||||
csstype@^3.0.2:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.npmmirror.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9"
|
||||
integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==
|
||||
|
||||
damerau-levenshtein@^1.0.8:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.npmmirror.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7"
|
||||
|
|
@ -8781,11 +8750,6 @@ typedarray-to-buffer@^3.1.5:
|
|||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@^4.6.2:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.npmmirror.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
typical@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.npmmirror.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import streamlit as st
|
||||
from components import monaco
|
||||
|
||||
st.set_page_config(page_title="Tabby Admin - Editor")
|
||||
st.set_page_config(page_title="Tabby Admin - Editor", layout="wide")
|
||||
|
||||
st.markdown("## Editor")
|
||||
st.markdown("---")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import os
|
|||
import duckdb
|
||||
import streamlit as st
|
||||
|
||||
st.set_page_config(page_title="Tabby Admin - Metrics")
|
||||
st.set_page_config(page_title="Tabby Admin - Metrics", layout="wide")
|
||||
|
||||
|
||||
def query_data():
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import toml
|
|||
from datasets import load_from_disk
|
||||
from git import Repo
|
||||
|
||||
st.set_page_config(page_title="Tabby Admin - Projects")
|
||||
st.set_page_config(page_title="Tabby Admin - Projects", layout="wide")
|
||||
|
||||
dataset_dir = os.environ.get("DATASET_DIR", None)
|
||||
git_repositories_dir = os.environ.get("GIT_REPOSITORIES_DIR", None)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from dataclasses import dataclass
|
||||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from requests.exceptions import ConnectionError
|
||||
|
|
@ -9,7 +8,6 @@ from requests.exceptions import ConnectionError
|
|||
class ServiceInfo:
|
||||
label: str
|
||||
health_url: str
|
||||
url: Optional[str] = None
|
||||
|
||||
@property
|
||||
def is_health(self) -> bool:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
http_port 5000
|
||||
}
|
||||
|
||||
http://localhost {
|
||||
reverse_proxy localhost:8081
|
||||
reverse_proxy /_admin* localhost:8082
|
||||
}
|
||||
|
||||
http://dagu.localhost {
|
||||
reverse_proxy localhost:8083
|
||||
}
|
||||
|
|
@ -40,7 +40,18 @@ command=./tabby/scripts/triton.sh
|
|||
EOF
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
program:caddy() {
|
||||
if [[ "$CADDY_WATCH_CONFIG" == "true" ]]
|
||||
then
|
||||
local CADDY_ARGS=" --watch"
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
[program:caddy]
|
||||
command=caddy run --config tabby/config/Caddyfile $CADDY_ARGS
|
||||
EOF
|
||||
}
|
||||
|
||||
supervisor() {
|
||||
|
|
@ -53,10 +64,10 @@ logfile = ${LOGS_DIR}/supervisord.log
|
|||
loglevel = debug
|
||||
|
||||
[program:server]
|
||||
command=uvicorn tabby.server:app --host 0.0.0.0 --port 5000
|
||||
command=uvicorn tabby.server:app --port 8081
|
||||
|
||||
[program:admin]
|
||||
command=streamlit run tabby/admin/Home.py --server.port 8501 --theme.base=dark
|
||||
command=streamlit run tabby/admin/Home.py --server.port 8082 --server.baseUrlPath=/_admin --theme.base=dark
|
||||
|
||||
[program:vector]
|
||||
command=vector --config-toml tabby/config/vector.toml
|
||||
|
|
@ -65,9 +76,11 @@ command=vector --config-toml tabby/config/vector.toml
|
|||
command=dagu scheduler
|
||||
|
||||
[program:dagu_server]
|
||||
command=dagu server --host 0.0.0.0 --port 8080
|
||||
command=dagu server --host 0.0.0.0 --port 8083
|
||||
|
||||
$(program:triton)
|
||||
|
||||
$(program:caddy)
|
||||
EOF
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ from .models import (
|
|||
|
||||
app = FastAPI(
|
||||
title="TabbyServer",
|
||||
description="TabbyServer is the backend for tabby, serving code completion requests from code editor / IDE.",
|
||||
description="""TabbyServer is the backend for tabby, serving code completion requests from code editor / IDE.
|
||||
* [Admin Panel](./_admin)
|
||||
""",
|
||||
docs_url="/",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue