Skip to content

Commit 7406050

Browse files
authored
Merge pull request #46 from NVIDIA-AI-Blueprints/antoniomtz/policy-compliance-advanced-options-ui
feat: add policy compliance
2 parents 520d1ba + 65f6b11 commit 7406050

25 files changed

Lines changed: 3155 additions & 215 deletions

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ A GenAI-powered catalog enrichment system that transforms basic product images i
4949
**AI Models:**
5050
- NVIDIA Nemotron VLM (vision-language model)
5151
- NVIDIA Nemotron LLM (prompt planning)
52+
- NVIDIA Embeddings (Policy Compliance)
5253
- FLUX models (image generation)
5354
- Microsoft TRELLIS (3D generation)
5455

5556
**Infrastructure:**
5657
- Docker & Docker Compose
5758
- NVIDIA NIM containers
5859
- HuggingFace model hosting
60+
- Milvus vector database for policy PDF retrieval
5961

6062
## Minimum System Requirements
6163

@@ -67,10 +69,11 @@ For self-hosting the NIM microservices locally, the following GPU requirements a
6769
|-------|---------|-------------|-----------------|
6870
| Nemotron-Nano-12B-V2-VL | Vision-Language Analysis | 1× A100 | 1× H100 |
6971
| Nemotron-Nano-V3 | Prompt Planning (LLM) | 1× A100 | 1× H100 |
72+
| nv-embedqa | Embeddings (Policy Compliance) | 1× A100 | 1× H100 |
7073
| FLUX Kontext Dev | Image Generation | 1× H100 | 1× H100 |
71-
| Microsoft TRELLIS | 3D Asset Generation | 1× L40S |L40S |
74+
| Microsoft TRELLIS | 3D Asset Generation | 1× L40S |H100 |
7275

73-
**Total recommended setup**: 3× H100 + 1× L40S (or 4× H100 for uniform configuration)
76+
**Total recommended setup**: 3× H100 + 1× L40S (or 4× H100 for uniform configuration). Embeddings model can be deploy on the same GPU as Flux or Trellis models.
7477

7578
### Deployment Options
7679

