> This page is for version v0.25.0.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.25.0: https://docs.nvidia.com/nemo/guardrails/v0.25.0/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

> 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.

# nemoguardrails.exceptions

## Module Contents

### Classes

| Name                                                                                          | Description                                                                                         |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [`ConfigurationError`](#nemoguardrails-exceptions-ConfigurationError)                         | Base class for Guardrails Configuration validation errors.                                          |
| [`InvalidCheckRequestError`](#nemoguardrails-exceptions-InvalidCheckRequestError)             | Raised when a check's arguments contradict each other, such as `tools` without a `tool_call` check. |
| [`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)           | -                                                                                                   |
| [`NonStreamingWorkQueueFullError`](#nemoguardrails-exceptions-NonStreamingWorkQueueFullError) | Raised when the IORails non-streaming admission queue cannot accept more work.                      |
| [`RailTypeNotConfiguredError`](#nemoguardrails-exceptions-RailTypeNotConfiguredError)         | Raised when an explicitly requested rail type has no configured flows.                              |
| [`RailTypeNotSupportedError`](#nemoguardrails-exceptions-RailTypeNotSupportedError)           | Raised when an explicitly requested rail type cannot run on the serving engine.                     |
| [`StreamingCapacityExceededError`](#nemoguardrails-exceptions-StreamingCapacityExceededError) | Raised when IORails has no free streaming slot for a new request.                                   |
| [`StreamingNotSupportedError`](#nemoguardrails-exceptions-StreamingNotSupportedError)         | Raised when streaming is requested but not supported by the configuration.                          |
| [`ToolConversationTooLongError`](#nemoguardrails-exceptions-ToolConversationTooLongError)     | Raised when a rendered tool conversation exceeds the general prompt limit.                          |

### API

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

**Bases:** `ValueError`

Base class for Guardrails Configuration validation errors.

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

**Bases:** `ValueError`

Raised when a check's arguments contradict each other, such as `tools` without a `tool_call` check.

```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,
    status: typing.Optional[int] = 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.
When the inner exception carries an HTTP status code (e.g. a
`LLMClientError`), callers can inspect `status` to decide
which HTTP response code to return to the upstream client.

```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.NonStreamingWorkQueueFullError()
```

**Bases:** `QueueFull`

Raised when the IORails non-streaming admission queue cannot accept more work.

Subclasses `asyncio.QueueFull` because that is what the underlying
work queue raises, so callers already catching it keep working.

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

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

Raised when an explicitly requested rail type has no configured flows.

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

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

Raised when an explicitly requested rail type cannot run on the serving engine.

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

Exception

**Bases:** `Exception`

Raised when IORails has no free streaming slot for a new request.

The streaming path is bounded by an `asyncio.Semaphore` rather than
a queue, so this deliberately does not subclass `asyncio.QueueFull`:
nothing is queued and nothing is full. It is a distinct overload condition
from `NonStreamingWorkQueueFullError` and carries its own client-facing
message.

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

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

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

```python
class nemoguardrails.exceptions.ToolConversationTooLongError(
    actual_length: int,
    max_length: int
)
```

**Bases:** `ValueError`

Raised when a rendered tool conversation exceeds the general prompt limit.

Tool exchanges are rejected intact rather than truncated, which could orphan
calls or discard the results needed to answer the user. Lengths are measured
in serialized characters, with structured inline image payloads discounted.