@@ -61,42 +61,42 @@ Run the command to download LLM models. The <host_ip> is the one set in [Ollama
61
61
```
62
62
export host_ip=<host_ip>
63
63
export OLLAMA_HOST=http://${host_ip}:11434
64
- ollama pull llama3
64
+ ollama pull llama3.2
65
65
```
66
66
67
67
After downloaded the models, you can list the models by ` ollama list ` .
68
68
69
69
The output should be similar to the following:
70
70
71
71
```
72
- NAME ID SIZE MODIFIED
73
- llama3:latest 365c0bd3c000 4.7 GB 5 days ago
72
+ NAME ID SIZE MODIFIED
73
+ llama3.2 :latest a80c4f17acd5 2.0 GB 2 minutes ago
74
74
```
75
75
76
76
### Consume Ollama LLM Service
77
77
78
78
Access ollama service to verify that the ollama is functioning correctly.
79
79
80
80
``` bash
81
- curl http://${host_ip} :11434/api/generate -d ' {"model": "llama3", "prompt":"What is Deep Learning?"}'
81
+ curl http://${host_ip} :11434/api/generate -d ' {"model": "llama3.2 ", "prompt":"What is Deep Learning?"}'
82
82
```
83
83
84
84
The outputs are similar to these:
85
85
86
86
```
87
- {"model":"llama3","created_at":"2024-10-11T07:58:38.949268562Z ","response":"Deep","done":false}
88
- {"model":"llama3","created_at":"2024-10-11T07:58:39.017625351Z ","response":" learning","done":false}
89
- {"model":"llama3","created_at":"2024-10-11T07:58:39.102848076Z ","response":" is","done":false}
90
- {"model":"llama3","created_at":"2024-10-11T07:58:39.171037991Z ","response":" a","done":false}
91
- {"model":"llama3","created_at":"2024-10-11T07:58:39.243757952Z ","response":" subset","done":false}
92
- {"model":"llama3","created_at":"2024-10-11T07:58:39.328708084Z ","response":" of","done":false}
93
- {"model":"llama3","created_at":"2024-10-11T07:58:39.413844974Z ","response":" machine","done":false}
94
- {"model":"llama3","created_at":"2024-10-11T07:58:39.486239329Z ","response":" learning","done":false}
95
- {"model":"llama3","created_at":"2024-10-11T07:58:39.555960842Z ","response":" that","done":false}
96
- {"model":"llama3","created_at":"2024-10-11T07:58:39.642418238Z ","response":" involves","done":false}
97
- {"model":"llama3","created_at":"2024-10-11T07:58:39.714137478Z ","response":" the","done":false}
98
- {"model":"llama3","created_at":"2024-10-11T07:58:39.798776679Z ","response":" use","done":false}
99
- {"model":"llama3","created_at":"2024-10-11T07:58:39.883747938Z ","response":" of","done":false}
87
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.098813868Z ","response":"Deep","done":false}
88
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.124514468Z ","response":" learning","done":false}
89
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.149754216Z ","response":" is","done":false}
90
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.180420784Z ","response":" a","done":false}
91
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.229185873Z ","response":" subset","done":false}
92
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.263956118Z ","response":" of","done":false}
93
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.289097354Z ","response":" machine","done":false}
94
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.316838918Z ","response":" learning","done":false}
95
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.342309506Z ","response":" that","done":false}
96
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.367221264Z ","response":" involves","done":false}
97
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.39205893Z ","response":" the","done":false}
98
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.417933974Z ","response":" use","done":false}
99
+ {"model":"llama3.2 ","created_at":"2024-10-12T12:55:28.443110388Z ","response":" of","done":false}
100
100
...
101
101
```
102
102
@@ -155,13 +155,21 @@ cd ~/OPEA/GenAIExamples/ChatQnA/ui
155
155
docker build --no-cache -t opea/chatqna-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile .
156
156
```
157
157
158
- Then run the command ` docker images ` , you will have the following 5 Docker Images:
158
+ ### 6. Build Nginx Docker Image
159
+
160
+ ``` bash
161
+ cd GenAIComps
162
+ docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/nginx/Dockerfile .
163
+ ```
164
+
165
+ Then run the command ` docker images ` , you will have the following 6 Docker Images:
159
166
160
167
1 . ` opea/dataprep-redis:latest `
161
168
2 . ` opea/retriever-redis:latest `
162
169
3 . ` opea/llm-ollama:latest `
163
170
4 . ` opea/chatqna:latest `
164
171
5 . ` opea/chatqna-ui:latest `
172
+ 6 . ` opea/nginx:latest `
165
173
166
174
## 🚀 Start Microservices
167
175
@@ -201,55 +209,21 @@ export http_proxy=${your_http_proxy}
201
209
export https_proxy=${your_http_proxy}
202
210
export EMBEDDING_MODEL_ID=" BAAI/bge-base-en-v1.5"
203
211
export RERANK_MODEL_ID=" BAAI/bge-reranker-base"
204
- export TEI_EMBEDDING_ENDPOINT=" http://${host_ip} :6006"
205
- export REDIS_URL=" redis://${host_ip} :6379"
206
212
export INDEX_NAME=" rag-redis"
207
213
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
208
- export MEGA_SERVICE_HOST_IP=${host_ip}
209
- export EMBEDDING_SERVER_HOST_IP=${host_ip}
210
- export RETRIEVER_SERVICE_HOST_IP=${host_ip}
211
- export RERANK_SERVER_HOST_IP=${host_ip}
212
- export LLM_SERVER_HOST_IP=${host_ip}
213
- export BACKEND_SERVICE_ENDPOINT=" http://${host_ip} :8888/v1/chatqna"
214
- export DATAPREP_SERVICE_ENDPOINT=" http://${host_ip} :6007/v1/dataprep"
215
- export DATAPREP_GET_FILE_ENDPOINT=" http://${host_ip} :6007/v1/dataprep/get_file"
216
- export DATAPREP_DELETE_FILE_ENDPOINT=" http://${host_ip} :6007/v1/dataprep/delete_file"
217
- export FRONTEND_SERVICE_IP=${host_ip}
218
- export FRONTEND_SERVICE_PORT=5173
219
- export BACKEND_SERVICE_NAME=chatqna
220
- export BACKEND_SERVICE_IP=${host_ip}
221
- export BACKEND_SERVICE_PORT=8888
222
-
223
214
export OLLAMA_ENDPOINT=http://${host_ip} :11434
224
- export OLLAMA_MODEL=" llama3"
215
+ export OLLAMA_MODEL=" llama3.2 "
225
216
```
226
217
227
218
- Windows PC
228
219
229
220
``` bash
230
221
set EMBEDDING_MODEL_ID=BAAI/bge-base-en-v1.5
231
222
set RERANK_MODEL_ID=BAAI/bge-reranker-base
232
- set TEI_EMBEDDING_ENDPOINT=http://%host_ip%:6006
233
- set REDIS_URL=redis://%host_ip%:6379
234
223
set INDEX_NAME=rag-redis
235
224
set HUGGINGFACEHUB_API_TOKEN=%your_hf_api_token%
236
- set MEGA_SERVICE_HOST_IP=%host_ip%
237
- set EMBEDDING_SERVER_HOST_IP=%host_ip%
238
- set RETRIEVER_SERVICE_HOST_IP=%host_ip%
239
- set RERANK_SERVER_HOST_IP=%host_ip%
240
- set LLM_SERVER_HOST_IP=%host_ip%
241
- set BACKEND_SERVICE_ENDPOINT=http://%host_ip%:8888/v1/chatqna
242
- set DATAPREP_SERVICE_ENDPOINT=http://%host_ip%:6007/v1/dataprep
243
- set DATAPREP_GET_FILE_ENDPOINT=" http://%host_ip%:6007/v1/dataprep/get_file"
244
- set DATAPREP_DELETE_FILE_ENDPOINT=" http://%host_ip%:6007/v1/dataprep/delete_file"
245
- set FRONTEND_SERVICE_IP=%host_ip%
246
- set FRONTEND_SERVICE_PORT=5173
247
- set BACKEND_SERVICE_NAME=chatqna
248
- set BACKEND_SERVICE_IP=%host_ip%
249
- set BACKEND_SERVICE_PORT=8888
250
-
251
225
set OLLAMA_ENDPOINT=http://host.docker.internal:11434
252
- set OLLAMA_MODEL=" llama3"
226
+ set OLLAMA_MODEL=" llama3.2 "
253
227
```
254
228
255
229
Note: Please replace with ` host_ip ` with you external IP address, do not use localhost.
@@ -263,15 +237,6 @@ cd ~/OPEA/GenAIExamples/ChatQnA/docker_compose/intel/cpu/aipc/
263
237
docker compose up -d
264
238
```
265
239
266
- Let ollama service runs (if you have started ollama service in [ Prerequisites] ( #Prerequisites ) , skip this step)
267
-
268
- ``` bash
269
- # e.g. ollama run llama3
270
- OLLAMA_HOST=${host_ip} :11434 ollama run $OLLAMA_MODEL
271
- # for windows
272
- # ollama run %OLLAMA_MODEL%
273
- ```
274
-
275
240
### Validate Microservices
276
241
277
242
Follow the instructions to validate MicroServices.
@@ -309,7 +274,7 @@ For details on how to verify the correctness of the response, refer to [how-to-v
309
274
4 . Ollama Service
310
275
311
276
``` bash
312
- curl http://${host_ip} :11434/api/generate -d ' {"model": "llama3", "prompt":"What is Deep Learning?"}'
277
+ curl http://${host_ip} :11434/api/generate -d ' {"model": "llama3.2 ", "prompt":"What is Deep Learning?"}'
313
278
```
314
279
315
280
5 . LLM Microservice
@@ -325,7 +290,7 @@ For details on how to verify the correctness of the response, refer to [how-to-v
325
290
326
291
``` bash
327
292
curl http://${host_ip} :8888/v1/chatqna -H " Content-Type: application/json" -d ' {
328
- "messages": "What is the revenue of Nike in 2023?", "model": " ' " ${OLLAMA_MODEL} " ' "
293
+ "messages": "What is the revenue of Nike in 2023?"
329
294
}'
330
295
```
331
296
0 commit comments