You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-3Lines changed: 26 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,38 @@ The service uses the following environment variables:
21
21
22
22
### Running the Service
23
23
24
+
#### Running a single instance
25
+
26
+
1.**Build and Run:** Execute the following command in the root directory:
27
+
28
+
```bash
29
+
docker compose -f docker/compose.yml up --build -d
30
+
```
31
+
32
+
The first run will download the `clip-ViT-B-32` model by default (or the model you put in the env variables) (approx. 600MB) and store it in the persistent `model_cache` volume.
33
+
34
+
2. **Access the API:** The service will be available at `http://localhost:8000`.
35
+
36
+
#### Running a load-balanced n number of instances
37
+
38
+
The load balancing is handled by nginx and a set of replica containers are created. calling the nginx server would automatically choose the target instance.
39
+
40
+
**Note :** In order to have a single downloading instance of the default model, it's better to run the single instance compose file to populate the volume with the model files.
41
+
After that all instances will just read and load their copy of the model into VRAM.
42
+
43
+
**Note :** Ensure that you have enough VRAM to hold the model copies, otherwise some instances might crash or spill into system RAM.
44
+
24
45
1. **Build and Run:** Execute the following command in the root directory:
25
46
26
47
```bash
27
-
docker compose up --build -d
48
+
docker compose -f docker/compose_load_balanced.yml up --build -d
28
49
```
50
+
This will also download the default model,
51
+
52
+
2. **Access the API:** The service will be available at `http://localhost:8004`.
53
+
29
54
30
-
The first run will download the `clip-ViT-B-32` model by default (approx. 600MB) and store it in the persistent `model_cache` volume.
31
55
32
-
2. **Access the API:** The service will be available at `http://localhost:8000`. You can view the interactive documentation (Swagger UI) at `http://localhost:8000/docs`.
0 commit comments