diff --git a/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md b/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md index f730a91aea..1fddfff22a 100644 --- a/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md +++ b/ChatQnA/docker_compose/intel/cpu/xeon/README_pinecone.md @@ -1,63 +1,101 @@ -# Build Mega Service of ChatQnA (with Pinecone) on Xeon +# Build Mega Service of ChatQnA on Xeon This document outlines the deployment process for a ChatQnA application utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline on Intel Xeon server. The steps include Docker image creation, container deployment via Docker Compose, and service execution to integrate microservices such as `embedding`, `retriever`, `rerank`, and `llm`. We will publish the Docker images to Docker Hub soon, it will simplify the deployment process for this service. -## 🚀 Apply Xeon Server on AWS +Quick Start: -To apply a Xeon server on AWS, start by creating an AWS account if you don't have one already. Then, head to the [EC2 Console](https://console.aws.amazon.com/ec2/v2/home) to begin the process. Within the EC2 service, select the Amazon EC2 M7i or M7i-flex instance type to leverage the power of 4th Generation Intel Xeon Scalable processors. These instances are optimized for high-performance computing and demanding workloads. +1. Set up the environment variables. +2. Run Docker Compose. +3. Consume the ChatQnA Service. -For detailed information about these instance types, you can refer to this [link](https://aws.amazon.com/ec2/instance-types/m7i/). Once you've chosen the appropriate instance type, proceed with configuring your instance settings, including network configurations, security groups, and storage options. +## Quick Start: 1.Setup Environment Variable -After launching your instance, you can connect to it using SSH (for Linux instances) or Remote Desktop Protocol (RDP) (for Windows instances). From there, you'll have full access to your Xeon server, allowing you to install, configure, and manage your applications as needed. +To set up environment variables for deploying ChatQnA services, follow these steps: -**Certain ports in the EC2 instance need to opened up in the security group, for the microservices to work with the curl commands** +1. Set the required environment variables: -> See one example below. Please open up these ports in the EC2 instance based on the IP addresses you want to allow + ```bash + # Example: host_ip="192.168.1.1" + export host_ip="External_Public_IP" + export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token" + export PINECONE_API_KEY="Pinecone_API_Key" + export PINECONE_INDEX_NAME="Pinecone_Index_Name" + export INDEX_NAME="Pinecone_Index_Name" + ``` -``` +2. If you are in a proxy environment, also set the proxy-related environment variables: -data_prep_service -===================== -Port 6007 - Open to 0.0.0.0/0 -Port 6008 - Open to 0.0.0.0/0 + ```bash + export http_proxy="Your_HTTP_Proxy" + export https_proxy="Your_HTTPs_Proxy" + # Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1" + export no_proxy="Your_No_Proxy",chatqna-xeon-ui-server,chatqna-xeon-backend-server,dataprep-pinecone-service,tei-embedding-service,retriever,tei-reranking-service,tgi-service,vllm-service + ``` -tei_embedding_service -===================== -Port 6006 - Open to 0.0.0.0/0 +3. Set up other environment variables, make sure to update the INDEX_NAME variable to Pinecone index value: + ```bash + source ./set_env.sh + ``` -embedding -========= -Port 6000 - Open to 0.0.0.0/0 +## Quick Start: 2.Run Docker Compose + +```bash +docker compose -f compose_pinecone.yaml up -d +``` -retriever -========= -Port 7000 - Open to 0.0.0.0/0 +It will automatically download the docker image on `docker hub`: -tei_xeon_service -================ -Port 8808 - Open to 0.0.0.0/0 +```bash +docker pull opea/chatqna:latest +docker pull opea/chatqna-ui:latest +``` -reranking -========= -Port 8000 - Open to 0.0.0.0/0 +NB: You should build docker image from source by yourself if: -tgi-service -=========== -Port 9009 - Open to 0.0.0.0/0 +- You are developing off the git main branch (as the container's ports in the repo may be different from the published docker image). +- You can't download the docker image. +- You want to use a specific version of Docker image. -llm -=== -Port 9000 - Open to 0.0.0.0/0 +Please refer to ['Build Docker Images'](#🚀-build-docker-images) in below. -chaqna-xeon-backend-server -========================== -Port 8888 - Open to 0.0.0.0/0 +## QuickStart: 3.Consume the ChatQnA Service -chaqna-xeon-ui-server -===================== -Port 5173 - Open to 0.0.0.0/0 +```bash +curl http://${host_ip}:8888/v1/chatqna \ + -H "Content-Type: application/json" \ + -d '{ + "messages": "What is the revenue of Nike in 2023?" + }' ``` +## 🚀 Apply Xeon Server on AWS + +To apply a Xeon server on AWS, start by creating an AWS account if you don't have one already. Then, head to the [EC2 Console](https://console.aws.amazon.com/ec2/v2/home) to begin the process. Within the EC2 service, select the Amazon EC2 M7i or M7i-flex instance type to leverage 4th Generation Intel Xeon Scalable processors that are optimized for demanding workloads. + +For detailed information about these instance types, you can refer to this [link](https://aws.amazon.com/ec2/instance-types/m7i/). Once you've chosen the appropriate instance type, proceed with configuring your instance settings, including network configurations, security groups, and storage options. + +After launching your instance, you can connect to it using SSH (for Linux instances) or Remote Desktop Protocol (RDP) (for Windows instances). From there, you'll have full access to your Xeon server, allowing you to install, configure, and manage your applications as needed. + +### Network Port & Security + +- Access the ChatQnA UI by web browser + + It supports to access by `80` port. Please confirm the `80` port is opened in the firewall of EC2 instance. + +- Access the microservice by tool or API + + 1. Login to the EC2 instance and access by **local IP address** and port. + + It's recommended and do nothing of the network port setting. + + 2. Login to a remote client and access by **public IP address** and port. + + You need to open the port of the microservice in the security group setting of firewall of EC2 instance setting. + + For detailed guide, please refer to [Validate Microservices](#validate-microservices). + + Note, it will increase the risk of security, so please confirm before do it. + ## 🚀 Build Docker Images First of all, you need to build Docker Images locally and install the python package of it. @@ -67,241 +105,258 @@ git clone https://github.com/opea-project/GenAIComps.git cd GenAIComps ``` -### 1. Build Embedding Image - -```bash -docker build --no-cache -t opea/embedding-tei:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/embeddings/tei/langchain/Dockerfile . -``` - -### 2. Build Retriever Image +### 1. Build Retriever Image ```bash docker build --no-cache -t opea/retriever-pinecone:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/pinecone/langchain/Dockerfile . ``` -### 3. Build Rerank Image +### 2. Build Dataprep Image ```bash -docker build --no-cache -t opea/reranking-tei:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/reranks/tei/Dockerfile . +docker build --no-cache -t opea/dataprep-pinecone:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/pinecone/langchain/Dockerfile . +cd .. ``` -### 4. Build LLM Image +### 3. Build MegaService Docker Image -```bash -docker build --no-cache -t opea/llm-tgi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/llms/text-generation/tgi/Dockerfile . -``` +1. MegaService with Rerank -### 5. Build Dataprep Image + To construct the Mega Service with Rerank, we utilize the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline within the `chatqna.py` Python script. Build MegaService Docker image via below command: -```bash -docker build --no-cache -t opea/dataprep-pinecone:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/pinecone/langchain/Dockerfile . -cd .. -``` + ```bash + git clone https://github.com/opea-project/GenAIExamples.git + cd GenAIExamples/ChatQnA + docker build --no-cache -t opea/chatqna:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . + ``` -### 6. Build MegaService Docker Image +2. MegaService without Rerank -To construct the Mega Service, we utilize the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline within the `chatqna.py` Python script. Build MegaService Docker image via below command: + To construct the Mega Service without Rerank, we utilize the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline within the `chatqna_without_rerank.py` Python script. Build MegaService Docker image via below command: -```bash -git clone https://github.com/opea-project/GenAIExamples.git -cd GenAIExamples/ChatQnA/docker -docker build --no-cache -t opea/chatqna:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . -cd ../../.. -``` + ```bash + git clone https://github.com/opea-project/GenAIExamples.git + cd GenAIExamples/ChatQnA + docker build --no-cache -t opea/chatqna-without-rerank:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile.without_rerank . + ``` -### 7. Build UI Docker Image +### 4. Build UI Docker Image Build frontend Docker image via below command: ```bash -cd GenAIExamples/ChatQnA/docker/ui/ +cd GenAIExamples/ChatQnA/ui docker build --no-cache -t opea/chatqna-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile . -cd ../../../.. ``` -### 8. Build Conversational React UI Docker Image (Optional) +### 5. Build Conversational React UI Docker Image (Optional) Build frontend Docker image that enables Conversational experience with ChatQnA megaservice via below command: **Export the value of the public IP address of your Xeon server to the `host_ip` environment variable** ```bash -cd GenAIExamples/ChatQnA/docker/ui/ -export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/chatqna" -export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep" -export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6008/v1/dataprep/get_file" -docker build --no-cache -t opea/chatqna-conversation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy --build-arg BACKEND_SERVICE_ENDPOINT=$BACKEND_SERVICE_ENDPOINT --build-arg DATAPREP_SERVICE_ENDPOINT=$DATAPREP_SERVICE_ENDPOINT --build-arg DATAPREP_GET_FILE_ENDPOINT=$DATAPREP_GET_FILE_ENDPOINT -f ./docker/Dockerfile.react . -cd ../../../.. +cd GenAIExamples/ChatQnA/ui +docker build --no-cache -t opea/chatqna-conversation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile.react . ``` -Then run the command `docker images`, you will have the following 7 Docker Images: +### 6. Build Nginx Docker Image + +```bash +cd GenAIComps +docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/nginx/Dockerfile . +``` + +Then run the command `docker images`, you will have the following 5 Docker Images: 1. `opea/dataprep-pinecone:latest` -2. `opea/embedding-tei:latest` -3. `opea/retriever-pinecone:latest` -4. `opea/reranking-tei:latest` -5. `opea/llm-tgi:latest` -6. `opea/chatqna:latest` -7. `opea/chatqna-ui:latest` +2. `opea/retriever-pinecone:latest` +3. `opea/chatqna:latest` or `opea/chatqna-without-rerank:latest` +4. `opea/chatqna-ui:latest` +5. `opea/nginx:latest` ## 🚀 Start Microservices -### Setup Environment Variables +### Required Models -Since the `compose_pinecone.yaml` will consume some environment variables, you need to setup them in advance as below. +By default, the embedding, reranking and LLM models are set to a default value as listed below: -**Export the value of the public IP address of your Xeon server to the `host_ip` environment variable** +| Service | Model | +| --------- | ------------------------- | +| Embedding | BAAI/bge-base-en-v1.5 | +| Reranking | BAAI/bge-reranker-base | +| LLM | Intel/neural-chat-7b-v3-3 | -> Change the External_Public_IP below with the actual IPV4 value +Change the `xxx_MODEL_ID` below for your needs. -``` -export host_ip="External_Public_IP" -``` +For users in China who are unable to download models directly from Huggingface, you can use [ModelScope](https://www.modelscope.cn/models) or a Huggingface mirror to download models. TGI can load the models either online or offline as described below: -**Export the value of your Huggingface API token to the `your_hf_api_token` environment variable** +1. Online -> Change the Your_Huggingface_API_Token below with tyour actual Huggingface API Token value + ```bash + export HF_TOKEN=${your_hf_token} + export HF_ENDPOINT="https://hf-mirror.com" + model_name="Intel/neural-chat-7b-v3-3" + docker run -p 8008:80 -v ./data:/data --name tgi-service -e HF_ENDPOINT=$HF_ENDPOINT -e http_proxy=$http_proxy -e https_proxy=$https_proxy --shm-size 1g ghcr.io/huggingface/text-generation-inference:2.4.0-intel-cpu --model-id $model_name + ``` -``` -export your_hf_api_token="Your_Huggingface_API_Token" -``` +2. Offline -**Append the value of the public IP address to the no_proxy list** + - Search your model name in ModelScope. For example, check [this page](https://www.modelscope.cn/models/ai-modelscope/neural-chat-7b-v3-1/files) for model `neural-chat-7b-v3-1`. -``` -export your_no_proxy=${your_no_proxy},"External_Public_IP" -``` + - Click on `Download this model` button, and choose one way to download the model to your local path `/path/to/model`. -\*\*Get the PINECONE_API_KEY and the INDEX_NAME + - Run the following command to start TGI service. -``` -export pinecone_api_key=${api_key} -export pinecone_index_name=${pinecone_index} -``` + ```bash + export HF_TOKEN=${your_hf_token} + export model_path="/path/to/model" + docker run -p 8008:80 -v $model_path:/data --name tgi_service --shm-size 1g ghcr.io/huggingface/text-generation-inference:2.4.0-intel-cpu --model-id /data + ``` -```bash -export no_proxy=${your_no_proxy} -export http_proxy=${your_http_proxy} -export https_proxy=${your_http_proxy} -export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5" -export RERANK_MODEL_ID="BAAI/bge-reranker-base" -export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3" -export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6006" -export TEI_RERANKING_ENDPOINT="http://${host_ip}:8808" -export TGI_LLM_ENDPOINT="http://${host_ip}:9009" -export PINECONE_API_KEY=${pinecone_api_key} -export PINECONE_INDEX_NAME=${pinecone_index_name} -export INDEX_NAME=${pinecone_index_name} -export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token} -export MEGA_SERVICE_HOST_IP=${host_ip} -export EMBEDDING_SERVICE_HOST_IP=${host_ip} -export RETRIEVER_SERVICE_HOST_IP=${host_ip} -export RERANK_SERVICE_HOST_IP=${host_ip} -export LLM_SERVICE_HOST_IP=${host_ip} -export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/chatqna" -export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep" -export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6008/v1/dataprep/get_file" -export DATAPREP_DELETE_FILE_ENDPOINT="http://${host_ip}:6009/v1/dataprep/delete_file" -``` +### Setup Environment Variables + +1. Set the required environment variables: + + ```bash + # Example: host_ip="192.168.1.1" + export host_ip="External_Public_IP" + export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token" + # Example: NGINX_PORT=80 + export NGINX_PORT=${your_nginx_port} + export PINECONE_API_KEY="Pinecone_API_Key" + export PINECONE_INDEX_NAME="Pinecone_Index_Name" + export INDEX_NAME="Pinecone_Index_Name" + ``` + +2. If you are in a proxy environment, also set the proxy-related environment variables: -Note: Please replace with `host_ip` with you external IP address, do not use localhost. + ```bash + export http_proxy="Your_HTTP_Proxy" + export https_proxy="Your_HTTPs_Proxy" + # Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1" + export no_proxy="Your_No_Proxy",chatqna-xeon-ui-server,chatqna-xeon-backend-server,dataprep-pinecone-service,tei-embedding-service,retriever,tei-reranking-service,tgi-service,vllm-service + ``` + +3. Set up other environment variables, make sure to update the INDEX_NAME variable to use Pinecone Index name: + + ```bash + source ./set_env.sh + ``` ### Start all the services Docker Containers > Before running the docker compose command, you need to be in the folder that has the docker compose yaml file ```bash -cd GenAIExamples/ChatQnA/docker/xeon/ +cd GenAIExamples/ChatQnA/docker_compose/intel/cpu/xeon/ +``` + +If use TGI backend. + +```bash +# Start ChatQnA with Rerank Pipeline docker compose -f compose_pinecone.yaml up -d ``` ### Validate Microservices +Note, when verify the microservices by curl or API from remote client, please make sure the **ports** of the microservices are opened in the firewall of the cloud node. +Follow the instructions to validate MicroServices. +For details on how to verify the correctness of the response, refer to [how-to-validate_service](../../hpu/gaudi/how_to_validate_service.md). + 1. TEI Embedding Service -```bash -curl ${host_ip}:6006/embed \ - -X POST \ - -d '{"inputs":"What is Deep Learning?"}' \ - -H 'Content-Type: application/json' -``` + ```bash + curl ${host_ip}:6006/embed \ + -X POST \ + -d '{"inputs":"What is Deep Learning?"}' \ + -H 'Content-Type: application/json' + ``` -2. Embedding Microservice +2. Retriever Microservice -```bash -curl http://${host_ip}:6000/v1/embeddings\ - -X POST \ - -d '{"text":"hello"}' \ - -H 'Content-Type: application/json' -``` + To consume the retriever microservice, you need to generate a mock embedding vector by Python script. The length of embedding vector + is determined by the embedding model. + Here we use the model `EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"`, which vector size is 768. -3. Retriever Microservice - To validate the retriever microservice, you need to generate a mock embedding vector of length 768 in Python script: + Check the vector dimension of your embedding model, set `your_embedding` dimension equals to it. -```Python -import random -embedding = [random.uniform(-1, 1) for _ in range(768)] -print(embedding) -``` + ```bash + export your_embedding=$(python3 -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)") + curl http://${host_ip}:7000/v1/retrieval \ + -X POST \ + -d "{\"text\":\"test\",\"embedding\":${your_embedding}}" \ + -H 'Content-Type: application/json' + ``` -Then substitute your mock embedding vector for the `${your_embedding}` in the following cURL command: +3. TEI Reranking Service -```bash -curl http://${host_ip}:7000/v1/retrieval \ - -X POST \ - -d '{"text":"What is the revenue of Nike in 2023?","embedding":"'"${your_embedding}"'"}' \ - -H 'Content-Type: application/json' -``` + > Skip for ChatQnA without Rerank pipeline -4. TEI Reranking Service + ```bash + curl http://${host_ip}:8808/rerank \ + -X POST \ + -d '{"query":"What is Deep Learning?", "texts": ["Deep Learning is not...", "Deep learning is..."]}' \ + -H 'Content-Type: application/json' + ``` -```bash -curl http://${host_ip}:8808/rerank \ - -X POST \ - -d '{"query":"What is Deep Learning?", "texts": ["Deep Learning is not...", "Deep learning is..."]}' \ - -H 'Content-Type: application/json' -``` +4. LLM backend Service -5. Reranking Microservice + In first startup, this service will take more time to download the model files. After it's finished, the service will be ready. -```bash -curl http://${host_ip}:8000/v1/reranking\ - -X POST \ - -d '{"initial_query":"What is Deep Learning?", "retrieved_docs": [{"text":"Deep Learning is not..."}, {"text":"Deep learning is..."}]}' \ - -H 'Content-Type: application/json' -``` + Try the command below to check whether the LLM serving is ready. -6. TGI Service + ```bash + docker logs tgi-service | grep Connected + ``` -```bash -curl http://${host_ip}:9009/generate \ - -X POST \ - -d '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":17, "do_sample": true}}' \ - -H 'Content-Type: application/json' -``` + If the service is ready, you will get the response like below. -7. LLM Microservice + ```text + 2024-09-03T02:47:53.402023Z INFO text_generation_router::server: router/src/server.rs:2311: Connected + ``` -```bash -curl http://${host_ip}:9000/v1/chat/completions\ - -X POST \ - -d '{"query":"What is Deep Learning?","max_new_tokens":17,"top_k":10,"top_p":0.95,"typical_p":0.95,"temperature":0.01,"repetition_penalty":1.03,"streaming":true}' \ - -H 'Content-Type: application/json' -``` + Then try the `cURL` command below to validate services. -8. MegaService + ```bash + # TGI service + curl http://${host_ip}:9009/v1/chat/completions \ + -X POST \ + -d '{"model": "Intel/neural-chat-7b-v3-3", "messages": [{"role": "user", "content": "What is Deep Learning?"}], "max_tokens":17}' \ + -H 'Content-Type: application/json' + ``` -```bash -curl http://${host_ip}:8888/v1/chatqna -H "Content-Type: application/json" -d '{ - "messages": "What is the revenue of Nike in 2023?" - }' -``` +5. MegaService + + ```bash + curl http://${host_ip}:8888/v1/chatqna -H "Content-Type: application/json" -d '{ + "messages": "What is the revenue of Nike in 2023?" + }' + ``` -9. Dataprep Microservice(Optional) +6. Nginx Service + + ```bash + curl http://${host_ip}:${NGINX_PORT}/v1/chatqna \ + -H "Content-Type: application/json" \ + -d '{"messages": "What is the revenue of Nike in 2023?"}' + ``` + +7. Dataprep Microservice(Optional) If you want to update the default knowledge base, you can use the following commands: -Update Knowledge Base via Local File Upload: +Update Knowledge Base via Local File [nke-10k-2023.pdf](https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/redis/data/nke-10k-2023.pdf). Or +click [here](https://raw.githubusercontent.com/opea-project/GenAIComps/main/comps/retrievers/redis/data/nke-10k-2023.pdf) to download the file via any web browser. +Or run this command to get the file on a terminal. + +```bash +wget https://raw.githubusercontent.com/opea-project/GenAIComps/main/comps/retrievers/redis/data/nke-10k-2023.pdf + +``` + +Upload: ```bash curl -X POST "http://${host_ip}:6007/v1/dataprep" \ @@ -321,34 +376,19 @@ curl -X POST "http://${host_ip}:6007/v1/dataprep" \ This command updates a knowledge base by submitting a list of HTTP links for processing. -Also, you are able to get the file list that you uploaded: +To delete the files/link you uploaded: ```bash -curl -X POST "http://${host_ip}:6008/v1/dataprep/get_file" \ +# delete all uploaded files and links +curl -X POST "http://${host_ip}:6009/v1/dataprep/delete_file" \ + -d '{"file_path": "all"}' \ -H "Content-Type: application/json" ``` -## Enable LangSmith for Monotoring Application (Optional) - -LangSmith offers tools to debug, evaluate, and monitor language models and intelligent agents. It can be used to assess benchmark data for each microservice. Before launching your services with `docker compose -f compose_pinecone.yaml up -d`, you need to enable LangSmith tracing by setting the `LANGCHAIN_TRACING_V2` environment variable to true and configuring your LangChain API key. - -Here's how you can do it: - -1. Install the latest version of LangSmith: - -```bash -pip install -U langsmith -``` - -2. Set the necessary environment variables: - -```bash -export LANGCHAIN_TRACING_V2=true -export LANGCHAIN_API_KEY=ls_... -``` - ## 🚀 Launch the UI +### Launch with origin port + To access the frontend, open the following URL in your browser: http://{host_ip}:5173. By default, the UI runs on port 5173 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below: ```yaml @@ -359,12 +399,33 @@ To access the frontend, open the following URL in your browser: http://{host_ip} - "80:5173" ``` -## 🚀 Launch the Conversational UI (react) +### Launch with Nginx + +If you want to launch the UI using Nginx, open this URL: `http://${host_ip}:${NGINX_PORT}` in your browser to access the frontend. -To access the Conversational UI frontend, open the following URL in your browser: http://{host_ip}:5174. By default, the UI runs on port 80 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below: +## 🚀 Launch the Conversational UI (Optional) + +To access the Conversational UI (react based) frontend, modify the UI service in the `compose.yaml` file. Replace `chaqna-xeon-ui-server` service with the `chatqna-xeon-conversation-ui-server` service as per the config below: + +```yaml +chaqna-xeon-conversation-ui-server: + image: opea/chatqna-conversation-ui:latest + container_name: chatqna-xeon-conversation-ui-server + environment: + - APP_BACKEND_SERVICE_ENDPOINT=${BACKEND_SERVICE_ENDPOINT} + - APP_DATA_PREP_SERVICE_URL=${DATAPREP_SERVICE_ENDPOINT} + ports: + - "5174:80" + depends_on: + - chaqna-xeon-backend-server + ipc: host + restart: always +``` + +Once the services are up, open the following URL in your browser: http://{host_ip}:5174. By default, the UI runs on port 80 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below: ```yaml - chaqna-xeon-conversation-ui-server: + chaqna-gaudi-conversation-ui-server: image: opea/chatqna-conversation-ui:latest ... ports: