diff --git a/configs/dbgpt-app-config.example.toml b/configs/dbgpt-app-config.example.toml new file mode 100644 index 000000000..a8fe64877 --- /dev/null +++ b/configs/dbgpt-app-config.example.toml @@ -0,0 +1,47 @@ +[system] +# Load language from environment variable(It is set by the hook) +language = "${env:DBGPT_LANG:-zh}" +log_level = "INFO" +api_keys = [] +encrypt_key = "your_secret_key" + +# Server Configurations +[service.web] +host = "0.0.0.0" +port = 5670 + +[service.web.database] +type = "sqlite" +path = "pilot/meta_data/dbgpt.db" + +[app] +temperature = 0.6 + +[[app.configs]] +name = "chat_excel" +temperature = 0.1 +duckdb_extensions_dir = [] +force_install = true + +[[app.configs]] +name = "chat_normal" +memory = {type="token", max_token_limit=20000} + +[[app.configs]] +name = "chat_with_db_qa" +schema_retrieve_top_k = 50 +memory = {type="token", max_token_limit=20000} + +# Model Configurations +[models] +[[models.llms]] +name = "${env:LLM_MODEL_NAME:-gpt-4o}" +provider = "${env:LLM_MODEL_PROVIDER:-proxy/openai}" +api_base = "${env:OPENAI_API_BASE:-https://api.openai.com/v1}" +api_key = "${env:OPENAI_API_KEY}" + +[[models.embeddings]] +name = "${env:EMBEDDING_MODEL_NAME:-text-embedding-3-small}" +provider = "${env:EMBEDDING_MODEL_PROVIDER:-proxy/openai}" +api_url = "${env:EMBEDDING_MODEL_API_URL:-https://api.openai.com/v1/embeddings}" +api_key = "${env:OPENAI_API_KEY}" diff --git a/configs/dbgpt-graphrag.toml b/configs/dbgpt-graphrag.toml index 7e3c8c4ac..2c1007fd4 100644 --- a/configs/dbgpt-graphrag.toml +++ b/configs/dbgpt-graphrag.toml @@ -26,11 +26,11 @@ rerank_top_k=3 [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" [rag.storage.graph] -type = "TuGraph" +type = "tugraph" host="127.0.0.1" port=7687 username="admin" diff --git a/configs/dbgpt-local-glm.toml b/configs/dbgpt-local-glm.toml index c829b7dc2..08eafc740 100644 --- a/configs/dbgpt-local-glm.toml +++ b/configs/dbgpt-local-glm.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-local-llama-cpp-server.toml b/configs/dbgpt-local-llama-cpp-server.toml index 8467c3538..05b72e41b 100644 --- a/configs/dbgpt-local-llama-cpp-server.toml +++ b/configs/dbgpt-local-llama-cpp-server.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-local-llama-cpp.toml b/configs/dbgpt-local-llama-cpp.toml index ac59a47f0..dd4accae1 100644 --- a/configs/dbgpt-local-llama-cpp.toml +++ b/configs/dbgpt-local-llama-cpp.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-local-qwen.toml b/configs/dbgpt-local-qwen.toml index 7701b8826..2c6c35a31 100644 --- a/configs/dbgpt-local-qwen.toml +++ b/configs/dbgpt-local-qwen.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-local-vllm.toml b/configs/dbgpt-local-vllm.toml index e58712819..3c7fa82a5 100644 --- a/configs/dbgpt-local-vllm.toml +++ b/configs/dbgpt-local-vllm.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-proxy-deepseek.toml b/configs/dbgpt-proxy-deepseek.toml index 1ca4ba539..3ffa960d0 100644 --- a/configs/dbgpt-proxy-deepseek.toml +++ b/configs/dbgpt-proxy-deepseek.toml @@ -17,7 +17,7 @@ host = "127.0.0.1" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-proxy-ollama.toml b/configs/dbgpt-proxy-ollama.toml index 51fbcc19e..bba102c6e 100644 --- a/configs/dbgpt-proxy-ollama.toml +++ b/configs/dbgpt-proxy-ollama.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-proxy-openai.toml b/configs/dbgpt-proxy-openai.toml index 5bcbb2333..ad7e2eb69 100644 --- a/configs/dbgpt-proxy-openai.toml +++ b/configs/dbgpt-proxy-openai.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-proxy-siliconflow-mysql.toml b/configs/dbgpt-proxy-siliconflow-mysql.toml index 76f884f0f..7da199a9b 100644 --- a/configs/dbgpt-proxy-siliconflow-mysql.toml +++ b/configs/dbgpt-proxy-siliconflow-mysql.toml @@ -22,7 +22,7 @@ host = "127.0.0.1" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-proxy-siliconflow.toml b/configs/dbgpt-proxy-siliconflow.toml index bca727a08..ac1731903 100644 --- a/configs/dbgpt-proxy-siliconflow.toml +++ b/configs/dbgpt-proxy-siliconflow.toml @@ -17,7 +17,7 @@ host = "127.0.0.1" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/configs/dbgpt-proxy-tongyi.toml b/configs/dbgpt-proxy-tongyi.toml index 2935a135d..719e9cc42 100644 --- a/configs/dbgpt-proxy-tongyi.toml +++ b/configs/dbgpt-proxy-tongyi.toml @@ -15,7 +15,7 @@ path = "pilot/meta_data/dbgpt.db" [rag.storage] [rag.storage.vector] -type = "Chroma" +type = "chroma" persist_path = "pilot/data" # Model Configurations diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 31801d1a8..bc37ecc3d 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -7,18 +7,24 @@ ARG BASE_IMAGE ARG PYTHON_VERSION=3.11 # Use Tsinghua PyPI mirror, It's faster in most countries ARG PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" +ARG UV_TRUSTED_HOST="127.0.0.1" ARG UV_HTTP_TIMEOUT=180 ARG EXTRAS="base,proxy_openai,rag,storage_chromadb,cuda121,hf,quant_bnb,dbgpts" ARG VERSION=latest ARG USE_TSINGHUA_UBUNTU ARG CMAKE_ARGS +ARG INSTALL_RUST="true" ENV PYTHONUNBUFFERED=1 \ DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ PIP_INDEX_URL=${PIP_INDEX_URL} \ + PIP_TRUSTED_HOST=${UV_TRUSTED_HOST} \ + UV_TRUSTED_HOST=${UV_TRUSTED_HOST} \ + UV_INSECURE_HOST=${UV_TRUSTED_HOST} \ UV_HTTP_TIMEOUT=${UV_HTTP_TIMEOUT} \ - CMAKE_ARGS=${CMAKE_ARGS} + CMAKE_ARGS=${CMAKE_ARGS} \ + INSTALL_RUST=${INSTALL_RUST} # Configure apt sources based on the USE_TSINGHUA_UBUNTU parameter RUN if [ "$USE_TSINGHUA_UBUNTU" = "true" ]; then \ @@ -43,14 +49,17 @@ RUN if [ "$USE_TSINGHUA_UBUNTU" = "true" ]; then \ build-essential \ pkg-config \ && rm -rf /var/lib/apt/lists/* \ - && python${PYTHON_VERSION} -m pip install --upgrade pip \ - && python${PYTHON_VERSION} -m pip install --upgrade pipx \ + && python${PYTHON_VERSION} -m pip install --upgrade pip --trusted-host ${UV_TRUSTED_HOST} \ + && python${PYTHON_VERSION} -m pip install --upgrade pipx --trusted-host ${UV_TRUSTED_HOST} \ && python${PYTHON_VERSION} -m pipx ensurepath \ && pipx ensurepath --global \ - && pipx install uv --global + && pipx install uv --global --pip-args="--trusted-host ${UV_TRUSTED_HOST}" # Install Rust toolchain for building lyric-py -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +RUN if [ "$INSTALL_RUST" = "true" ]; then \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \ + fi + ENV PATH="/root/.cargo/bin:${PATH}" WORKDIR /app @@ -65,7 +74,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \ extras=$(echo $EXTRAS | tr ',' '\n' | while read extra; do echo "--extra $extra"; done | tr '\n' ' ') && \ uv sync --frozen --all-packages \ --no-dev $extras \ - --index-url=$PIP_INDEX_URL && \ + --index-url=$PIP_INDEX_URL \ + --trusted-host=$UV_TRUSTED_HOST \ + && \ # Verify installation python -c "import dbgpt; print(dbgpt.__version__)" ARG LANGUAGE="en"