This document outlines the deployment process for a Translation application utilizing the GenAIComps microservice pipeline on Intel Gaudi server. The steps include Docker image creation, container deployment via Docker Compose, and service execution to integrate microservices such as We will publish the Docker images to Docker Hub, it will simplify the deployment process for this service.
First of all, you need to build Docker Images locally. This step can be ignored after the Docker images published to Docker hub.
git clone https://github.com/opea-project/GenAIComps.git
cd GenAIComps
docker build -t opea/llm-tgi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/llms/text-generation/tgi/Dockerfile .
To construct the Mega Service, we utilize the GenAIComps microservice pipeline within the translation.py
Python script. Build the MegaService Docker image using the command below:
git clone https://github.com/opea-project/GenAIExamples
cd GenAIExamples/Translation/docker
docker build -t opea/translation:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
Construct the frontend Docker image using the command below:
cd GenAIExamples/Translation/docker/ui/
docker build -t opea/translation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile .
Then run the command docker images
, you will have the following four Docker Images:
ghcr.io/huggingface/tgi-gaudi:1.2.1
opea/gen-ai-comps:llm-tgi-gaudi-server
opea/gen-ai-comps:translation-megaservice-server
opea/gen-ai-comps:translation-ui-server
Since the docker_compose.yaml
will consume some environment variables, you need to setup them in advance as below.
export http_proxy=${your_http_proxy}
export https_proxy=${your_http_proxy}
export LLM_MODEL_ID="haoranxu/ALMA-13B"
export TGI_LLM_ENDPOINT="http://${host_ip}:8008"
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/translation"
Note: Please replace with host_ip
with you external IP address, do not use localhost.
docker compose -f docker_compose.yaml up -d
- TGI Service
curl http://${host_ip}:8008/generate \
-X POST \
-d '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":64, "do_sample": true}}' \
-H 'Content-Type: application/json'
- LLM Microservice
curl http://${host_ip}:9000/v1/chat/completions \
-X POST \
-d '{"query":"Translate this from Chinese to English:\nChinese: 我爱机器翻译。\nEnglish:"}' \
-H 'Content-Type: application/json'
- MegaService
curl http://${host_ip}:8888/v1/translation -H "Content-Type: application/json" -d '{
"language_from": "Chinese","language_to": "English","source_language": "我爱机器翻译。"}'
Following the validation of all aforementioned microservices, we are now prepared to construct a mega-service.
Open this URL http://{host_ip}:5173
in your browser to access the frontend.