> This page is for version Dev.
> For other versions, use one of these documentation indexes:
> - Latest (v0.4.0) (default): https://docs.nvidia.com/nemo/switchyard/latest/llms.txt
> - Dev: https://docs.nvidia.com/nemo/switchyard/dev/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/switchyard/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/switchyard/_mcp/server.

# LLM Requests

This reference covers request fields and the built-in provider mappings. For the
integration flow and a construction example, read **[LLM-Related Protocols](/nemo/switchyard/dev/integrate-switchyard/switchyard-protocols/llm-related-protocols)**.
For the reply, continue to **[Responses and Streams](/nemo/switchyard/dev/reference/protocols/llm/responses-and-streams)**.

## Request envelope \[#request-envelope]

An algorithm receives [`Request`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/envelope/struct.Request.html). Its `llm_request` contains the conversation;
the remaining envelope data belongs to the application.

| Field and type                                                                                                                                                 | Meaning                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [`Request.llm_request: LlmRequest`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/envelope/struct.Request.html#structfield.llm_request)    | The conversation and settings used by the algorithm and model client.                      |
| [`Request.metadata: Option<Metadata>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/envelope/struct.Request.html#structfield.metadata)    | Optional session, correlation, and routing metadata.                                       |
| [`Request.raw_request: Option<Value>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/envelope/struct.Request.html#structfield.raw_request) | An optional original body retained by the host. Translation codecs do not read this field. |

Codec replay uses [`LlmRequest.preservation`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.preservation), separately from the envelope's raw
body. See **[preservation and edits](/nemo/switchyard/dev/reference/protocols/llm/translation#preservation-and-edits)**
before changing a decoded request.

## Conversation fields \[#conversation-fields]

These mappings describe the built-in codecs. Supported features also depend on
the destination model. Select a Rust field or type for its full crate definition.

| Protocol field and type                                                                                                                                                   | Meaning                                                                     | Anthropic Messages                                                                       | OpenAI Responses                                                         | Chat Completions                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------- |
| [`LlmRequest.model: Option<String>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.model)                      | Addressed model; the host can replace it with the selected target.          | `model`                                                                                  | `model`                                                                  | `model`                                                  |
| [`LlmRequest.instructions: Vec<InstructionBlock>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.instructions) | Top-level system and developer instructions.                                | Top-level `system`; no distinct developer authority                                      | `instructions`                                                           | Leading system/developer messages in `messages`          |
| [`LlmRequest.messages: Vec<Message>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.messages)                  | Ordered turns, each with a role and content blocks.                         | `messages[]`; inline system/developer messages are added to top-level `system` on encode | Messages, including system/developer messages, and tool items in `input` | `messages[]`, including later system/developer messages  |
| [`LlmRequest.tools: Vec<Tool>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.tools)                           | Available functions, MCP toolsets, or retained provider definitions.        | `tools[]`                                                                                | `tools[]`                                                                | `tools[]`; function definitions are nested in `function` |
| [`LlmRequest.tool_choice: Option<ToolChoice>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.tool_choice)      | Let the model choose, require a call, forbid calls, or select a named tool. | `auto`, `any`, `none`, or `tool`                                                         | `auto`, `required`, `none`, or `function`                                | `auto`, `required`, `none`, or `function`                |
| [`LlmRequest.stream: bool`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.stream)                              | Request incremental output.                                                 | `stream`                                                                                 | `stream`                                                                 | `stream`                                                 |
| [`LlmRequest.extensions: ProviderExtensions`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.extensions)        | Provider fields without a first-class neutral field.                        | Source fields retained by the codec                                                      | Source fields retained by the codec                                      | Source fields retained by the codec                      |
| [`LlmRequest.preservation: PreservationMetadata`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.LlmRequest.html#structfield.preservation)  | Original JSON used for same-format replay.                                  | Original parsed body                                                                     | Original parsed body                                                     | Original parsed body                                     |

### Messages and tool content \[#messages-and-tool-content]

[`Message.role`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.Message.html#structfield.role) is a [`Role`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/enum.Role.html); [`Message.content`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.Message.html#structfield.content) is an ordered [`Vec<ContentBlock>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/enum.ContentBlock.html).
The content variants cover text, reasoning, media, tools, MCP activity, refusals,
and unknown provider blocks. An unknown block retains its source format and raw
JSON. Its retention does not make it usable in a different API.

| Protocol field and type                                                                                                                                       | Meaning                                       | Anthropic Messages        | OpenAI Responses                            | Chat Completions                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------------- | ------------------------------------------- | ---------------------------------------------------- |
| [`ToolDefinition.parameters: Value`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolDefinition.html#structfield.parameters) | JSON Schema for function arguments.           | `input_schema`            | Function `parameters`                       | `tools[].function.parameters`                        |
| [`ToolCall.id: String`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolCall.html#structfield.id)                            | Identifier that pairs a call with its result. | `tool_use.id`             | `function_call.call_id`                     | `tool_calls[].id`                                    |
| [`ToolCall.name: String`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolCall.html#structfield.name)                        | Function name.                                | `tool_use.name`           | `function_call.name`                        | `tool_calls[].function.name`                         |
| [`ToolCall.arguments: Value`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolCall.html#structfield.arguments)               | Parsed argument value.                        | JSON-valued `input`       | `arguments`, commonly a JSON-encoded string | `function.arguments`, commonly a JSON-encoded string |
| [`ToolResult.tool_call_id: String`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolResult.html#structfield.tool_call_id)    | Identifier of the call being answered.        | `tool_result.tool_use_id` | `function_call_output.call_id`              | Tool message `tool_call_id`                          |
| [`ToolResult.content: Vec<ContentBlock>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolResult.html#structfield.content)   | Ordered tool output.                          | `tool_result.content`     | `function_call_output.output`               | Tool message `content`                               |
| [`ToolResult.is_error: Option<bool>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolResult.html#structfield.is_error)      | Whether tool execution failed, if reported.   | `tool_result.is_error`    | No dedicated error flag                     | No standard error flag                               |

Tool definitions describe available work. A [`ToolCall`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ToolCall.html) records a model's request
to execute that work; it does not execute the tool. Keep call IDs and content
order intact when writing an adapter.

[`Tool::Provider`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/enum.Tool.html#variant.Provider) retains an unsupported tool definition for its source format.
Built-in provider tools and reasoning signatures may have no valid counterpart
in another API. Consult the [translation limits](/nemo/switchyard/dev/reference/protocols/llm/translation#conversion-limits)
instead of assuming a successful parse implies cross-provider support.

## Generation settings \[#generation-settings]

The request groups these fields in [`SamplingParams`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.SamplingParams.html), [`OutputParams`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.OutputParams.html), and
[`ReasoningParams`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ReasoningParams.html). Optional values remain unspecified when absent; individual
providers apply their own defaults and accepted ranges.

| Protocol field and type                                                                                                                                                          | Meaning                                                                                 | Anthropic Messages                 | OpenAI Responses                   | Chat Completions                                |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------- | ---------------------------------- | ----------------------------------------------- |
| [`SamplingParams.temperature: Option<f64>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.SamplingParams.html#structfield.temperature)            | Sampling temperature.                                                                   | (omitted; refer to the note below) | `temperature`                      | `temperature`                                   |
| [`SamplingParams.top_p: Option<f64>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.SamplingParams.html#structfield.top_p)                        | Nucleus-sampling probability mass.                                                      | `top_p`                            | `top_p`                            | `top_p`                                         |
| [`SamplingParams.top_k: Option<i64>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.SamplingParams.html#structfield.top_k)                        | Maximum candidate-token count.                                                          | `top_k`                            | No standard field                  | No standard field                               |
| [`OutputParams.max_output_tokens: Option<u64>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.OutputParams.html#structfield.max_output_tokens)    | Output token budget.                                                                    | `max_tokens`                       | `max_output_tokens`                | `max_completion_tokens`, or legacy `max_tokens` |
| [`OutputParams.response_format: Option<Value>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.OutputParams.html#structfield.response_format)      | Requested structured-output shape.                                                      | `output_config.format`             | `text.format`                      | `response_format`                               |
| [`OutputParams.is_schema_enforced: Option<bool>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.OutputParams.html#structfield.is_schema_enforced) | Override whether the provider must enforce the schema; absence retains native behavior. | Schema-backed output configuration | Schema strictness in `text.format` | Schema strictness in `response_format`          |
| [`ReasoningParams.effort: Option<String>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ReasoningParams.html#structfield.effort)                 | Requested reasoning effort.                                                             | `output_config.effort`             | `reasoning.effort`                 | `reasoning_effort`                              |
| [`ReasoningParams.raw: Option<Value>`](https://nvidia-nemo.github.io/Switchyard/rust/switchyard_protocol/llm/struct.ReasoningParams.html#structfield.raw)                        | Provider-specific reasoning configuration.                                              | `thinking` controls                | `reasoning` object                 | No standard equivalent for the whole object     |

**Anthropic temperature:** Switchyard omits `temperature` when rebuilding Anthropic
requests. Older models still support this parameter under API version `2023-06-01`,
but models released after Claude Opus 4.6 reject values other than the default
`1.0`. For model restrictions, refer to the [Anthropic parameter documentation](https://platform.claude.com/docs/en/api/messages/create?version=2023-06-01).
API version `2026-10-21` removes the parameter entirely and rejects it even at its
default value. For removal details, refer to [Anthropic's migration guide](https://platform.claude.com/docs/en/api/migration-2026-10-21#sampling-parameters-are-removed).
Switchyard scales OpenAI temperatures from the `0.0–2.0` range to Anthropic's
`0.0–1.0` range before comparing with the default. An OpenAI temperature of `2.0`
scales to Anthropic's default of `1.0` and is omitted without diagnostics or rejection.
Omitting a non-default value after scaling to Anthropic's range follows the
[lossy-conversion policy](/nemo/switchyard/dev/reference/protocols/llm/translation#policies). Exact preserved Anthropic
requests can still retain `temperature`.

For older Anthropic models that support non-default temperatures under API version
`2023-06-01`, add these settings to the target's TOML configuration:

```toml
omit_body_fields = ["temperature"]
extra_body = { temperature = 0.5 }
```

After translation, Switchyard removes any existing `temperature` and sets it to
`0.5` in Anthropic's units, without further scaling. This also overrides temperature
in preserved requests. Refer to the [target configuration reference](/nemo/switchyard/dev/reference/runner-configuration-toml#targetsname)
for these settings.

Preserved same-format bodies take precedence over edits to these settings,
including schema enforcement. See **[encoding an edited request](/nemo/switchyard/dev/reference/protocols/llm/translation#preservation-and-edits)**.

## Provider contracts \[#provider-contracts]

For complete provider schemas, see [Anthropic Messages](https://platform.claude.com/docs/en/api/messages/create),
[OpenAI Responses](https://developers.openai.com/api/reference/resources/responses/methods/create),
and [Chat Completions](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create).
For response fields and event ownership, continue to **[Responses and Streams](/nemo/switchyard/dev/reference/protocols/llm/responses-and-streams)**.