diff --git a/app/main.py b/app/main.py index aff11847..e1a2ca7a 100644 --- a/app/main.py +++ b/app/main.py @@ -36,7 +36,8 @@ description=f"The server application that provides APIs to interact \ 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-TBT docs: {root_url}/v2/text/translate/token-based/docs,\ +\n • For Vachan-AI docs: {root_url}/v2/ai/model/docs") template = Jinja2Templates(directory="templates") app.mount("/static", StaticFiles(directory="static"), name="static") @@ -253,6 +254,7 @@ def custom_openapi(): underlying Databases \and modules in Vachan-Engine. " f"
Vachan-TBT docs " f"
Vachan-CMS docs " + f"
Vachan-AI docs " ), routes=app.routes ) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 481e781a..f54cc5f1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -288,6 +288,62 @@ services: networks: - VE-network + vachan_ai: + image: jayasankarkk/vachan-ai:0.0.0-alpha.3 + 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_DATABASE:-vachan_ai} + + - 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:5000} + - VACHAN_AI_ARTIFACT_PATH=${VACHAN_AI_ARTIFACT_PATH:-models} + - VACHAN_AI_SERVED_MODEL_URI=${VACHAN_AI_SERVED_MODEL_URI:-http://192.168.3.157:8080/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} + 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 + profiles: + - local-run + - deployment + expose: + - 8006 + ports: + - "8006:8006" + networks: + - VE-network + container_name: vachan_ai + + # Web Server web-server-local: image: nginx:latest @@ -432,4 +488,6 @@ volumes: logs-test-vol: vachan-db-backup: kratos-db-backup: - vachan-tbt-ml-models-vol: \ No newline at end of file + vachan-tbt-ml-models-vol: + ai-logs-vol: + cache: \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 31a069b2..00702f47 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -27,6 +27,11 @@ server { proxy_pass http://vachan-tbt:8003; } + location /v2/ai/model/ { + proxy_pass http://vachan_ai:8006; + } + + location /v2/nlp/ { proxy_pass http://vachan-tbt:8003; } diff --git a/docker/nginx/prod/app.conf.template b/docker/nginx/prod/app.conf.template index c9043dff..ed397534 100644 --- a/docker/nginx/prod/app.conf.template +++ b/docker/nginx/prod/app.conf.template @@ -55,8 +55,14 @@ server { location /v2/demos/ { proxy_pass http://vachan-demos:8002; } + + location /v2/ai/model/ { + proxy_pass http://vachan-ai:8006; + } location / { proxy_pass http://vachan-api:8000; } + + }