> For the complete documentation index, see [llms.txt](https://docs.mozilla.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mozilla.ai/any-guardrail/api-reference/index/glider.md).

# Glider

A prompt based guardrail from Patronus AI that utilizes pass criteria and a rubric to judge text.

For more information, see the model card:[GLIDER](https://huggingface.co/PatronusAI/glider). It outputs its reasoning, highlights for what determined the score, and an integer score.

Args: pass\_criteria: A question or description of what you are validating. rubric: A scoring rubric, describing to the model how to score the provided data. pass\_threshold: The rubric score at which the text counts as passing. `valid` is `rubric_score >= pass_threshold` (or `<=` when `higher_is_better` is False). model\_id: HuggingFace path to model. provider: Reserved for future extensibility. Currently unused. higher\_is\_better: Whether higher rubric scores mean better/passing text. Set to False for rubrics where higher scores mean worse text. score\_range: Optional `(min, max)` bounds of the rubric scale. GLIDER's rubric is free text, so the bounds can't be inferred; supply them to get a normalized canonical risk in `score`. When omitted, `score` is None and the raw rubric value is still available in `extra["rubric_score"]`.

Raise: ValueError: Can only use model path to GLIDER from HuggingFace.

## Supported Models

* `PatronusAI/glider`

## Constructor

| Parameter          | Type                                                 | Required | Default |
| ------------------ | ---------------------------------------------------- | -------- | ------- |
| `pass_criteria`    | `str`                                                | Yes      | —       |
| `rubric`           | `str`                                                | Yes      | —       |
| `pass_threshold`   | `int`                                                | Yes      | —       |
| `model_id`         | \`str                                                | None\`   | No      |
| `provider`         | `Optional[Provider[dict[str, Any], dict[str, Any]]]` | No       | `None`  |
| `higher_is_better` | `bool`                                               | No       | `True`  |
| `score_range`      | \`tuple\[int, int]                                   | None\`   | No      |

Initialize the GLIDER guardrail.

## validate

Use the provided pass criteria and rubric to judge the input and output text provided.

**Parameters**

| Parameter     | Type  | Required | Default |
| ------------- | ----- | -------- | ------- |
| `input_text`  | `str` | Yes      | —       |
| `output_text` | \`str | None\`   | No      |

**Returns:** `GuardrailOutput`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mozilla.ai/any-guardrail/api-reference/index/glider.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