@@ -146,6 +149,10 @@ Make sure you have accepted [https://huggingface.co/black-forest-labs/FLUX.1-Kon
146149

147150
trellis:
148151
url: "http://localhost:8004/v1/infer" # Your TRELLIS NIM endpoint
152+
153+
embeddings:
154+
url: "http://localhost:8005/v1" #Your Embeddings NIM endpoint
155+
model: "nvidia/nv-embedqa-e5-v5"
149156
```
150157
151158
See the **[Docker Deployment Guide](docs/DOCKER.md)** for instructions on deploying these NIMs.
@@ -166,7 +173,7 @@ The frontend at `http://localhost:3000`.
166173

167174
### Docker Deployment (Self-Hosted NIMs)
168175

169-
The Docker deployment includes all required self-hosted NVIDIA NIM containers (Nemotron VLM, Nemotron LLM, FLUX, and TRELLIS). The `shared/config/config.yaml` is pre-configured with the correct service URLs for Docker networking.
176+
The Docker deployment includes all required self-hosted NVIDIA NIM containers (Nemotron VLM, Nemotron LLM, FLUX, and TRELLIS). If you want to use uploaded policy PDFs in the UI, start the companion Milvus stack from `docker-compose.rag.yml` as well. The `shared/config/config.yaml` is pre-configured with the correct service URLs for Docker networking.
170177

171178
For complete Docker deployment instructions, see the **[Docker Deployment Guide](docs/DOCKER.md)**.
172179

@@ -185,15 +192,27 @@ For complete Docker deployment instructions, see the **[Docker Deployment Guide]
185192
chmod a+w "$LOCAL_NIM_CACHE"
186193
```
187194

188-
3. **Start all services**:
195+
3. **Create the shared Docker network**:
196+
```bash
197+
docker network create catalog-network || true
198+
```
199+
200+
4. **Start the policy RAG stack**:
201+
```bash
202+
docker compose -f docker-compose.rag.yml up -d
203+
```
204+
205+
5. **Start the application stack**:
189206
```bash
190-
docker-compose up -d
207+
docker compose up -d
191208
```
192209

193-
4. **Access the application**:
210+
6. **Access the application**:
194211
- Frontend: `http://localhost:3000`
195212
- Backend API: `http://localhost:8000`
196213
- Health Check: `http://localhost:8000/health`
214+
- Milvus: `localhost:19530`
215+
- MinIO Console: `http://localhost:9001`
197216

198217
## API Endpoints
199218

@@ -211,12 +230,12 @@ For detailed API documentation with request/response examples, see **[API Docume
211230

212231
## License
213232

214-
GOVERNING TERMS: The Blueprint scripts are governed by Apache License, Version 2.0, and enables use of separate open source and proprietary software governed by their respective licenses: [NVIDIA-Nemotron-Nano-12B-v2-VL](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-nano-12b-v2-vl?version=1), [Nemotron-Nano-V3](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-3-nano?version=1.7.0), [FLUX.1-Kontext-Dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md), and [Microsoft TRELLIS](https://catalog.ngc.nvidia.com/orgs/nim/teams/microsoft/containers/trellis?version=1).
233+
GOVERNING TERMS: The Blueprint scripts are governed by Apache License, Version 2.0, and enables use of separate open source and proprietary software governed by their respective licenses: [NVIDIA-Nemotron-Nano-12B-v2-VL](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-nano-12b-v2-vl?version=1), [Nemotron-Nano-V3](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-3-nano?version=1.7.0), [nv-embedqa-e5-v5](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nv-embedqa-e5-v5?version=latest), [FLUX.1-Kontext-Dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md), and [Microsoft TRELLIS](https://catalog.ngc.nvidia.com/orgs/nim/teams/microsoft/containers/trellis?version=1).
215234

216235
ADDITIONAL INFORMATION:
217236
FLUX.1-Kontext-Dev license: [https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md).
218237

219238
Third-Party Community Consideration:
220239
The FLUX Kontext model is not owned or developed by NVIDIA. This model has been developed and built to a third-party’s requirements for this application and use case; see link to: black-forest-labs/FLUX.1-Kontext-dev Model Card - [https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev).
221240

222-
This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use.
241+
This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use.

deploy/1_Deploy_Catalog_Enrichment.ipynb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
"source": [
358358
"<a id=\"spin-up-blueprint\"></a>\n",
359359
"## Spin Up Blueprint\n",
360-
"Docker compose scripts are provided which spin up the microservices on a single node. This docker-compose yaml file will start the agents as well as dependant microservices. This may take up to **15 minutes** to complete.\n"
360+
"Docker compose scripts are provided which spin up the microservices on a single node. Start by creating the shared Docker network, then launch the Milvus policy RAG stack from `docker-compose.rag.yml`, and finally bring up the main application stack. This may take up to **15 minutes** to complete.\n"
361361
]
362362
},
363363
{
@@ -369,6 +369,8 @@
369369
},
370370
"outputs": [],
371371
"source": [
372+
"!docker network create catalog-network || true\n",
373+
"!docker compose -f docker-compose.rag.yml up -d > /dev/null 2>&1\n",
372374
"!docker compose up -d > /dev/null 2>&1"
373375
]
374376
},
@@ -413,7 +415,7 @@
413415
"id": "7d90c358-f0e9-4607-8b88-32a44ffce74e",
414416
"metadata": {},
415417
"source": [
416-
"This command should produce similiar output in the following format:"
418+
"These commands should produce similar output in the following format:"
417419
]
418420
},
419421
{
@@ -430,6 +432,10 @@
430432
"nim-llm 2025-12-16 18:30:24 +0000 UTC Up 1 minutes\n",
431433
"nim-trellis 2025-12-16 18:30:24 +0000 UTC Up 1 minutes\n",
432434
"nim-flux 2025-12-16 18:30:24 +0000 UTC Up 1 minutes\n",
435+
"embedqa 2025-12-16 18:30:24 +0000 UTC Up 1 minutes\n",
436+
"milvus-etcd 2025-12-16 18:30:24 +0000 UTC Up 1 minutes (healthy)\n",
437+
"milvus-minio 2025-12-16 18:30:24 +0000 UTC Up 1 minutes (healthy)\n",
438+
"milvus-standalone 2025-12-16 18:30:24 +0000 UTC Up 1 minutes (healthy)\n",
433439
"```"
434440
]
435441
},
@@ -529,7 +535,7 @@
529535
"<a id=\"stopping-services-and-cleaning-up\"></a>\n",
530536
"## Stopping Services and Cleaning Up\n",
531537
"\n",
532-
"To shut down the microservices, run the following command"
538+
"To shut down the microservices, run the following commands"
533539
]
534540
},
535541
{
@@ -539,7 +545,8 @@
539545
"metadata": {},
540546
"outputs": [],
541547
"source": [
542-
"!docker compose down > /dev/null 2>&1"
548+
"!docker compose down > /dev/null 2>&1\n",
549+
"!docker compose -f docker-compose.rag.yml down > /dev/null 2>&1"
543550
]
544551
},
545552
{
@@ -577,7 +584,8 @@
577584
"\n",
578585
"**Explanation:** When running the blueprint for the first time, all models need to be downloaded from their respective sources. Depending on your internet connection speed, this process can take 20-30 minutes or longer. The models include:\n",
579586
"- NVIDIA Nemotron VLM\n",
580-
"- NVIDIA Nemotron LLM \n",
587+
"- NVIDIA Nemotron LLM \n",
588+
"- NVIDIA Embeddings \n",
581589
"- FLUX image generation model\n",
582590
"- TRELLIS 3D asset generation model\n",
583591
"\n",
@@ -596,7 +604,7 @@
596604
"source": [
597605
"## LICENSE\n",
598606
"\n",
599-
"GOVERNING TERMS: The Blueprint scripts are governed by Apache License, Version 2.0, and enables use of separate open source and proprietary software governed by their respective licenses: [NVIDIA-Nemotron-Nano-12B-v2-VL](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-nano-12b-v2-vl?version=1), [Nemotron-Nano-V3](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-3-nano?version=1.7.0), [FLUX.1-Kontext-Dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md), and [Microsoft TRELLIS](https://catalog.ngc.nvidia.com/orgs/nim/teams/microsoft/containers/trellis?version=1).\n",
607+
"GOVERNING TERMS: The Blueprint scripts are governed by Apache License, Version 2.0, and enables use of separate open source and proprietary software governed by their respective licenses: [NVIDIA-Nemotron-Nano-12B-v2-VL](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-nano-12b-v2-vl?version=1), [Nemotron-Nano-V3](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nemotron-3-nano?version=1.7.0), [nv-embedqa-e5-v5](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/nv-embedqa-e5-v5?version=latest) [FLUX.1-Kontext-Dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md), and [Microsoft TRELLIS](https://catalog.ngc.nvidia.com/orgs/nim/teams/microsoft/containers/trellis?version=1).\n",
600608
"\n",
601609
"ADDITIONAL INFORMATION: \n",
602610
"FLUX.1-Kontext-Dev license: [https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/blob/main/LICENSE.md).\n",

docker-compose.rag.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
services:
2+
milvus-etcd:
3+
image: quay.io/coreos/etcd:v3.5.5
4+
container_name: milvus-etcd
5+
environment:
6+
- ETCD_AUTO_COMPACTION_MODE=revision
7+
- ETCD_AUTO_COMPACTION_RETENTION=1000
8+
- ETCD_QUOTA_BACKEND_BYTES=4294967296
9+
- ETCD_SNAPSHOT_COUNT=50000
10+
volumes:
11+
- etcd_data:/etcd
12+
command: etcd -listen-client-urls=http://0.0.0.0:2379 -advertise-client-urls=http://milvus-etcd:2379 --data-dir /etcd
13+
healthcheck:
14+
test: ["CMD", "etcdctl", "endpoint", "health"]
15+
interval: 30s
16+
timeout: 20s
17+
retries: 3
18+
networks:
19+
- catalog-network
20+
21+
milvus-minio:
22+
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
23+
container_name: milvus-minio
24+
environment:
25+
MINIO_ACCESS_KEY: minioadmin
26+
MINIO_SECRET_KEY: minioadmin
27+
volumes:
28+
- minio_data:/minio_data
29+
command: minio server /minio_data --console-address ":9001"
30+
ports:
31+
- "9001:9001"
32+
healthcheck:
33+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
34+
interval: 30s
35+
timeout: 20s
36+
retries: 3
37+
networks:
38+
- catalog-network
39+
40+
milvus-standalone:
41+
image: milvusdb/milvus:v2.4.0
42+
container_name: milvus-standalone
43+
command: ["milvus", "run", "standalone"]
44+
ports:
45+
- "19530:19530"
46+
- "9091:9091"
47+
environment:
48+
ETCD_ENDPOINTS: milvus-etcd:2379
49+
MINIO_ADDRESS: milvus-minio:9000
50+
volumes:
51+
- milvus_data:/var/lib/milvus
52+
depends_on:
53+
milvus-etcd:
54+
condition: service_healthy
55+
milvus-minio:
56+
condition: service_healthy
57+
healthcheck:
58+
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
59+
interval: 30s
60+
timeout: 20s
61+
retries: 3
62+
networks:
63+
- catalog-network
64+
65+
networks:
66+
catalog-network:
67+
external: true
68+
name: catalog-network
69+
70+
volumes:
71+
etcd_data:
72+
minio_data:
73+
milvus_data:

docker-compose.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ services:
2222
container_name: catalog-enrichment-backend
2323
environment:
2424
- NGC_API_KEY=${NGC_API_KEY}
25+
- NVIDIA_API_KEY=${NVIDIA_API_KEY:-}
26+
- NVIDIA_API_BASE_URL=${NVIDIA_API_BASE_URL:-https://integrate.api.nvidia.com/v1}
2527
- HF_TOKEN=${HF_TOKEN}
28+
- MILVUS_HOST=${MILVUS_HOST:-milvus-standalone}
29+
- MILVUS_PORT=${MILVUS_PORT:-19530}
2630
volumes:
2731
- ./data/outputs:/app/data/outputs
32+
- ./data/policies:/app/data/policies
2833
- ./shared/config:/app/shared/config:ro
2934
depends_on:
3035
- vlm-nim
@@ -105,6 +110,33 @@ services:
105110
networks:
106111
- catalog-network
107112

113+
# NVIDIA NIM - Embedding Model
114+
embedqa:
115+
image: nvcr.io/nim/nvidia/nv-embedqa-e5-v5:1.6
116+
container_name: embedqa
117+
ports:
118+
- "8005:8000"
119+
environment:
120+
- NGC_API_KEY=${NGC_API_KEY}
121+
volumes:
122+
- ${LOCAL_NIM_CACHE:-~/.cache/nim}:/opt/nim/.cache
123+
user: "${UID:-1000}"
124+
deploy:
125+
resources:
126+
reservations:
127+
devices:
128+
- driver: nvidia
129+
device_ids: ['2']
130+
capabilities: [gpu]
131+
restart: "no"
132+
healthcheck:
133+
test: ["CMD", "curl", "-f", "http://localhost:8000/v1/health/ready"]
134+
interval: 30s
135+
timeout: 10s
136+
retries: 5
137+
networks:
138+
- catalog-network
139+
108140
# Trellis Model - 3D Asset Generation
109141
trellis-nim:
110142
image: nvcr.io/nim/microsoft/trellis:1.0.1
@@ -157,9 +189,9 @@ services:
157189

158190
networks:
159191
catalog-network:
160-
driver: bridge
192+
external: true
193+
name: catalog-network
161194

162195
volumes:
163196
nim-cache:
164197
driver: local
165-

0 commit comments

Comments
 (0)