|
1 |
| -# Deployment on Xeon |
| 1 | +# Single node on-prem deployment with Docker Compose on Xeon Scalable processors |
2 | 2 |
|
3 |
| -We deploy the retrieval tool on Xeon. For LLMs, we support OpenAI models via API calls. For instructions on using open-source LLMs, please refer to the deployment guide [here](../../../../README.md). |
| 3 | +This example showcases a hierarchical multi-agent system for question-answering applications. We deploy the example on Xeon. For LLMs, we use OpenAI models via API calls. For instructions on using open-source LLMs, please refer to the deployment guide [here](../../../../README.md). |
| 4 | + |
| 5 | +## Deployment with docker |
| 6 | + |
| 7 | +1. First, clone this repo. |
| 8 | + ``` |
| 9 | + export WORKDIR=<your-work-directory> |
| 10 | + cd $WORKDIR |
| 11 | + git clone https://github.com/opea-project/GenAIExamples.git |
| 12 | + ``` |
| 13 | +2. Set up environment for this example </br> |
| 14 | + |
| 15 | + ``` |
| 16 | + # Example: host_ip="192.168.1.1" or export host_ip="External_Public_IP" |
| 17 | + export host_ip=$(hostname -I | awk '{print $1}') |
| 18 | + # if you are in a proxy environment, also set the proxy-related environment variables |
| 19 | + export http_proxy="Your_HTTP_Proxy" |
| 20 | + export https_proxy="Your_HTTPs_Proxy" |
| 21 | + # Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1" |
| 22 | + export no_proxy="Your_No_Proxy" |
| 23 | +
|
| 24 | + export TOOLSET_PATH=$WORKDIR/GenAIExamples/AgentQnA/tools/ |
| 25 | + #OPANAI_API_KEY if you want to use OpenAI models |
| 26 | + export OPENAI_API_KEY=<your-openai-key> |
| 27 | + ``` |
| 28 | + |
| 29 | +3. Deploy the retrieval tool (i.e., DocIndexRetriever mega-service) |
| 30 | + |
| 31 | + First, launch the mega-service. |
| 32 | + |
| 33 | + ``` |
| 34 | + cd $WORKDIR/GenAIExamples/AgentQnA/retrieval_tool |
| 35 | + bash launch_retrieval_tool.sh |
| 36 | + ``` |
| 37 | + |
| 38 | + Then, ingest data into the vector database. Here we provide an example. You can ingest your own data. |
| 39 | + |
| 40 | + ``` |
| 41 | + bash run_ingest_data.sh |
| 42 | + ``` |
| 43 | + |
| 44 | +4. Launch Tool service |
| 45 | + In this example, we will use some of the mock APIs provided in the Meta CRAG KDD Challenge to demonstrate the benefits of gaining additional context from mock knowledge graphs. |
| 46 | + ``` |
| 47 | + docker run -d -p=8080:8000 docker.io/aicrowd/kdd-cup-24-crag-mock-api:v0 |
| 48 | + ``` |
| 49 | +5. Launch `Agent` service |
| 50 | + |
| 51 | + The configurations of the supervisor agent and the worker agent are defined in the docker-compose yaml file. We currently use openAI GPT-4o-mini as LLM, and llama3.1-70B-instruct (served by TGI-Gaudi) in Gaudi example. To use openai llm, run command below. |
| 52 | + |
| 53 | + ``` |
| 54 | + cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon |
| 55 | + bash launch_agent_service_openai.sh |
| 56 | + ``` |
| 57 | + |
| 58 | +6. [Optional] Build `Agent` docker image if pulling images failed. |
| 59 | + |
| 60 | + ``` |
| 61 | + git clone https://github.com/opea-project/GenAIComps.git |
| 62 | + cd GenAIComps |
| 63 | + docker build -t opea/agent-langchain:latest -f comps/agent/langchain/Dockerfile . |
| 64 | + ``` |
| 65 | + |
| 66 | +## Validate services |
| 67 | + |
| 68 | +First look at logs of the agent docker containers: |
| 69 | + |
| 70 | +``` |
| 71 | +# worker agent |
| 72 | +docker logs rag-agent-endpoint |
| 73 | +``` |
| 74 | + |
| 75 | +``` |
| 76 | +# supervisor agent |
| 77 | +docker logs react-agent-endpoint |
| 78 | +``` |
| 79 | + |
| 80 | +You should see something like "HTTP server setup successful" if the docker containers are started successfully.</p> |
| 81 | + |
| 82 | +Second, validate worker agent: |
| 83 | + |
| 84 | +``` |
| 85 | +curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{ |
| 86 | + "query": "Most recent album by Taylor Swift" |
| 87 | + }' |
| 88 | +``` |
| 89 | + |
| 90 | +Third, validate supervisor agent: |
| 91 | + |
| 92 | +``` |
| 93 | +curl http://${host_ip}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{ |
| 94 | + "query": "Most recent album by Taylor Swift" |
| 95 | + }' |
| 96 | +``` |
| 97 | + |
| 98 | +## How to register your own tools with agent |
| 99 | + |
| 100 | +You can take a look at the tools yaml and python files in this example. For more details, please refer to the "Provide your own tools" section in the instructions [here](https://github.com/opea-project/GenAIComps/tree/main/comps/agent/langchain/README.md). |
0 commit comments