Skip to content

Fix/docker frontend build#90

Open
T-DevH wants to merge 7 commits into
mainfrom
fix/docker-frontend-build
Open

Fix/docker frontend build#90
T-DevH wants to merge 7 commits into
mainfrom
fix/docker-frontend-build

Conversation

@T-DevH

@T-DevH T-DevH commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Description

Brief description of the changes in this PR.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issues

Fixes #(issue number)

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Docker build successful
  • Helm chart validation passed

Screenshots (if applicable)

Add screenshots to help explain your changes.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Deployment Notes

Any special deployment considerations or environment variable changes.

Breaking Changes

If this is a breaking change, describe the impact and migration path.


Note

Medium Risk
Medium risk because it changes the embedding model/dimension (1024→2048), which requires Milvus collection recreation and could break retrieval if not migrated, and it updates default NIM endpoints/models used across LLM/guardrails/document pipeline.

Overview
Standardizes NIM usage on NVIDIA public cloud by switching default LLM_NIM_URL to https://integrate.api.nvidia.com/v1 and updating default LLM/guardrails model identifiers to nvidia/llama-3.3-nemotron-super-49b-v1.5 (removing Brev-specific guidance).

Migrates embeddings from nv-embedqa-e5-v5 (1024-d) to nvidia/llama-nemotron-embed-vl-1b-v2 (2048-d) by adding EMBEDDING_MODEL/EMBEDDING_DIMENSION, wiring Milvus retrievers and document indexing to read the dimension from env, updating guardrails configs/docs, and adding scripts/tools/recreate_milvus_collections.py to drop/recreate affected Milvus collections for the dimension change.

Improves frontend build reliability by pinning Node to 20.19.0-alpine, copying .npmrc into Docker builds, disabling ESLint during image build, switching CI from npm install to npm ci with cache/permission cleanup, and simplifying .eslintrc.js to avoid the jest/globals env error.

Reviewed by Cursor Bugbot for commit 8c5e4f9. Bugbot is set up for automated code reviews on this repo. Configure here.

T-DevH and others added 7 commits April 13, 2026 14:08
- Embeddings: llama-nemotron-embed-vl-1b-v2 (2048), EMBEDDING_DIMENSION, Milvus
- LLM defaults: integrate.api.nvidia.com/v1, llama-3.3-nemotron-super-49b-v1.5
- Docs and .env.example; guardrails and judge fallbacks aligned
- UI: ESLint 8 pin, devDependency eslint, drop react-app/jest extend
- Add recreate_milvus_collections.py; CI LLM_NIM_URL https
fix(ui): regenerate package-lock.json for npm ci with React 19 and MU…
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Attribute assignment immediately overwritten with raw parameters
    • Removed lines 47-48 that were overwriting the correctly resolved model_name and dimension values with raw None parameters.
  • ✅ Fixed: Env var renamed in example but not in code
    • Updated large_llm_judge.py to read LLAMA_49B_TIMEOUT instead of LLAMA_70B_TIMEOUT to match the .env.example configuration.

Create PR

Or push these changes by commenting:

@cursor push 9ed83ba2cc
Preview (9ed83ba2cc)
diff --git a/src/api/agents/document/validation/large_llm_judge.py b/src/api/agents/document/validation/large_llm_judge.py
--- a/src/api/agents/document/validation/large_llm_judge.py
+++ b/src/api/agents/document/validation/large_llm_judge.py
@@ -64,9 +64,8 @@
         # Use LLM_MODEL from .env (49B model on NVIDIA public cloud)
         self.model = os.getenv("LLM_MODEL", "nvidia/llama-3.3-nemotron-super-49b-v1.5")
         # Large LLM (49B) models need more time for complex evaluation prompts
-        # Default: 120 seconds (2 minutes), configurable via LLAMA_70B_TIMEOUT env var
-        # Note: Environment variable name kept as LLAMA_70B_TIMEOUT for backward compatibility
-        self.timeout = int(os.getenv("LLAMA_70B_TIMEOUT", "120"))
+        # Default: 120 seconds (2 minutes), configurable via LLAMA_49B_TIMEOUT env var
+        self.timeout = int(os.getenv("LLAMA_49B_TIMEOUT", "120"))
 
     async def initialize(self):
         """Initialize the Large LLM Judge."""

diff --git a/src/retrieval/vector/embedding_service.py b/src/retrieval/vector/embedding_service.py
--- a/src/retrieval/vector/embedding_service.py
+++ b/src/retrieval/vector/embedding_service.py
@@ -44,8 +44,6 @@
     ):
         self.model_name = model_name or os.getenv("EMBEDDING_MODEL", "nvidia/llama-nemotron-embed-vl-1b-v2")
         self.dimension = dimension if dimension is not None else int(os.getenv("EMBEDDING_DIMENSION", "2048"))
-        self.model_name = model_name
-        self.dimension = dimension
         self._initialized = False
         self.nim_client = None

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8c5e4f9. Configure here.

