8
8
- Docker (used by unit tests and as preferred way to start Ollama)
9
9
- Ollama (install it from [ official site] ( https://ollama.com/download ) or use it inside Docker container)
10
10
- NVIDIA GPU (recommended) (checked on GeForce RTX 3060 12Gb)
11
- - On Linux to use GPU you need to install ` nvidia-container-toolkit ` according
12
- to [ article] ( https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container )
11
+ - On Linux to use GPU you need to install ` nvidia-container-toolkit ` according
12
+ to [ article] ( https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container )
13
13
14
14
## How to build application
15
15
@@ -24,10 +24,9 @@ docker compose -f docker-compose-prod.yml up
24
24
```
25
25
or use [ run-all.bat] ( run-all.bat ) script
26
26
27
- ## How to ask question to AI
27
+ ## How to ask question to AI model
28
28
29
29
Send POST request to ` /api/generate ` endpoint exposed by service with question inside ` prompt ` field of request body.
30
-
31
30
For example:
32
31
``` shell
33
32
curl -i -H ' Content-Type: application/json' \
@@ -41,6 +40,20 @@ curl -i -H 'Content-Type: application/json' \
41
40
-X POST http://localhost:8090/api/generate
42
41
```
43
42
43
+ ``` shell
44
+ curl -i -H ' Content-Type: application/json' \
45
+ -d ' { "prompt": "Write code of bubble sort using Java" }' \
46
+ -X POST http://localhost:8090/api/generate
47
+ ```
48
+
49
+ Or you could use prepared collection of Postman requests from [ postman folder] ( postman ) . Just import them into your
50
+ Postman
51
+
52
+ ## Video with description of the project
53
+
54
+ [ // ] : # ( [YouTube link]( ; https://youtu.be/SoDIjw-Ov8o) ; )
55
+ [ ![ YouTube link] ( https://markdown-videos-api.jorgenkh.no/url?url=https%3A%2F%2Fyoutu.be%2FSoDIjw-Ov8o )] ( https://youtu.be/SoDIjw-Ov8o )
56
+
44
57
## Appendix: communication with Ollama started inside a Docker container
45
58
46
59
According to [ instruction] ( https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image )
0 commit comments