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

## Submodules

* **[`nemoguardrails.llm.frameworks.default`](/nemo/guardrails/v0.25.0/guardrails-python-sdk/nemoguardrails/llm/frameworks/default)**
* **[`nemoguardrails.llm.frameworks.registry`](/nemo/guardrails/v0.25.0/guardrails-python-sdk/nemoguardrails/llm/frameworks/registry)**

## Package Contents

### Functions

| Name                                                                                     | Description                                       |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------- |
| [`_areset_frameworks`](#nemoguardrails-llm-frameworks-registry-_areset_frameworks)       | -                                                 |
| [`_reset_frameworks`](#nemoguardrails-llm-frameworks-registry-_reset_frameworks)         | -                                                 |
| [`get_default_framework`](#nemoguardrails-llm-frameworks-registry-get_default_framework) | -                                                 |
| [`get_framework`](#nemoguardrails-llm-frameworks-registry-get_framework)                 | -                                                 |
| [`register_framework`](#nemoguardrails-llm-frameworks-registry-register_framework)       | Register an `LLMFramework` instance under `name`. |
| [`set_default_framework`](#nemoguardrails-llm-frameworks-registry-set_default_framework) | -                                                 |

### API

```python
nemoguardrails.llm.frameworks._areset_frameworks() -> None
```

async

```python
nemoguardrails.llm.frameworks._reset_frameworks() -> None
```

```python
nemoguardrails.get_default_framework() -> str
```

```python
nemoguardrails.llm.frameworks.get_framework(
    name: str
) -> nemoguardrails.types.LLMFramework
```

```python
nemoguardrails.register_framework(
    name: str,
    framework: nemoguardrails.types.LLMFramework
) -> None
```

Register an `LLMFramework` instance under `name`.

Validates two invariants before storing the instance:

1. The object structurally matches the `LLMFramework` Protocol
   (`create_model`, `register_provider`, `get_provider_names`, `reset`).
2. Its `reset` attribute is an `async` coroutine function. The registry
   awaits it directly during shutdown / test teardown.

**Raises:**

* `ValueError`: a framework is already registered under `name`.
* `TypeError`: `framework` does not implement the `LLMFramework`
  Protocol, or its `reset` is not an async coroutine function.

```python
nemoguardrails.set_default_framework(
    name: str
) -> None
```