dimension: int | None = None,
):
self.model_name = model_name or os.getenv("EMBEDDING_MODEL", "nvidia/llama-nemotron-embed-vl-1b-v2")
self.dimension = dimension if dimension is not None else int(os.getenv("EMBEDDING_DIMENSION", "2048"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attribute assignment immediately overwritten with raw parameters

High Severity

Lines 45–46 correctly resolve model_name and dimension with env-var fallbacks, but lines 47–48 immediately overwrite self.model_name and self.dimension with the raw parameter values. When get_embedding_service() calls EmbeddingService() with no arguments, both attributes end up as None, breaking downstream calls (e.g., generate_embedding passes None as the model, and get_dimension() returns None).

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8c5e4f9. Configure here.

Comment thread .env.example
# Default: 120 seconds (2 minutes)
# Increase for complex documents that need more processing time
LLAMA_70B_TIMEOUT=120
LLAMA_49B_TIMEOUT=120

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Env var renamed in example but not in code

Medium Severity

The .env.example renames the timeout variable from LLAMA_70B_TIMEOUT to LLAMA_49B_TIMEOUT, but large_llm_judge.py still reads LLAMA_70B_TIMEOUT via os.getenv. Users following the example will set LLAMA_49B_TIMEOUT, which has no effect — the code will silently fall back to the 120-second default, making the timeout non-configurable through the documented variable name.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8c5e4f9. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes NVIDIA NIM configuration (models/endpoints) across backend, docs, and UI, migrates embeddings to a new 2048-dim model (with Milvus dimension wiring + a collection recreation tool), and improves frontend Docker/CI build determinism.

Changes:

  • Switch default NIM LLM endpoint/model to NVIDIA public cloud (integrate.api.nvidia.com/v1, nvidia/llama-3.3-nemotron-super-49b-v1.5) and update guardrails/judge/docs accordingly.
  • Migrate embeddings to nvidia/llama-nemotron-embed-vl-1b-v2 (2048-dim) and make Milvus dimension configurable via EMBEDDING_DIMENSION, including a script to drop affected collections.
  • Improve frontend build reliability by pinning Node image version, copying .npmrc into Docker builds, using npm ci, and adjusting ESLint config.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/test_embedding.py Updates embedding test to new model + asserts 2048 dimension.
src/ui/web/src/pages/Documentation.tsx UI docs updated to new embedding model name.
src/ui/web/src/pages/DocumentExtraction.tsx Pipeline stage label updated to new embedding model.
src/ui/web/package.json Adds deps/overrides and adjusts ESLint config for build stability.
src/ui/web/.eslintrc.js Simplifies ESLint extends to avoid jest/globals env error.
src/retrieval/vector/milvus_retriever.py Reads Milvus vector dimension from EMBEDDING_DIMENSION.
src/retrieval/vector/gpu_milvus_retriever.py Reads GPU Milvus vector dimension from EMBEDDING_DIMENSION.
src/retrieval/vector/embedding_service.py Makes embedding model/dimension configurable via env/defaults.
src/api/services/llm/nim_client.py Updates default LLM endpoint + LLM/embedding model defaults.
src/api/services/guardrails/guardrails_service.py Updates default guardrails model and related comments.
src/api/agents/document/validation/large_llm_judge.py Updates judge defaults to NVIDIA public cloud endpoint/model.
src/api/agents/document/processing/embedding_indexing.py Updates embedding model references + uses EMBEDDING_DIMENSION for mock vectors.
src/api/agents/document/preprocessing/nemo_retriever.py Updates fallback model identifier.
src/api/agents/document/mcp_document_agent.py Updates pipeline stage label to new embedding model.
src/api/agents/document/document_extraction_agent.py Updates pipeline stage label to new embedding model.
src/api/agents/document/action_tools.py Updates pipeline stage label to new embedding model.
scripts/tools/recreate_milvus_collections.py Adds tool to drop Milvus collections for embedding dimension migration.
docs/architecture/mcp-gpu-acceleration-guide.md Updates documented embedding dimension to 2048.
docs/architecture/diagrams/warehouse-operational-assistant.md Updates architecture diagram/model references + endpoints text.
docs/architecture/adr/002-nvidia-nims-integration.md Updates ADR to new embeddings model/dimension and LLM model id.
data/postgres/002_document_schema.sql Updates comment documenting embedding model name stored in DB.
data/config/guardrails/rails.yaml Updates guardrails main/embedding model identifiers.
data/config/guardrails/config.yml Updates guardrails main/embedding model identifiers.
README.md Updates README feature text and governing terms model link.
Dockerfile.frontend Pins Node image version and copies .npmrc before npm ci.
Dockerfile Pins Node image version, copies .npmrc, disables ESLint plugin during build.
DEPLOYMENT.md Updates deployment docs to new endpoints/models and embedding NIM image/model.
.github/workflows/main.yml Uses https endpoint and switches frontend install to npm ci with cleanup.
.env.example Updates env defaults for new endpoints/models and embedding dimension.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 47 to 48
self.model_name = model_name
self.dimension = dimension
Comment thread .env.example
# Default: 120 seconds (2 minutes)
# Increase for complex documents that need more processing time
LLAMA_70B_TIMEOUT=120
LLAMA_49B_TIMEOUT=120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants