Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
2e1fbaf
feat: setting class
Oct 9, 2024
598a68b
feat: support just command to generate the config file
Oct 9, 2024
65b0eba
chore: docstring to introduce the loading mechanism of setting
Oct 9, 2024
53ff113
feat: add api key attr in setting and remove env dev example
Oct 9, 2024
11fbf03
feat: replace part of code that loading from env to setting class
Oct 9, 2024
0607e3d
feat: store other config into configs attr
Oct 9, 2024
d18aa09
feat: optimize the config file path loading function
Oct 18, 2024
e405866
chore: modify the default value for cache mazsize
Oct 18, 2024
86cc040
feat: pushdown the settings into creating container function
Oct 18, 2024
3792bf2
feat: use the setting from object
Oct 18, 2024
859008d
chore: use defensive programming to refactor partial code
Oct 18, 2024
9bc627f
chore: rename the attr that used to store components config
Oct 18, 2024
b84a2a4
feat: add docstring to explain how the processors work and optimize p…
Oct 18, 2024
495fddb
feat: add docstring to explain function and optimize code
Oct 18, 2024
0e6c561
feat: use class to simplify code and mark some deprecated function
Oct 18, 2024
e8ccb07
feat: keep api key and some sensitive information in env variable
Oct 18, 2024
01b5ac8
feat: add command to initialize config.yaml and .env.dev
Oct 18, 2024
3a3116c
chore: make the command colorful
Oct 19, 2024
6090b02
feat: support on docker compose
Oct 21, 2024
ae0d7eb
fix: put the generation model back due to telemerty
Oct 21, 2024
978411f
feat: support on k8s
Oct 21, 2024
74ed4a7
chore: update README for the changes
Oct 22, 2024
220ec03
chore: write the configuration page to explain the mechanism
Oct 22, 2024
4b45c2e
chore: separate the full config and example config
Oct 22, 2024
0efcc4b
chore: upgrade the version of just command runner
Oct 22, 2024
b95fa59
chore: temporarily leave the old env variable for test case and other…
Oct 22, 2024
f942eba
fix: test cases failed due to lacking some config
Oct 22, 2024
9c8c85c
feat: compatible to the old loading mechanism
Oct 22, 2024
8bbdf86
fix: wrong path of test config
Oct 22, 2024
9399977
feat: add test case to ensure the providers function
Oct 22, 2024
e3bdc11
chore: solve the conflict of docker README
Oct 23, 2024
7dbd71a
chore: test cases to ensure the config module working as expect
Oct 23, 2024
aaeebc1
fix: scope the env var effect to avoid affecting other test cases
Oct 23, 2024
e8d81dc
chore: update the document to mention the Just command version
Oct 24, 2024
2f9a9c3
chore: add the comment to mention why didn't remove the GENERATION_MO…
Oct 24, 2024
49dff33
chore: update the Just command for more user friendly
Oct 24, 2024
15302b8
fix: pass the true for force deploying as default
Oct 24, 2024
b4b0949
feat: put the step to generate config.yaml inside the bootstrap
Oct 24, 2024
39de25a
remove old cold
cyyeh Oct 28, 2024
c26f5ac
update docker instructions
cyyeh Oct 29, 2024
ce4364d
chore: put the langfuse key into env example
Oct 30, 2024
4b14d9a
chore: avoid directly access components
Oct 30, 2024
8949f09
chore: format the sentence in readme
Oct 30, 2024
f7fb3b9
feat: update readme to force recreate container for docker compose de…
Oct 30, 2024
573dab0
fix: remove the wrong parentheses for a list
Nov 4, 2024
75b58ee
fix conflict
cyyeh Nov 4, 2024
ea19845
add should_force_deploy
cyyeh Nov 4, 2024
f31bc93
Merge branch 'main' into feat/multi-llm-config-deployment
cyyeh Nov 4, 2024
7999686
add missing env
cyyeh Nov 4, 2024
74048f0
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 5, 2024
c39f805
chore: add question recommendation setting in config file
Nov 5, 2024
9f616f7
refactor: force deploy
Nov 6, 2024
7b91906
fix conflicts
cyyeh Nov 6, 2024
084d593
chore: remove unused env example
Nov 6, 2024
4c97e51
add llm timeout
cyyeh Nov 7, 2024
f7ad9da
fix conflicts
cyyeh Nov 7, 2024
68617ac
change engine version
cyyeh Nov 7, 2024
d452d08
reformatted files
cyyeh Nov 7, 2024
58bbeb8
reformat default values
cyyeh Nov 7, 2024
a1eba7a
reformat default value
cyyeh Nov 7, 2024
388ef52
change default value
cyyeh Nov 7, 2024
89dfe13
update configs
cyyeh Nov 7, 2024
4d57d74
reformat config
cyyeh Nov 7, 2024
27c8c4e
add gpt-4o
cyyeh Nov 7, 2024
75fe8d4
add gpt-4o
cyyeh Nov 7, 2024
9dc519b
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 7, 2024
91c02f9
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 8, 2024
b0c2318
feat(wren-ai-service): integrate dspy into wrenAI (#805)
tedyyan Nov 9, 2024
f1ef914
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 11, 2024
a8c9799
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 11, 2024
d9a00e0
chore: remove from bootstrap image
Nov 11, 2024
cdff2be
feat: mount the config file from local machine
Nov 11, 2024
096a27b
feat: use env PROJECT_DIR instead a fixed current path
Nov 12, 2024
8ba4df7
chore(wren-ai-service): skip sql summary and add correcting status (#…
cyyeh Nov 12, 2024
71e55e6
feat: support multi-llm setting in launcher
Nov 12, 2024
89f7487
feat: override the setting for launcher
Nov 12, 2024
dada5a7
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 12, 2024
d134a3c
add gpt-4o to configmap
cyyeh Nov 13, 2024
cf81390
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 13, 2024
b68495a
fix: avoid override the config yaml file what if using a custom llm o…
Nov 13, 2024
0a3616f
feat: merge the env file content with the existing env file
Nov 13, 2024
feba3c5
chore: refactor the merge content function
Nov 13, 2024
46751ec
Merge branch 'main' into feat/multi-llm-config-deployment
Nov 13, 2024
0346ecc
Merge branch 'release/ai-service/0.11.x' into feat/multi-llm-config-d…
cyyeh Nov 14, 2024
51fde6b
Merge branch 'release/ai-service/0.11.x' into feat/multi-llm-config-d…
Nov 14, 2024
02767d2
chore: remove deprecated env dev example
Nov 14, 2024
09e93ec
Merge branch 'release/ai-service/0.11.x' into feat/multi-llm-config-d…
Nov 14, 2024
efbf8ea
chore: update config example for new pipes
Nov 14, 2024
f185a9d
Merge branch 'release/ai-service/0.11.x' into feat/multi-llm-config-d…
cyyeh Nov 14, 2024
2534c0a
add wren_ibis and wren_engine
cyyeh Nov 14, 2024
d81907e
fix wren_engine initialization
cyyeh Nov 14, 2024
adcbaa9
ensure only replace openai key
cyyeh Nov 14, 2024
97c4795
refine logging and fix ollama config
cyyeh Nov 14, 2024
5d83623
fix
cyyeh Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ai-service-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Just
uses: extractions/setup-just@v2
with:
just-version: "1.31.0"
just-version: "1.36.0"
Comment thread
paopa marked this conversation as resolved.
- name: Prepare testing environment and Run tests
run: |
just test
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ wren-ai-service/demo/poetry.lock
wren-ai-service/demo/custom_dataset
wren-ai-service/demo/.env
wren-ai-service/tools/dev/etc/**
wren-ai-service/.deepeval-cache.json
.deepeval-cache.json
docker/config.yaml

# python
.python-version
Expand Down
132 changes: 117 additions & 15 deletions deployment/kustomizations/base/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ kind: ConfigMap
metadata:
name: wren-config
data:

# Wren Engine Service Port
WREN_ENGINE_PORT: "8080"
# Wren AI Service Port
WREN_AI_SERVICE_PORT: "5555"
WREN_AI_SERVICE_ENABLE_TIMER: "1"

WREN_UI_ENDPOINT: http://wren-ui-svc:3000

Expand All @@ -18,25 +16,14 @@ data:
WREN_AI_SERVICE_VERSION: "0.10.4"
WREN_UI_VERSION: "0.16.0"

# LLM and Embedder Configurations
LLM_PROVIDER: "openai_llm"
LLM_OPENAI_API_BASE: "https://api.openai.com/v1"
GENERATION_MODEL: "gpt-4o-mini"

EMBEDDER_PROVIDER: "openai_embedder"
EMBEDDER_OPENAI_API_BASE: "https://api.openai.com/v1"

# Document store related
QDRANT_HOST: "wren-qdrant"
DOCUMENT_STORE_PROVIDER: "qdrant"

# Langfuse: for LLM tracing
LANGFUSE_HOST: "https://cloud.langfuse.com"
LANGFUSE_ENABLE: ""

# Telemetry
POSTHOG_HOST: "https://app.posthog.com"
TELEMETRY_ENABLED: "false"
# this is for telemetry to know the model, i think ai-service might be able to provide a endpoint to get the information
GENERATION_MODEL: "gpt-4o-mini"

# service endpoints of AI service & engine service
WREN_ENGINE_ENDPOINT: "http://wren-engine-svc:8080"
Expand All @@ -55,3 +42,118 @@ data:
LOGGING_LEVEL: INFO

IBIS_SERVER_ENDPOINT: http://wren-ibis-server-svc:8000
---
apiVersion: v1
kind: ConfigMap
metadata:
name: wren-ai-service-config
data:
config.yaml: |
type: llm
provider: openai_llm
models:
- model: gpt-4o-mini
kwargs:
{
"temperature": 0,
"n": 1,
"max_tokens": 4096,
"response_format": { "type": "json_object" },
}
- model: gpt-4o
kwargs:
{
"temperature": 0,
"n": 1,
"max_tokens": 4096,
"response_format": { "type": "json_object" },
}
api_base: https://api.openai.com/v1
timeout: 120

---
type: embedder
provider: openai_embedder
models:
- model: text-embedding-3-large
dimension: 3072
api_base: https://api.openai.com/v1
timeout: 120

---
type: engine
provider: wren_ui
endpoint: http://wren-ui-svc:3000

---
type: document_store
provider: qdrant
location: http://wren-qdrant:6333
embedding_model_dim: 3072
timeout: 120

---
type: pipeline
pipes:
- name: indexing
embedder: openai_embedder.text-embedding-3-large
document_store: qdrant
- name: retrieval
llm: openai_llm.gpt-4o-mini
embedder: openai_embedder.text-embedding-3-large
document_store: qdrant
- name: historical_question
embedder: openai_embedder.text-embedding-3-large
document_store: qdrant
- name: sql_generation
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: sql_correction
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: followup_sql_generation
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: sql_summary
llm: openai_llm.gpt-4o-mini
- name: sql_answer
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: sql_breakdown
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: sql_expansion
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: sql_explanation
llm: openai_llm.gpt-4o-mini
- name: sql_regeneration
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: semantics_description
llm: openai_llm.gpt-4o-mini
- name: relationship_recommendation
llm: openai_llm.gpt-4o-mini
engine: wren_ui
- name: question_recommendation
llm: openai_llm.gpt-4o-mini
- name: intent_classification
llm: openai_llm.gpt-4o-mini
embedder: openai_embedder.text-embedding-3-large
document_store: qdrant
- name: data_assistance
llm: openai_llm.gpt-4o-mini

---
settings:
column_indexing_batch_size: 50
table_retrieval_size: 10
table_column_retrieval_size: 100
allow_using_db_schemas_without_pruning: false
query_cache_maxsize: 1000
query_cache_ttl: 3600
langfuse_host: https://cloud.langfuse.com
langfuse_enable: true
enable_timer: false
logging_level: DEBUG
development: false
143 changes: 50 additions & 93 deletions deployment/kustomizations/base/deploy-wren-ai-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,99 +14,56 @@ spec:
spec:
containers:
- name: wren-ai-service
image: ghcr.io/canner/wren-ai-service:0.3.7
image: ghcr.io/canner/wren-ai-service:latest
volumeMounts:
- name: config-volume
mountPath: /app/data
env:
- name: WREN_AI_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: wren-config
key: WREN_AI_SERVICE_PORT
- name: LLM_PROVIDER
valueFrom:
configMapKeyRef:
name: wren-config
key: LLM_PROVIDER
- name: LLM_OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: LLM_OPENAI_API_KEY
- name: LLM_OPENAI_API_BASE
valueFrom:
configMapKeyRef:
name: wren-config
key: LLM_OPENAI_API_BASE
- name: EMBEDDER_PROVIDER
valueFrom:
configMapKeyRef:
name: wren-config
key: EMBEDDER_PROVIDER
- name: EMBEDDER_OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: EMBEDDER_OPENAI_API_KEY
- name: EMBEDDER_OPENAI_API_BASE
valueFrom:
configMapKeyRef:
name: wren-config
key: EMBEDDER_OPENAI_API_BASE
- name: GENERATION_MODEL
valueFrom:
configMapKeyRef:
name: wren-config
key: GENERATION_MODEL
- name: QDRANT_HOST
valueFrom:
configMapKeyRef:
name: wren-config
key: QDRANT_HOST
- name: DOCUMENT_STORE_PROVIDER
valueFrom:
configMapKeyRef:
name: wren-config
key: DOCUMENT_STORE_PROVIDER
- name: WREN_ENGINE_ENDPOINT
valueFrom:
configMapKeyRef:
name: wren-config
key: WREN_ENGINE_ENDPOINT
- name: LOGGING_LEVEL
valueFrom:
configMapKeyRef:
name: wren-config
key: LOGGING_LEVEL
- name: WREN_UI_ENDPOINT
valueFrom:
configMapKeyRef:
name: wren-config
key: WREN_UI_ENDPOINT
- name: ENABLE_TIMER
valueFrom:
configMapKeyRef:
name: wren-config
key: WREN_AI_SERVICE_ENABLE_TIMER
- name: PYTHONUNBUFFERED
value: "1"
- name: LANGFUSE_ENABLE
valueFrom:
configMapKeyRef:
name: wren-config
key: LANGFUSE_ENABLE
- name: LANGFUSE_HOST
valueFrom:
configMapKeyRef:
name: wren-config
key: LANGFUSE_HOST
- name: LANGFUSE_PUBLIC_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: LANGFUSE_PUBLIC_KEY
- name: LANGFUSE_SECRET_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: LANGFUSE_SECRET_KEY
- name: WREN_AI_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: wren-config
key: WREN_AI_SERVICE_PORT
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: LLM_OPENAI_API_KEY
- name: QDRANT_HOST
valueFrom:
configMapKeyRef:
name: wren-config
key: QDRANT_HOST
- name: LOGGING_LEVEL
valueFrom:
configMapKeyRef:
name: wren-config
key: LOGGING_LEVEL
- name: WREN_UI_ENDPOINT
valueFrom:
configMapKeyRef:
name: wren-config
key: WREN_UI_ENDPOINT
- name: PYTHONUNBUFFERED
value: "1"
- name: LANGFUSE_PUBLIC_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: LANGFUSE_PUBLIC_KEY
- name: LANGFUSE_SECRET_KEY
valueFrom:
secretKeyRef:
name: wrenai-secrets
key: LANGFUSE_SECRET_KEY
- name: CONFIG_PATH
value: /app/data/config.yaml
ports:
- containerPort: 5555
volumes:
- name: config-volume
configMap:
name: wren-ai-service-config
items:
- key: config.yaml
path: config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ type: Opaque
data:
# LLM_OPENAI_API_KEY and EMBEDDER_OPENAI_API_KEY are REQUIRED: without a valid key the wren-ai-service-deployment pod will not start
LLM_OPENAI_API_KEY: UkVRVUlSRUQ6IHNrLXByb2otYWxsLWFjY2Vzcy1wbGFjZWhvbGRlci00LXdyZW4tYWktc2VydmljZS1kZXBsb3ltZW50
EMBEDDER_OPENAI_API_KEY: UkVRVUlSRUQ6IHNrLXByb2otYWxsLWFjY2Vzcy1wbGFjZWhvbGRlci00LXdyZW4tYWktc2VydmljZS1kZXBsb3ltZW50

# Azure openai env
AZURE_CHAT_BASE: bi9h
Expand Down
2 changes: 1 addition & 1 deletion deployment/kustomizations/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ images:
- name: ghcr.io/canner/wren-ui
newTag: 0.9.2 # WREN_UI_VERSION
- name: ghcr.io/canner/wren-ai-service
newTag: 0.8.2 # WREN_AI_SERVICE_VERSION
newTag: commit-391ea49 # WREN_AI_SERVICE_VERSION
- name: ghcr.io/canner/wren-engine-ibis
newTag: 0.9.0 # IBIS_SERVER_VERSION

Expand Down
Loading