Tinkex.Types.LoadWeightsRequest (Tinkex v0.3.4)

View Source

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

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

Summary

Functions

Create a new LoadWeightsRequest.

Types

t()

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

Functions

new(model_id, path, opts \\ [])

@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}