Skip to content

Commit

Permalink
Merge pull request #777 from Jayasankar-kk/ai-integrate
Browse files Browse the repository at this point in the history
integration of Vachan-ai with vachan-api
  • Loading branch information
shimilgithub authored Feb 22, 2024
2 parents ff24a38 + 988c6a6 commit b1fec7e
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
with the underlying Databases and modules in Vachan-Engine. \
\n • For Vachan-CMS docs: {root_url}/v2/cms/rest/docs,\
\n • For Vachan-TBT docs: {root_url}/v2/text/translate/token-based/docs,\
\n • For Vachan-Auth docs: {root_url}/v2/auth/docs")
\n • For Vachan-Auth docs: {root_url}/v2/auth/docs,\
\n • For Vachan-AI docs: {root_url}/v2/ai/model/docs")
template = Jinja2Templates(directory="templates")
app.mount("/static", StaticFiles(directory="static"), name="static")

Expand Down Expand Up @@ -245,6 +246,8 @@ def custom_openapi():
f"<br> • <a href=\"{root_url}/v2/text/translate/token-based/docs\" > Vachan-TBT docs </a>"
f"<br> • <a href=\"{root_url}/v2/cms/rest/docs\" > Vachan-CMS docs </a>"
f"<br> • <a href=\"{root_url}/v2/auth/docs\" > Vachan-Auth docs </a>"
f"<br> • <a href=\"{root_url}/v2/ai/model/docs\" > Vachan-AI docs </a>"

),
routes=app.routes
)
Expand Down
61 changes: 61 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,67 @@ services:
networks:
- VE-network


vachan_ai:
image: jayasankarkk/vachan-ai:0.0.0-alpha.4
healthcheck:
timeout: 45s
interval: 10s
retries: 10
environment:
- VACHAN_AI_POSTGRES_HOST=192.168.3.157
- VACHAN_AI_POSTGRES_USER=${VACHAN_AI_POSTGRES_USER:-postgres}
- VACHAN_AI_POSTGRES_PASSWORD=${VACHAN_AI_POSTGRES_PASSWORD:-secret}
- VACHAN_AI_POSTGRES_DATABASE=${VACHAN_AI_POSTGRES_DATABASE:-vachan_ai_db}
- VACHAN_AI_POSTGRES_SCHEMA=${VACHAN_AI_POSTGRES_SCHEMA:-aischema}

- VACHAN_AI_XLSR_MAX_AUDIO_DURATION=${VACHAN_AI_XLSR_MAX_AUDIO_DURATION:-25}
- VACHAN_AI_XLSR_SAMPLING_RATE=${VACHAN_AI_XLSR_SAMPLING_RATE:-16000}
- VACHAN_AI_NLLB_MAX_SRC_CHARS=${VACHAN_AI_NLLB_MAX_SRC_CHARS:-512}
- VACHAN_AI_NLLB_BATCH_SIZE=${VACHAN_AI_NLLB_BATCH_SIZE:-10}


- MLFLOW_TRACKING_URI=${MLFLOW_TRACKING_URI:-http://192.168.3.157:8083}
- VACHAN_AI_ARTIFACT_PATH=${VACHAN_AI_ARTIFACT_PATH:-models}
- VACHAN_AI_SERVED_MODEL_URI=${VACHAN_AI_SERVED_MODEL_URI:-http://192.168.3.157:8085/v2/models}
- VACHAN_AI_MODEL_SETTINGS_DIR=${VACHAN_AI_MODEL_SETTINGS_DIR:-serving_models}
- VACHAN_AI_REQUEST_TIMEOUT=${VACHAN_AI_REQUEST_TIMEOUT:-60}

- VACHAN_AI_AWS_ACCESS_KEY=${VACHAN_AI_AWS_ACCESS_KEY}
- VACHAN_AI_AWS_SECRET_ACCESS_KEY=${VACHAN_AI_AWS_SECRET_ACCESS_KEY}
- VACHAN_AI_S3_BUCKET=${VACHAN_AI_S3_BUCKET}
- VACHAN_AI_AWS_ACCOUNT_REGION=${VACHAN_AI_AWS_ACCOUNT_REGION}


- VACHAN_AI_DATA_PATH=${VACHAN_AI_DATA_PATH:-/var/data-vachan-ai}
- VACHAN_AI_POSTGRES_PORT=5433
- VACHAN_AI_LOGGING_LEVEL=INFO
- VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost}
- VACHAN_LOGGING_LEVEL=INFO
- VACHAN_AI_ENV=${VACHAN_AI_ENV:-Development}
- PYTHONPATH=/app/app/core/model_access/ai_model_core.py:/app/app/core/cloud_operations
- VACHAN_REDIS_PASS=${VACHAN_REDIS_PASS:-vsfrgetd}
command: uvicorn main:app --host 0.0.0.0 --port 8006
volumes:
- ${VACHAN_AI_DATA_PATH}/docker-volumes/ai-logs-vol:/app/logs
- ${VACHAN_AI_DATA_PATH}/cache:/root/.cache
restart: always
depends_on:
- vachan-api
- redis
profiles:
- local-run
- deployment
expose:
- 8006
ports:
- "8006:8006"
networks:
- VE-network
container_name: vachan_ai



# Web Server
web-server-local:
image: nginx:latest
Expand Down
4 changes: 4 additions & 0 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ server {
proxy_pass http://vachan-access:8007;
}

location /v2/ai/model/ {
proxy_pass http://vachan-ai:8006;
}

location /v2/cms/rest/ {
proxy_pass http://vachan-cms-rest:8005;
}
Expand Down
4 changes: 4 additions & 0 deletions docker/nginx/prod/app.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ server {
proxy_pass http://vachan-access:8007;
}

location /v2/ai/model/ {
proxy_pass http://vachan-ai:8006;
}

location /v2/cms/rest/ {
proxy_pass http://vachan-cms-rest:8005;
}
Expand Down

0 comments on commit b1fec7e

Please sign in to comment.