> 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.library.gliner.models

Pydantic models for GLiNER requests and responses.

## Module Contents

### Classes

| Name                                                                     | Description                                                  |
| ------------------------------------------------------------------------ | ------------------------------------------------------------ |
| [`EntitySpan`](#nemoguardrails-library-gliner-models-EntitySpan)         | Represents a detected entity with its position and metadata. |
| [`GLiNERRequest`](#nemoguardrails-library-gliner-models-GLiNERRequest)   | Request model for GLiNER entity extraction.                  |
| [`GLiNERResponse`](#nemoguardrails-library-gliner-models-GLiNERResponse) | Response model for GLiNER entity extraction.                 |

### API

```python
class nemoguardrails.library.gliner.models.EntitySpan()
```

**Bases:** `BaseModel`

Represents a detected entity with its position and metadata.

**`end_position`** `int`

---

**`score`** `float = Field(description='Confidence score.')`

---

**`start_position`** `int`

---

**`suggested_label`** `str = Field(description='The entity label/type.')`

---

**`value`** `str = Field(description='The detected entity text.')`

---

```python
class nemoguardrails.library.gliner.models.GLiNERRequest()
```

**Bases:** `BaseModel`

Request model for GLiNER entity extraction.

This model defines the parameters for making requests to a GLiNER server.
Default values are centralized here to avoid duplication.

**`chunk_length`** `int`

---

**`flat_ner`** `bool`

---

**`labels`** `Optional[List[str]]`

---

**`overlap`** `int`

---

**`text`** `str`

---

**`threshold`** `float`

---

```python
class nemoguardrails.library.gliner.models.GLiNERResponse()
```

**Bases:** `BaseModel`

Response model for GLiNER entity extraction.

**`entities`** `List[EntitySpan] = Field(description='List of detected entities.')`

---

**`tagged_text`** `str`

---

**`total_entities`** `int`

---