NVIDIA-NeMo / NVIDIA-NeMo/Guardrails

Model Initialization Fails with VertexAI.model_rebuild() Error and Dependency Conflicts in NeMo Guardrails 0.16.0 with Vertex AI Gemini

Open
#1,418 5 comments 2 reactions 1 assignee View on GitHub

@Pouyanpi is already working on this.

Since Mar 30, 2026.

bug status: needs triage
Dominant language
Python
Stars
7.2k
Forks
842
Avg merge
3d 1h
Merged PRs (30d)
25

Description

Did you check docs and existing issues?
  • I have read all the NeMo-Guardrails docs
  • I have updated the package to the latest version before submitting this issue
  • (optional) I have used the develop branch
  • I have searched the existing issues of NeMo-Guardrails
Python version (python --version)

3.11

Operating system/version

windows

NeMo-Guardrails version (if you must use a specific version and not the latest

0.16.0

Describe the bug

I'm experiencing two critical errors when initializing NeMo Guardrails 0.16.0 with Vertex AI integration:

ActionResult Import Error: Failed to register actions.py from actions.py in action dispatcher due to exception: cannot import name 'ActionResult' from 'nemoguardrails.actions.action_dispatcher'

VertexAI Pydantic Error: Failed to initialize model 'gemini-2.0-flash-001' with provider 'vertexai' in 'chat' mode: 'VertexAI' is not fully defined; you should define '_LanguageModel', then call 'VertexAI.model_rebuild()'

Environment Details
Python version: Python 3.11.x

Operating system: Windows 11

NeMo-Guardrails version: 0.16.0

langchain-google-vertexai version: Latest

Vertex AI integration: Google Cloud Project with service account authentication

Error Output
text
✅ NeMo Guardrails imports successful

Testing NeMo Guardrails 0.16.0 Setup

✅ Google API Key found: AIzaSyBsl1...
✅ Credentials file found: C:\Users\harshith.kc\Downloads\customizationagents\customization-agents.json
✅ Vertex AI initialized successfully
✅ Guardrails config created successfully
Failed to register actions.py from actions.py in action dispatcher due to exception: cannot import name 'ActionResult' from 'nemoguardrails.actions.action_dispatcher'
❌ Guardrails test failed: Failed to initialize model 'gemini-2.0-flash-001' with provider 'vertexai' in 'chat' mode: VertexAI is not fully defined; you should define _LanguageModel, then call VertexAI.model_rebuild().

Steps To Reproduce

Install NeMo Guardrails 0.16.0 with Vertex AI dependencies

Create a standard guardrails configuration with:

config.yml with Vertex AI model configuration

actions.py with custom actions using @action decorator

rails.co with Colang 1.0 syntax flows

Initialize LLMRails(config) in Python code

Error occurs during initialization

Expected Behavior

NeMo Guardrails should initialize successfully without import errors

Custom actions should register properly using the @action decorator

Vertex AI integration should work seamlessly with proper model initialization

Actual Behavior

ActionResult Import Error: The system attempts to import ActionResult from nemoguardrails.actions.action_dispatcher, which appears to be removed or relocated in version 0.16.0

VertexAI Initialization Error: Even after calling VertexAI.model_rebuild(), the Pydantic model remains incompletely defined during NeMo Guardrails initialization

LLMRails fails to initialize, preventing the guardrails system from working

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.