> 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 AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.guardrails.base_engine

Base class for IORails HTTP engines with aiohttp retry client lifecycle.

## Module Contents

### Classes

| Name                                                              | Description                                          |
| ----------------------------------------------------------------- | ---------------------------------------------------- |
| [`BaseEngine`](#nemoguardrails-guardrails-base_engine-BaseEngine) | HTTP engine base with aiohttp RetryClient lifecycle. |

### API

```python
class nemoguardrails.guardrails.base_engine.BaseEngine(
    timeout_total: float = DEFAULT_TIMEOUT_TOTAL,
    timeout_connect: float = DEFAULT_TIMEOUT_CONNECT,
    max_attempts: int = DEFAULT_MAX_ATTEMPTS
)
```

HTTP engine base with aiohttp RetryClient lifecycle.

Manages a single RetryClient with configurable timeout and retry settings.
Subclasses add endpoint-specific call logic.

```python
nemoguardrails.guardrails.base_engine.BaseEngine.__aenter__()
```

async

```python
nemoguardrails.guardrails.base_engine.BaseEngine.__aexit__(
    exc_type,
    exc_val,
    exc_tb
)
```

async

```python
nemoguardrails.guardrails.base_engine.BaseEngine.start() -> None
```

async

Create this engine's RetryClient. Call during service startup.

```python
nemoguardrails.guardrails.base_engine.BaseEngine.stop() -> None
```

async

Close this engine's RetryClient. Call during service shutdown.