Tinkex.Types.WeightsInfoResponse (Tinkex v0.3.4)

View Source

Minimal information for loading public checkpoints.

Mirrors Python tinker.types.WeightsInfoResponse.

Fields

  • base_model - The base model name (e.g., "Qwen/Qwen2.5-7B")
  • is_lora - Whether this checkpoint uses LoRA
  • lora_rank - The LoRA rank, if applicable (nil for non-LoRA checkpoints)

Wire Format

{
  "base_model": "Qwen/Qwen2.5-7B",
  "is_lora": true,
  "lora_rank": 32
}

Examples

iex> json = %{"base_model" => "Qwen/Qwen2.5-7B", "is_lora" => true, "lora_rank" => 32}
iex> Tinkex.Types.WeightsInfoResponse.from_json(json)
%Tinkex.Types.WeightsInfoResponse{base_model: "Qwen/Qwen2.5-7B", is_lora: true, lora_rank: 32}

See Also

Summary

Functions

Create a WeightsInfoResponse from a JSON map.

Types

t()

@type t() :: %Tinkex.Types.WeightsInfoResponse{
  base_model: String.t(),
  is_lora: boolean(),
  lora_rank: non_neg_integer() | nil
}

Functions

from_json(json)

@spec from_json(map()) :: t()

Create a WeightsInfoResponse from a JSON map.

Handles both string and atom keys.

Parameters

  • json - Map with keys "base_model"/:base_model, "is_lora"/:is_lora, and optionally "lora_rank"/:lora_rank

Examples

iex> WeightsInfoResponse.from_json(%{"base_model" => "Qwen", "is_lora" => true, "lora_rank" => 32})
%WeightsInfoResponse{base_model: "Qwen", is_lora: true, lora_rank: 32}

iex> WeightsInfoResponse.from_json(%{base_model: "Qwen", is_lora: false})
%WeightsInfoResponse{base_model: "Qwen", is_lora: false, lora_rank: nil}