Skip to content

Commit 6dfffa3

Browse files
sgurunatchyundunovDatamonsters
authored andcommitted
New Productivity Suite react UI and Bug Fixes (opea-project#1834)
Signed-off-by: Gurunath S <gurunath.s@intel.com> Signed-off-by: Chingis Yundunov <c.yundunov@datamonsters.com>
1 parent 257b633 commit 6dfffa3

File tree

153 files changed

+7923
-2698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+7923
-2698
lines changed

ProductivitySuite/README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ flowchart LR
3838
direction LR
3939
LLM_CG([LLM MicroService]):::blue
4040
end
41-
subgraph FaqGen-MegaService["FaqGen MegaService "]
42-
direction LR
43-
LLM_F([LLM MicroService]):::blue
44-
end
41+
4542
subgraph UserInterface[" User Interface "]
4643
direction LR
4744
a([User Input Query]):::orchid
@@ -63,7 +60,7 @@ flowchart LR
6360
LLM_gen_CG{{LLM Service <br>}}
6461
GW_CG([CodeGen GateWay<br>]):::orange
6562
LLM_gen_F{{LLM Service <br>}}
66-
GW_F([FaqGen GateWay<br>]):::orange
63+
6764
PR([Prompt Registry MicroService]):::blue
6865
CH([Chat History MicroService]):::blue
6966
MDB{{Mongo DB<br><br>}}
@@ -118,11 +115,6 @@ flowchart LR
118115
direction LR
119116
LLM_CG <-.-> LLM_gen_CG
120117
121-
%% Questions interaction
122-
direction LR
123-
UI --> GW_F
124-
GW_F <==> FaqGen-MegaService
125-
126118
127119
%% Embedding service flow
128120
direction LR
@@ -158,10 +150,6 @@ Engage in intelligent conversations with your documents using our advanced **Ret
158150

159151
Summarize lengthy documents or articles, enabling you to grasp key takeaways quickly. Save time and effort with our intelligent summarization feature!
160152

161-
### ❓ FAQ Generation
162-
163-
Effortlessly create comprehensive FAQs based on your documents. Ensure your users have access to the information they need with minimal effort!
164-
165153
### 💻 Code Generation
166154

167155
Boost your coding productivity by providing a description of the functionality you require. Our application generates corresponding code snippets, saving you valuable time and effort!
-11.2 KB
Loading
31.6 KB
Loading
Loading
-46.6 KB
Loading
-14.7 KB
Loading
94.7 KB
Loading

ProductivitySuite/docker_compose/intel/cpu/xeon/README.md

Lines changed: 46 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -108,68 +108,46 @@ Since the `compose.yaml` will consume some environment variables, you need to se
108108
export host_ip="External_Public_IP"
109109
```
110110

111-
**Export the value of your Huggingface API token to the `your_hf_api_token` environment variable**
111+
**Export the value of your Huggingface API token to the `HUGGINGFACEHUB_API_TOKEN` environment variable**
112112

113113
> Change the Your_Huggingface_API_Token below with tyour actual Huggingface API Token value
114114
115115
```
116-
export your_hf_api_token="Your_Huggingface_API_Token"
116+
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
117117
```
118118

119119
**Append the value of the public IP address to the no_proxy list**
120120

121121
```
122-
export your_no_proxy=${your_no_proxy},"External_Public_IP"
122+
export no_proxy=${no_proxy},"External_Public_IP"
123123
```
124124

125125
```bash
126-
export MONGO_HOST=${host_ip}
127-
export MONGO_PORT=27017
128-
export DB_NAME="test"
129-
export COLLECTION_NAME="Conversations"
126+
export DB_NAME="opea"
130127
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
131128
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
132129
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
133130
export LLM_MODEL_ID_CODEGEN="meta-llama/CodeLlama-7b-hf"
134-
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6006"
135-
export TEI_RERANKING_ENDPOINT="http://${host_ip}:8808"
136-
export TGI_LLM_ENDPOINT="http://${host_ip}:9009"
137-
export REDIS_URL="redis://${host_ip}:6379"
138131
export INDEX_NAME="rag-redis"
139-
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
140-
export MEGA_SERVICE_HOST_IP=${host_ip}
141-
export EMBEDDING_SERVICE_HOST_IP=${host_ip}
142-
export RETRIEVER_SERVICE_HOST_IP=${host_ip}
143-
export RERANK_SERVICE_HOST_IP=${host_ip}
144-
export LLM_SERVICE_HOST_IP=${host_ip}
145-
export LLM_SERVICE_HOST_IP_DOCSUM=${host_ip}
146-
export LLM_SERVICE_HOST_IP_FAQGEN=${host_ip}
147-
export LLM_SERVICE_HOST_IP_CODEGEN=${host_ip}
148-
export LLM_SERVICE_HOST_IP_CHATQNA=${host_ip}
149-
export TGI_LLM_ENDPOINT_CHATQNA="http://${host_ip}:9009"
150-
export TGI_LLM_ENDPOINT_CODEGEN="http://${host_ip}:8028"
151-
export TGI_LLM_ENDPOINT_FAQGEN="http://${host_ip}:9009"
152-
export TGI_LLM_ENDPOINT_DOCSUM="http://${host_ip}:9009"
132+
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
153133
export BACKEND_SERVICE_ENDPOINT_CHATQNA="http://${host_ip}:8888/v1/chatqna"
154-
export DATAPREP_DELETE_FILE_ENDPOINT="http://${host_ip}:5000/v1/dataprep/delete"
134+
export DATAPREP_DELETE_FILE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/delete"
155135
export BACKEND_SERVICE_ENDPOINT_CODEGEN="http://${host_ip}:7778/v1/codegen"
156136
export BACKEND_SERVICE_ENDPOINT_DOCSUM="http://${host_ip}:8890/v1/docsum"
157-
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:5000/v1/dataprep/ingest"
158-
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:5000/v1/dataprep/get"
137+
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
138+
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/get"
159139
export CHAT_HISTORY_CREATE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/create"
160140
export CHAT_HISTORY_CREATE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/create"
161141
export CHAT_HISTORY_DELETE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/delete"
162142
export CHAT_HISTORY_GET_ENDPOINT="http://${host_ip}:6012/v1/chathistory/get"
163143
export PROMPT_SERVICE_GET_ENDPOINT="http://${host_ip}:6018/v1/prompt/get"
164144
export PROMPT_SERVICE_CREATE_ENDPOINT="http://${host_ip}:6018/v1/prompt/create"
145+
export PROMPT_SERVICE_DELETE_ENDPOINT="http://${host_ip}:6018/v1/prompt/delete"
165146
export KEYCLOAK_SERVICE_ENDPOINT="http://${host_ip}:8080"
166-
export LLM_SERVICE_HOST_PORT_FAQGEN=9002
167-
export LLM_SERVICE_HOST_PORT_CODEGEN=9001
168-
export LLM_SERVICE_HOST_PORT_DOCSUM=9003
169-
export PROMPT_COLLECTION_NAME="prompt"
170-
export RERANK_SERVER_PORT=8808
171-
export EMBEDDING_SERVER_PORT=6006
172-
export LLM_SERVER_PORT=9009
147+
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
148+
149+
#Set no proxy
150+
export no_proxy="$no_proxy,tgi_service_codegen,llm_codegen,tei-embedding-service,tei-reranking-service,chatqna-xeon-backend-server,retriever,tgi-service,redis-vector-db,whisper,llm-docsum-tgi,docsum-xeon-backend-server,mongo,codegen"
173151
```
174152

175153
Note: Please replace with `host_ip` with you external IP address, do not use localhost.
@@ -203,16 +181,7 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
203181
-H 'Content-Type: application/json'
204182
```
205183

206-
2. Embedding Microservice
207-
208-
```bash
209-
curl http://${host_ip}:6000/v1/embeddings\
210-
-X POST \
211-
-d '{"text":"hello"}' \
212-
-H 'Content-Type: application/json'
213-
```
214-
215-
3. Retriever Microservice
184+
2. Retriever Microservice
216185

217186
To consume the retriever microservice, you need to generate a mock embedding vector by Python script. The length of embedding vector
218187
is determined by the embedding model.
@@ -222,13 +191,13 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
222191

223192
```bash
224193
export your_embedding=$(python3 -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)")
225-
curl http://${host_ip}:7000/v1/retrieval \
194+
curl http://${host_ip}:7001/v1/retrieval \
226195
-X POST \
227196
-d "{\"text\":\"test\",\"embedding\":${your_embedding}}" \
228197
-H 'Content-Type: application/json'
229198
```
230199

231-
4. TEI Reranking Service
200+
3. TEI Reranking Service
232201

233202
```bash
234203
curl http://${host_ip}:8808/rerank \
@@ -237,16 +206,7 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
237206
-H 'Content-Type: application/json'
238207
```
239208

240-
5. Reranking Microservice
241-
242-
```bash
243-
curl http://${host_ip}:8000/v1/reranking\
244-
-X POST \
245-
-d '{"initial_query":"What is Deep Learning?", "retrieved_docs": [{"text":"Deep Learning is not..."}, {"text":"Deep learning is..."}]}' \
246-
-H 'Content-Type: application/json'
247-
```
248-
249-
6. LLM backend Service (ChatQnA, DocSum, FAQGen)
209+
4. LLM backend Service (ChatQnA, DocSum)
250210

251211
```bash
252212
curl http://${host_ip}:9009/generate \
@@ -255,7 +215,7 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
255215
-H 'Content-Type: application/json'
256216
```
257217

258-
7. LLM backend Service (CodeGen)
218+
5. LLM backend Service (CodeGen)
259219

260220
```bash
261221
curl http://${host_ip}:8028/generate \
@@ -264,67 +224,50 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
264224
-H 'Content-Type: application/json'
265225
```
266226

267-
8. ChatQnA LLM Microservice
227+
6. CodeGen LLM Microservice
268228

269229
```bash
270-
curl http://${host_ip}:9000/v1/chat/completions\
230+
curl http://${host_ip}:9001/v1/chat/completions\
271231
-X POST \
272-
-d '{"query":"What is Deep Learning?","max_tokens":17,"top_k":10,"top_p":0.95,"typical_p":0.95,"temperature":0.01,"repetition_penalty":1.03,"stream":true}' \
232+
-d '{"query":"def print_hello_world():"}' \
273233
-H 'Content-Type: application/json'
274234
```
275235

276-
9. CodeGen LLM Microservice
236+
7. DocSum LLM Microservice
277237

278238
```bash
279-
curl http://${host_ip}:9001/v1/chat/completions\
239+
curl http://${host_ip}:9003/v1/docsum\
280240
-X POST \
281-
-d '{"query":"def print_hello_world():"}' \
241+
-d '{"messages":"Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5", "type": "text"}' \
282242
-H 'Content-Type: application/json'
283243
```
284244

285-
10. DocSum LLM Microservice
286-
287-
```bash
288-
curl http://${host_ip}:9003/v1/docsum\
289-
-X POST \
290-
-d '{"query":"Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5"}' \
291-
-H 'Content-Type: application/json'
292-
```
293-
294-
11. FAQGen LLM Microservice
245+
8. ChatQnA MegaService
295246

296-
```bash
297-
curl http://${host_ip}:9002/v1/faqgen\
298-
-X POST \
299-
-d '{"query":"Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5"}' \
300-
-H 'Content-Type: application/json'
301-
```
302-
303-
12. ChatQnA MegaService
304-
305-
```bash
306-
curl http://${host_ip}:8888/v1/chatqna -H "Content-Type: application/json" -d '{
307-
"messages": "What is the revenue of Nike in 2023?"
308-
}'
309-
```
247+
```bash
248+
curl http://${host_ip}:8888/v1/chatqna -H "Content-Type: application/json" -d '{
249+
"messages": "What is the revenue of Nike in 2023?"
250+
}'
251+
```
310252

311-
13. DocSum MegaService
253+
9. DocSum MegaService
312254

313-
```bash
314-
curl http://${host_ip}:8890/v1/docsum -H "Content-Type: application/json" -d '{
315-
"messages": "Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."
316-
}'
317-
```
255+
```bash
256+
curl http://${host_ip}:8890/v1/docsum -H "Content-Type: application/json" -d '{
257+
"messages": "Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5.",
258+
"type": "text"
259+
}'
260+
```
318261

319-
14. CodeGen MegaService
262+
10. CodeGen MegaService
320263

321264
```bash
322265
curl http://${host_ip}:7778/v1/codegen -H "Content-Type: application/json" -d '{
323266
"messages": "def print_hello_world():"
324267
}'
325268
```
326269

327-
15. Dataprep Microservice
270+
11. Dataprep Microservice
328271

329272
If you want to update the default knowledge base, you can use the following commands:
330273

@@ -374,13 +317,13 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
374317
-H "Content-Type: application/json"
375318
```
376319

377-
16. Prompt Registry Microservice
320+
12. Prompt Registry Microservice
378321

379322
If you want to update the default Prompts in the application for your user, you can use the following commands:
380323

381324
```bash
382325
curl -X 'POST' \
383-
http://{host_ip}:6018/v1/prompt/create \
326+
"http://${host_ip}:6018/v1/prompt/create" \
384327
-H 'accept: application/json' \
385328
-H 'Content-Type: application/json' \
386329
-d '{
@@ -392,14 +335,14 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
392335

393336
```bash
394337
curl -X 'POST' \
395-
http://{host_ip}:6018/v1/prompt/get \
338+
"http://${host_ip}:6018/v1/prompt/get" \
396339
-H 'accept: application/json' \
397340
-H 'Content-Type: application/json' \
398341
-d '{
399342
"user": "test"}'
400343
401344
curl -X 'POST' \
402-
http://{host_ip}:6018/v1/prompt/get \
345+
"http://${host_ip}:6018/v1/prompt/get" \
403346
-H 'accept: application/json' \
404347
-H 'Content-Type: application/json' \
405348
-d '{
@@ -410,14 +353,14 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det
410353

411354
```bash
412355
curl -X 'POST' \
413-
http://{host_ip}:6018/v1/prompt/delete \
356+
"http://${host_ip}:6018/v1/prompt/delete" \
414357
-H 'accept: application/json' \
415358
-H 'Content-Type: application/json' \
416359
-d '{
417360
"user": "test", "prompt_id":"{prompt_id to be deleted}"}'
418361
```
419362

420-
17. Chat History Microservice
363+
13. Chat History Microservice
421364

422365
To validate the chatHistory Microservice, you can use the following commands.
423366

@@ -527,15 +470,4 @@ Here're some of the project's features:
527470
528471
#### Screenshots
529472
530-
![project-screenshot](../../../../assets/img/doc_summary_paste.png)
531-
![project-screenshot](../../../../assets/img/doc_summary_file.png)
532-
533-
### ❓ FAQ Generator
534-
535-
- **Generate FAQs from Text via Pasting**: Paste the text to into the text box, then click 'Generate FAQ' to produce a condensed FAQ of the content, which will be displayed in the 'FAQ' box below.
536-
537-
- **Generate FAQs from Text via txt file Upload**: Upload the file in the Upload bar, then click 'Generate FAQ' to produce a condensed FAQ of the content, which will be displayed in the 'FAQ' box below.
538-
539-
#### Screenshots
540-
541-
![project-screenshot](../../../../assets/img/faq_generator.png)
473+
![project-screenshot](../../../../assets/img/doc_summary.png)

0 commit comments

Comments
 (0)