> 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/general-judge/selene.md).

# Selene 1 Mini

General-purpose LLM judge grading a response against a user-defined 1-5 rubric.

Selene 1 Mini is an 8B evaluator LLM (fine-tuned from Llama 3.1 8B) specialized in scoring model outputs. This guardrail drives it in single-rubric absolute-grading mode: each call wraps the instruction and response in Selene's evaluation prompt together with the caller's `rubric`, and the model replies with a `**Reasoning:**` block followed by `**Result:** <n>` where `n` is an integer 1-5. It runs through `provider.generate_chat`, so it can be served from either a `HuggingFaceProvider` or a `LlamafileProvider`.

Verdict mapping onto `GuardrailOutput`:

* `valid` is `rubric_score >= pass_threshold` (or `<=` when `higher_is_better=False`).
* `score` (canonical risk: higher = riskier) is the 1-5 rubric score normalized onto \[0, 1] via `normalize_rubric_to_risk` — inverted when higher rubric values mean better, so a high-quality response yields a low risk.
* `explanation` is the model's full generation (reasoning plus the result line).
* `extra["rubric_score"]` is the raw integer 1-5.
* When no `**Result:**` score can be parsed, the output fails closed: `valid=False` with `extra={"parse_failure": True}`.

Inputs are single strings: `input_text` is the instruction and `output_text` is the response being graded (when `output_text` is omitted, `input_text` is graded as the response). List/batch input is not supported.

For more information, see:

* [Selene-1-Mini-Llama-3.1-8B model card](https://huggingface.co/AtlaAI/Selene-1-Mini-Llama-3.1-8B)
* [Atla Selene Mini: A General Purpose Evaluation Model (arXiv:2501.17195)](https://arxiv.org/abs/2501.17195)
* [Selene 1 Mini announcement (Atla)](https://www.atla-ai.com/post/selene-1-mini)

## Supported Models

* `AtlaAI/Selene-1-Mini-Llama-3.1-8B`

## Constructor

| Parameter          | Type                                                 | Required | Default | Description                                                                                                                                                                                                                                              |
| ------------------ | ---------------------------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rubric`           | `str`                                                | Yes      | —       | The score rubric applied to every `validate` call — the evaluation objective plus `Score 1:` … `Score 5:` descriptions, e.g. `"How helpful is the answer? Score 1: not helpful. ... Score 5: fully helpful."`.                                           |
| `pass_threshold`   | `int`                                                | Yes      | —       | The score (1-5) at or above which the response passes (or at or below when `higher_is_better=False`), e.g. `4`.                                                                                                                                          |
| `higher_is_better` | `bool`                                               | No       | `True`  | Whether higher rubric scores mean better responses. Set `False` for rubrics where a higher number is worse. Defaults to `True`.                                                                                                                          |
| `model_id`         | \`str                                                | None\`   | No      | `None`                                                                                                                                                                                                                                                   |
| `provider`         | `Optional[Provider[dict[str, Any], dict[str, Any]]]` | No       | `None`  | Optional pre-configured provider. When `None`, a `HuggingFaceProvider` is built targeting `AutoModelForCausalLM` / `AutoTokenizer` (transformers is imported lazily here). Pass a `LlamafileProvider` to run a GGUF build without the huggingface extra. |
| `prompt`           | \`PromptTemplate                                     | None\`   | No      | `None`                                                                                                                                                                                                                                                   |
| `prompt_version`   | \`str                                                | None\`   | No      | `None`                                                                                                                                                                                                                                                   |

Initialize the Selene guardrail.

## validate

Judge `output_text` (the response) given `input_text` (the instruction).

**Parameters**

| Parameter     | Type  | Required | Default | Description                                                                                                                                                                   |
| ------------- | ----- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input_text`  | `str` | Yes      | —       | The instruction the response was produced for, e.g. `"Summarize the article in one sentence."`. Single string only; list/batch input is not supported and raises `TypeError`. |
| `output_text` | \`str | None\`   | No      | `None`                                                                                                                                                                        |

**Returns:** `GuardrailOutput`

## Benchmarks

### General Judge

| Dataset (rev)              | Metric           | Threshold    | Value    | Harness                 | Source                           | Contam. |
| -------------------------- | ---------------- | ------------ | -------- | ----------------------- | -------------------------------- | ------- |
| judgebench (unspecified)   | choice\_accuracy | native-valid | 0.564912 | guardrail-bench+ag0.7.4 | measured:guardrail-bench+ag0.7.4 |         |
| llmbar (unspecified)       | choice\_accuracy | native-valid | 0.635088 | guardrail-bench+ag0.7.4 | measured:guardrail-bench+ag0.7.4 |         |
| rewardbench2 (unspecified) | choice\_accuracy | native-valid | 0.361404 | guardrail-bench+ag0.7.4 | measured:guardrail-bench+ag0.7.4 |         |

## License

* **Vendor:** Atla
* **Default license:** `llama-3.1` (of the default model/service)


---

# 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/general-judge/selene.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.
