chore: Add app config example

This commit is contained in:
Fangyin Cheng 2025-03-17 16:22:27 +08:00
parent 82392dc4eb
commit 285c5e5d59
14 changed files with 77 additions and 19 deletions

View File

@ -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}"

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -17,7 +17,7 @@ host = "127.0.0.1"
[rag.storage]
[rag.storage.vector]
type = "Chroma"
type = "chroma"
persist_path = "pilot/data"
# Model Configurations

View File

@ -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

View File

@ -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

View File

@ -22,7 +22,7 @@ host = "127.0.0.1"
[rag.storage]
[rag.storage.vector]
type = "Chroma"
type = "chroma"
persist_path = "pilot/data"
# Model Configurations

View File

@ -17,7 +17,7 @@ host = "127.0.0.1"
[rag.storage]
[rag.storage.vector]
type = "Chroma"
type = "chroma"
persist_path = "pilot/data"
# Model Configurations

View File

@ -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

View File

@ -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"