> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/guardrails/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.exceptions

## Module Contents

### Classes

| Name                                                                                          | Description                                                                |
| --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [`ConfigurationError`](#nemoguardrails-exceptions-ConfigurationError)                         | Base class for Guardrails Configuration validation errors.                 |
| [`InvalidModelConfigurationError`](#nemoguardrails-exceptions-InvalidModelConfigurationError) | Raised when a guardrail configuration's model is invalid.                  |
| [`InvalidRailsConfigurationError`](#nemoguardrails-exceptions-InvalidRailsConfigurationError) | Raised when rails configuration is invalid.                                |
| [`InvalidStateError`](#nemoguardrails-exceptions-InvalidStateError)                           | Raised when a caller-supplied `state` argument is not valid public input.  |
| [`LLMAuthenticationError`](#nemoguardrails-exceptions-LLMAuthenticationError)                 | -                                                                          |
| [`LLMBadRequestError`](#nemoguardrails-exceptions-LLMBadRequestError)                         | -                                                                          |
| [`LLMCallException`](#nemoguardrails-exceptions-LLMCallException)                             | A wrapper around the LLM call invocation exception.                        |
| [`LLMClientError`](#nemoguardrails-exceptions-LLMClientError)                                 | Base class for LLM client errors.                                          |
| [`LLMConnectionError`](#nemoguardrails-exceptions-LLMConnectionError)                         | -                                                                          |
| [`LLMContextWindowError`](#nemoguardrails-exceptions-LLMContextWindowError)                   | -                                                                          |
| [`LLMRateLimitError`](#nemoguardrails-exceptions-LLMRateLimitError)                           | -                                                                          |
| [`LLMResponseValidationError`](#nemoguardrails-exceptions-LLMResponseValidationError)         | -                                                                          |
| [`LLMServerError`](#nemoguardrails-exceptions-LLMServerError)                                 | -                                                                          |
| [`LLMTimeoutError`](#nemoguardrails-exceptions-LLMTimeoutError)                               | -                                                                          |
| [`LLMUnsupportedParamsError`](#nemoguardrails-exceptions-LLMUnsupportedParamsError)           | -                                                                          |
| [`StreamingNotSupportedError`](#nemoguardrails-exceptions-StreamingNotSupportedError)         | Raised when streaming is requested but not supported by the configuration. |

### Data

[`__all__`](#nemoguardrails-exceptions-__all__)

### API

```python
class nemoguardrails.exceptions.ConfigurationError()
```

**Bases:** `ValueError`

Base class for Guardrails Configuration validation errors.

```python
class nemoguardrails.exceptions.InvalidModelConfigurationError()
```

**Bases:** [ConfigurationError](#nemoguardrails-exceptions-ConfigurationError)

Raised when a guardrail configuration's model is invalid.

```python
class nemoguardrails.exceptions.InvalidRailsConfigurationError()
```

**Bases:** [ConfigurationError](#nemoguardrails-exceptions-ConfigurationError)

Raised when rails configuration is invalid.

**Examples:**

```python
- Input/output rail references a model that doesn't exist in config
- Rail references a flow that doesn't exist
- Missing required prompt template
- Invalid rail parameters
```

```python
class nemoguardrails.exceptions.InvalidStateError()
```

**Bases:** `ValueError`

Raised when a caller-supplied `state` argument is not valid public input.

The serialized Colang 2.0 runtime State carries trusted control-plane fields
(`flow_configs`, `rails_config`, in-flight flow execution) and must not come
from an untrusted caller. Stateful 2.x execution uses `process_events_async`,
which keeps a live `State` object in the trusted Python process.

```python
class nemoguardrails.exceptions.LLMAuthenticationError()
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMBadRequestError()
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMCallException(
    inner_exception: typing.Union[BaseException, str],
    detail: typing.Optional[str] = None
)
```

Exception

**Bases:** `Exception`

A wrapper around the LLM call invocation exception.

This is used to propagate the exception out of the `generate_async` call. The default behavior is to
catch it and return an "Internal server error." message.

```python
class nemoguardrails.exceptions.LLMClientError(
    status_code: int,
    error_message: str,
    error_type: typing.Optional[str] = None,
    error_code: typing.Optional[str] = None,
    param: typing.Optional[str] = None,
    body: typing.Optional[dict] = None,
    response_headers: typing.Optional[dict] = None,
    model_name: typing.Optional[str] = None,
    provider_name: typing.Optional[str] = None,
    base_url: typing.Optional[str] = None
)
```

Exception

**Bases:** `Exception`

Base class for LLM client errors.

`status_code` holds the HTTP response status when one was received,
or `0` when no response arrived (client-side timeout or network
error). Callers should branch on exception class rather than
`status_code` to distinguish HTTP vs network failures, the type
hierarchy is the authoritative discriminator.

```python
nemoguardrails.exceptions.LLMClientError.__str__() -> str
```

```python
class nemoguardrails.exceptions.LLMConnectionError()
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMContextWindowError()
```

**Bases:** [LLMBadRequestError](#nemoguardrails-exceptions-LLMBadRequestError)

```python
class nemoguardrails.exceptions.LLMRateLimitError(
    status_code: int,
    error_message: str,
    error_type: typing.Optional[str] = None,
    error_code: typing.Optional[str] = None,
    param: typing.Optional[str] = None,
    body: typing.Optional[dict] = None,
    response_headers: typing.Optional[dict] = None,
    model_name: typing.Optional[str] = None,
    provider_name: typing.Optional[str] = None,
    base_url: typing.Optional[str] = None,
    retry_after_seconds: typing.Optional[float] = None
)
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMResponseValidationError(
    message: str,
    response_data: typing.Optional[dict] = None,
    model_name: typing.Optional[str] = None,
    provider_name: typing.Optional[str] = None,
    base_url: typing.Optional[str] = None
)
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMServerError()
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMTimeoutError()
```

**Bases:** [LLMClientError](#nemoguardrails-exceptions-LLMClientError)

```python
class nemoguardrails.exceptions.LLMUnsupportedParamsError()
```

**Bases:** [LLMBadRequestError](#nemoguardrails-exceptions-LLMBadRequestError)

```python
class nemoguardrails.exceptions.StreamingNotSupportedError()
```

**Bases:** [InvalidRailsConfigurationError](#nemoguardrails-exceptions-InvalidRailsConfigurationError)

Raised when streaming is requested but not supported by the configuration.

```python
nemoguardrails.exceptions.__all__ = ['ConfigurationError', 'InvalidModelConfigurationError', 'InvalidRailsConfigurat...
```