-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add CLI Signed-off-by: cbh778899 <[email protected]> * remove setup executable Signed-off-by: cbh778899 <[email protected]> * fix environment variable not set bug Signed-off-by: cbh778899 <[email protected]> * add setup executable Signed-off-by: cbh778899 <[email protected]> * add readme for CLI Signed-off-by: cbh778899 <[email protected]> --------- Signed-off-by: cbh778899 <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,496 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ eslint.config.mjs | |
LICENSE | ||
volumes | ||
docker-compose* | ||
Makefile | ||
Makefile | ||
setup | ||
generate_production_env.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
APP_PORT=8000 | ||
APP_EXPOSE_PORT=8000 | ||
ENG_ACCESS_PORT=8080 | ||
MODEL_SAVE_PATH=volumes/models | ||
INFERENCE_ENG=llamacpp | ||
INFERENCE_ENG_PORT=8080 | ||
INFERENCE_ENG_VERSION=server--b1-2321a5e | ||
INFERENCE_ENG_VERSION=server--b1-27d4b7c | ||
NUM_CPU_CORES=8.00 | ||
NUM_THREADS_COUNT=8 | ||
NUM_THREADS_COUNT=8.00 | ||
EMBEDDING_ENG=embedding_eng | ||
EMBEDDING_ENG_PORT=8081 | ||
NUM_CPU_CORES_EMBEDDING=4.00 | ||
NUM_THREAD_COUNTS_EMBEDDING=4.00 | ||
LANGUAGE_MODEL_NAME=Phi3-mini-4k-instruct-Q4.gguf | ||
LANGUAGE_MODEL_URL=https://huggingface.co/aisuko/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi3-mini-4k-instruct-Q4.gguf?download=true | ||
EMBEDDING_MODEL_NAME=all-MiniLM-L6-v2-Q4_K_M-v2.gguf | ||
EMBEDDING_MODEL_URL=https://huggingface.co/aisuko/all-MiniLM-L6-v2-gguf/resolve/main/all-MiniLM-L6-v2-Q4_K_M-v2.gguf?download=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
.git | ||
volumes | ||
__pycache__ | ||
__pycache__ | ||
setup/setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
services: | ||
llamacpp: | ||
container_name: ${INFERENCE_ENG} | ||
image: gclub/llama.cpp:${INFERENCE_ENG_VERSION} | ||
restart: always | ||
deploy: # https://github.com/compose-spec/compose-spec/blob/master/deploy.md | ||
resources: | ||
reservations: | ||
cpus: "${NUM_CPU_CORES}" | ||
volumes: | ||
- "${DOCKER_VOLUME_DIRECTORY:-.}/${MODEL_SAVE_PATH}:/models" | ||
expose: | ||
- ${ENG_ACCESS_PORT} | ||
ports: | ||
- ${INFERENCE_ENG_PORT}:${ENG_ACCESS_PORT} | ||
command: ["-m", "models/${LANGUAGE_MODEL_NAME}","-t","${NUM_THREADS_COUNT}","-c","8192"] | ||
|
||
embedding_eng: | ||
container_name: ${EMBEDDING_ENG} | ||
image: gclub/llama.cpp:${INFERENCE_ENG_VERSION} | ||
restart: always | ||
deploy: # https://github.com/compose-spec/compose-spec/blob/master/deploy.md | ||
resources: | ||
reservations: | ||
cpus: "${NUM_CPU_CORES_EMBEDDING}" | ||
volumes: | ||
- "${DOCKER_VOLUME_DIRECTORY:-.}/${MODEL_SAVE_PATH}:/models" | ||
expose: | ||
- ${ENG_ACCESS_PORT} | ||
ports: | ||
- ${EMBEDDING_ENG_PORT}:${ENG_ACCESS_PORT} | ||
command: ["-m", "models/${EMBEDDING_MODEL_NAME}","--embeddings","--pooling","mean","-t","${NUM_THREAD_COUNTS_EMBEDDING}","-c","512"] | ||
|
||
voyager: | ||
container_name: voyager | ||
restart: always | ||
build: | ||
dockerfile: setup/Dockerfile | ||
context: . | ||
expose: | ||
- ${APP_EXPOSE_PORT} | ||
ports: | ||
- ${APP_EXPOSE_PORT}:${APP_PORT} | ||
depends_on: | ||
- llamacpp | ||
- embedding_eng |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:20.15.1-slim | ||
WORKDIR /app | ||
COPY . . | ||
|
||
HEALTHCHECK --interval=300s --timeout=30s --start-period=5s --retries=3 CMD [ "node", "healthy-check.js" ] | ||
RUN npm install -g pnpm && pnpm install | ||
ENTRYPOINT [ "npm", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "setup_types.h" | ||
|
||
#ifndef SETUP_CONFIG_H | ||
#define SETUP_CONFIG_H | ||
|
||
#define INFERENCE_MODEL_NAME "Phi3-mini-4k-instruct-Q4.gguf" | ||
#define INFERENCE_MODEL_URL "https://huggingface.co/aisuko/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi3-mini-4k-instruct-Q4.gguf" | ||
#define INFERENCE_CPU_CORES 8.00 | ||
#define INFERENCE_THREAD_COUNTS 8.00 | ||
|
||
#define EMBEDDING_CPU_CORES 4.00 | ||
#define EMBEDDING_THREAD_COUNTS 4.00 | ||
|
||
#define ALLOW_ORIGIN_NAME "*" | ||
|
||
#define HTTPS_ENABLED 0 | ||
#define HTTPS_CERT_PATH_HOST "*" | ||
#define HTTPS_CERT_PATH_CONTAINER "*" | ||
#define HTTPS_CERT_NAME "cert.pem" | ||
#define HTTPS_PRIVKEY_NAME "privkey.pem" | ||
#define HTTPS_CA_NAME "chain.pem" | ||
#define APP_EXPOSE_PORT "8000" | ||
|
||
#define PLUGIN_ENABLED 0 | ||
|
||
#define SYSTEM_INSTRUCTION "*" | ||
|
||
#define STATIC_API_KEY_ENABLED 0 | ||
#define STATIC_API_KEY "*" | ||
|
||
#define DEFAULT_DATASET_ENABLED 0 | ||
#define DEFAULT_DATASET_NAME "production_dataset" | ||
|
||
#define API_INDEX_DOC_ENABLED 1 | ||
#define API_INDEX_STATS_ENABLED 1 | ||
#define API_INDEX_HEALTHY_ENABLED 1 | ||
#define API_INFERENCE_COMP_ENABLED 1 | ||
#define API_INFERENCE_RAG_ENABLED 1 | ||
#define API_TOKEN_ENABLED 1 | ||
#define API_EMBEDDING_CALC_ENABLED 1 | ||
#define API_EMBEDDING_DS_ENABLED 1 | ||
#define API_VERSION_ENABLED 1 | ||
|
||
#define DEV_MODE_ENABLED 0 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "setup_types.h" | ||
|
||
#ifndef SETUP_DEFAULT_CONFIG_H | ||
#define SETUP_DEFAULT_CONFIG_H | ||
|
||
#define DEFAULT_INFERENCE_MODEL_NAME MODEL_PHI_NAME | ||
#define DEFAULT_INFERENCE_MODEL_URL MODEL_PHI_URL | ||
#define DEFAULT_INFERENCE_CPU_CORES 8.00 | ||
#define DEFAULT_INFERENCE_THREAD_COUNTS 8.00 | ||
|
||
#define DEFAULT_EMBEDDING_CPU_CORES 4.00 | ||
#define DEFAULT_EMBEDDING_THREAD_COUNTS 4.00 | ||
|
||
#define DEFAULT_ALLOW_ORIGIN_NAME "*" | ||
|
||
#define DEFAULT_HTTPS_ENABLED 0 | ||
#define DEFAULT_HTTPS_CERT_PATH_HOST "*" | ||
#define DEFAULT_HTTPS_CERT_PATH_CONTAINER "*" | ||
#define DEFAULT_HTTPS_CERT_NAME "cert.pem" | ||
#define DEFAULT_HTTPS_PRIVKEY_NAME "privkey.pem" | ||
#define DEFAULT_HTTPS_CA_NAME "chain.pem" | ||
#define DEFAULT_APP_EXPOSE_PORT "8000" | ||
|
||
#define DEFAULT_PLUGIN_ENABLED 0 | ||
|
||
#define DEFAULT_SYSTEM_INSTRUCTION "*" | ||
|
||
#define DEFAULT_STATIC_API_KEY_ENABLED 0 | ||
#define DEFAULT_STATIC_API_KEY "*" | ||
|
||
#define DEFAULT_DEFAULT_DATASET_ENABLED 0 | ||
#define DEFAULT_DEFAULT_DATASET_NAME "production_dataset" | ||
|
||
#define DEFAULT_API_INDEX_DOC_ENABLED 1 | ||
#define DEFAULT_API_INDEX_STATS_ENABLED 1 | ||
#define DEFAULT_API_INDEX_HEALTHY_ENABLED 1 | ||
#define DEFAULT_API_INFERENCE_COMP_ENABLED 1 | ||
#define DEFAULT_API_INFERENCE_RAG_ENABLED 1 | ||
#define DEFAULT_API_TOKEN_ENABLED 1 | ||
#define DEFAULT_API_EMBEDDING_CALC_ENABLED 1 | ||
#define DEFAULT_API_EMBEDDING_DS_ENABLED 1 | ||
#define DEFAULT_API_VERSION_ENABLED 1 | ||
|
||
#define DEFAULT_DEV_MODE_ENABLED 0 | ||
|
||
#endif |
Oops, something went wrong.