> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemoclaw/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemoclaw/_mcp/server.

# Configure Model Limits

> Context-window and output-token limits for a NemoClaw-managed sandbox.

## Set Pi Model Metadata

Pi accepts an explicit context window, maximum output-token count, and reasoning flag.

| Variable                  | Values                                  | Default                          |
| ------------------------- | --------------------------------------- | -------------------------------- |
| `NEMOCLAW_CONTEXT_WINDOW` | Positive integer up to `4194304` tokens | Unset; Pi uses the model default |
| `NEMOCLAW_MAX_TOKENS`     | Integer from `1` to `1000000000` tokens | Unset; Pi uses the model default |
| `NEMOCLAW_REASONING`      | `true` or `false`                       | Unset; Pi uses the model default |

Export the values before onboarding.

```bash
export NEMOCLAW_CONTEXT_WINDOW=65536
export NEMOCLAW_MAX_TOKENS=8192
export NEMOCLAW_REASONING=true
nemoclaw onboard --agent pi --name <sandbox-name>
```

NemoClaw validates each supplied value and writes it to `/sandbox/.pi/agent/models.json` through the managed startup profile.
An invalid value fails before Pi starts.
Pi does not support `NEMOCLAW_REASONING_EFFORT`.

## Recreate a Pi Sandbox

A normal Pi rebuild replays the recorded context window, maximum output-token count, and reasoning flag.
Changing those values requires a fresh replacement.
Create a snapshot first when declared user state must survive, then export the new values and recreate the sandbox.

```bash
nemoclaw <sandbox-name> snapshot create --name before-model-change
nemoclaw onboard --agent pi --name <sandbox-name> --fresh --recreate-sandbox
```

Pi has no runtime `inference set` configuration path.
Use the same fresh replacement flow to change its provider or model.

## Related Topics

* [Run and Manage Pi](../manage-sandboxes/run-pi) for rebuild and snapshot behaviour.
* [Pi Support and Security](../reference/pi-support) for supported inference and credential boundaries.