Skip to content

Breaking API change in v0.21.0 - UI sends model as object but API expects string #1728

@ksecurity45

Description

@ksecurity45

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)

Python: 3.10

Operating system/version

Docker

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

v0.21.0

Describe the bug

NeMo Guardrails v0.21.0 introduced a breaking change where the built-in web UI sends model as an object,
but the /v1/chat/completions API endpoint expects it as a string, causing all UI requests to fail with 422
Unprocessable Entity.

Steps to Reproduce

  1. Install NeMo Guardrails v0.21.0
  2. Start the server: nemoguardrails server --config=<config_path>
  3. Open the web UI at http://localhost:8000
  4. Send any message from the UI

Actual Behavior

UI sends:
{
  "model": {"id": "config_name", "name": "config_name", "maxLength": 10000},
  "messages": [{"role": "user", "content": "hello"}],
  "config_id": "config_name"
}

API returns 422 Unprocessable Entity:
{
  "detail": [{
    "type": "string_type",
    "loc": ["body", "model"],
    "msg": "Input should be a valid string"
  }]
}

Expected Behavior

Either:

  • Option A: API should accept model as both string and object (backward compatible)
  • Option B: UI should send model as string to match API format

Workaround

Pin to version <0.20.0:
nemoguardrails>=0.10.0,<0.20.0

Environment

  • NeMo Guardrails: v0.21.0 (broken), v0.19.0 (working)
  • Python: 3.10
  • Built-in web UI at /

Impact

Critical - Makes the built-in web UI completely unusable in v0.21.0+

Steps To Reproduce

Check description.

Expected Behavior

Check description.

Actual Behavior

Check description.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions