# `Tinkex.Types.LoadWeightsRequest`
[🔗](https://github.com/North-Shore-AI/tinkex/blob/v0.4.0/lib/tinkex/types/load_weights_request.ex#L1)

Request to load model weights from a checkpoint.

Mirrors Python `tinker.types.LoadWeightsRequest`.

## Fields

- `model_id` - The model/training run ID
- `path` - Tinker URI for model weights (e.g., "tinker://run-id/weights/checkpoint-001")
- `seq_id` - Sequence ID for request ordering (optional)
- `optimizer` - Whether to also load optimizer state (default: false)
- `type` - Request type, always "load_weights"

## Load Optimizer State

When `optimizer` is true, the optimizer state (Adam moments, etc.) will be
restored along with the model weights. This is useful when resuming training from a
checkpoint to maintain training continuity.

## Wire Format

```json
{
  "model_id": "run-123",
  "path": "tinker://run-123/weights/checkpoint-001",
  "seq_id": 1,
  "optimizer": true,
  "type": "load_weights"
}
```

# `t`

```elixir
@type t() :: %Tinkex.Types.LoadWeightsRequest{
  model_id: String.t(),
  optimizer: boolean(),
  path: String.t(),
  seq_id: integer() | nil,
  type: String.t()
}
```

# `new`

```elixir
@spec new(String.t(), String.t(), keyword()) :: t()
```

Create a new LoadWeightsRequest.

## Parameters

- `model_id` - The model/training run ID
- `path` - Tinker URI for model weights
- `opts` - Optional keyword list:
  - `:seq_id` - Sequence ID for request ordering
  - `:optimizer` - Whether to load optimizer state (default: false)

## Examples

    iex> LoadWeightsRequest.new("run-123", "tinker://run-123/weights/001")
    %LoadWeightsRequest{model_id: "run-123", path: "tinker://run-123/weights/001", optimizer: false}

    iex> LoadWeightsRequest.new("run-123", "tinker://run-123/weights/001", optimizer: true)
    %LoadWeightsRequest{model_id: "run-123", path: "tinker://run-123/weights/001", optimizer: true}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
