> 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.server.experimental.providers.openai.dialects.litellm.chat_completions

Bind LiteLLM Chat extensions to the single-text OpenAI pipeline.

Reviewed finish metadata is opaque; extension containers remain closed to
unreviewed content. See README.md for source/version evidence and field policy.

The OpenAI request binding and stream lifecycle hooks are reused. Python declarations
are authoritative; the exported contract describes these effective bindings and
is never loaded to construct them. No LiteLLM dependency is needed at runtime.

## Module Contents

### Classes

| Name                                                                                                                                                            | Description                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [`LiteLLMAssistantMessageProjection`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMAssistantMessageProjection) | Add a closed message extension without changing the guarded text target.   |
| [`LiteLLMChoiceFields`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMChoiceFields)                             | Preserve LiteLLM's original finish reason without inspecting metadata.     |
| [`LiteLLMChoiceProjection`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMChoiceProjection)                     | Rebind the message type and constrain the provider-specific choice object. |
| [`LiteLLMGuardedResponse`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMGuardedResponse)                       | Derive coverage and text extraction from the complete dialect model graph. |
| [`LiteLLMMessageFields`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMMessageFields)                           | Allow the recorded null refusal without accepting uninspected content.     |
| [`LiteLLMResponseProjection`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMResponseProjection)                 | Retain the single-text response boundary with the reviewed nested types.   |

### Data

[`LITELLM_CHAT_COMPLETIONS_ENDPOINT`](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LITELLM_CHAT_COMPLETIONS_ENDPOINT)

### API

```python
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LiteLLMAssistantMessageProjection()
```

**Bases:** [ChatCompletionsAssistantMessageProjection](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/server/experimental/providers/openai/chat_completions/response_projection#nemoguardrails-server-experimental-providers-openai-chat_completions-response_projection-ChatCompletionsAssistantMessageProjection)

Add a closed message extension without changing the guarded text target.

**`images`** `Annotated[list[Any] | None, constrained(reason=(core_capability.multimodal_content), max_length=0)] = None`

---

**`policy`** `ObjectPolicy`

---

**`provider_specific_fields`** `Annotated[LiteLLMMessageFields | None, constrained()] = None`

---

**`reasoning_items`** `Annotated[list[LiteLLMReasoningItemProjection] | None, constrained()] = None`

---

**`thinking_blocks`** `Annotated[list[Any] | None, constrained(reason=(core_capability.reasoning_content), max_length=0)] = None`

---

```python
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LiteLLMChoiceFields()
```

**Bases:** [PolicyModel](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/server/experimental/provider/projection_policy#nemoguardrails-server-experimental-provider-projection_policy-PolicyModel)

Preserve LiteLLM's original finish reason without inspecting metadata.

**`policy`** `ObjectPolicy = ObjectPolicy(opaque=('native_finish_reason',))`

---

```python
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LiteLLMChoiceProjection()
```

**Bases:** [ChatCompletionsChoiceProjection](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/server/experimental/providers/openai/chat_completions/response_projection#nemoguardrails-server-experimental-providers-openai-chat_completions-response_projection-ChatCompletionsChoiceProjection)

Rebind the message type and constrain the provider-specific choice object.

**`message`** `Annotated[LiteLLMAssistantMessageProjection, guarded()]`

---

**`policy`** `ObjectPolicy`

---

**`provider_specific_fields`** `Annotated[LiteLLMChoiceFields | None, constrained()] = None`

---

```python
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LiteLLMGuardedResponse()
```

**Bases:** [LiteLLMResponseProjection](#nemoguardrails-server-experimental-providers-openai-dialects-litellm-chat_completions-LiteLLMResponseProjection)

Derive coverage and text extraction from the complete dialect model graph.

**`guarded_text_location`** `= text_location(LiteLLMResponseProjection)`

---

**`projection_contract`**

---

```python
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LiteLLMMessageFields()
```

**Bases:** [PolicyModel](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/server/experimental/provider/projection_policy#nemoguardrails-server-experimental-provider-projection_policy-PolicyModel)

Allow the recorded null refusal without accepting uninspected content.

**`refusal`** `Annotated[None, disabled(core_capability.refusal_content)] = None`

---

**`thinking_blocks`** `Annotated[list[Any] | None, constrained(reason=(core_capability.reasoning_content), max_length=0)] = None`

---

```python
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LiteLLMResponseProjection()
```

**Bases:** [ChatCompletionsGuardedResponseProjection](/nemo/guardrails/guardrails-python-sdk/nemoguardrails/server/experimental/providers/openai/chat_completions/response_projection#nemoguardrails-server-experimental-providers-openai-chat_completions-response_projection-ChatCompletionsGuardedResponseProjection)

Retain the single-text response boundary with the reviewed nested types.

**`access_programs`** `Annotated[Any, opaque()] = None`

---

**`billing`** `Annotated[Any, opaque()] = None`

---

**`choices`** `Annotated[list[LiteLLMChoiceProjection], guarded(min_length=1, max_length=1)]`

---

**`frequency_penalty`** `Annotated[Any, opaque()] = None`

---

**`image`** `Annotated[ResponseImageProjection | None, constrained()] = None`

---

**`input_transformations`** `InputTransformations = None`

---

**`presence_penalty`** `Annotated[Any, opaque()] = None`

---

**`tool_usage`** `Annotated[Any, opaque()] = None`

---

```python
nemoguardrails.server.experimental.providers.openai.dialects.litellm.chat_completions.LITELLM_CHAT_COMPLETIONS_ENDPOINT = replace(CHAT_COMPLETIONS_ENDPOINT, contract_name='litellm_chat_completions', ope...
```