> This page is for version Latest (default).
> 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.actions.llm_judge

Shared helpers for library rail actions that use an LLM as a judge.

Not Colang-specific, unlike `nemoguardrails.actions.llm`.

## Module Contents

### Functions

| Name                                                                             | Description                                                                       |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [`require_llm`](#nemoguardrails-actions-llm_judge-require_llm)                   | Resolve `model_name` in `llms`, raising a clear error if it's missing or unknown. |
| [`run_llm_judged_check`](#nemoguardrails-actions-llm_judge-run_llm_judged_check) | Call the judge `llm` with the already-rendered `prompt` and parse the response.   |

### Data

[`DEFAULT_MAX_TOKENS`](#nemoguardrails-actions-llm_judge-DEFAULT_MAX_TOKENS)

### API

```python
nemoguardrails.actions.llm_judge.require_llm(
    llms: typing.Dict[str, nemoguardrails.types.LLMModel],
    model_name: typing.Optional[str],
    rail_name: str
) -> nemoguardrails.types.LLMModel
```

Resolve `model_name` in `llms`, raising a clear error if it's missing or unknown.

```python
nemoguardrails.actions.llm_judge.run_llm_judged_check(
    llm: nemoguardrails.types.LLMModel,
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    task: str,
    prompt: str,
    temperature: float
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Call the judge `llm` with the already-rendered `prompt` and parse the response.

Uses the prompt's own `output_parser`, which compile-time validation guarantees is
declared and registered (see compiled_rail.py's \_reject_invalid_tool_safety_check_prompt).

```python
nemoguardrails.actions.llm_judge.DEFAULT_MAX_TOKENS = 1024
```