Skip to contents

Save a module's configuration and signature to a pins board for later retrieval. This enables sharing optimized modules across projects and team members.

Usage

pin_module_config(
  board,
  name,
  module,
  description = NULL,
  versioned = TRUE,
  ...
)

Arguments

board

A pins board object (e.g., from pins::board_folder())

name

Character name for the pin

module

A DSPrrr module whose configuration should be saved

description

Optional description for the pin

versioned

Logical; whether to version the pin (default TRUE)

...

Additional arguments passed to pins::pin_write()

Value

The pin name (invisibly)

Details

The pinned configuration includes:

  • Signature specification (inputs, output type, instructions)

  • Module configuration (temperature, prompt_style, etc.)

  • Optimization state (best parameters, trials summary)

  • Metadata (module type, creation timestamp, package version)

Examples

if (FALSE) { # \dontrun{
# Create a board and pin a module configuration
board <- pins::board_folder("pins")

mod <- signature("text -> sentiment") |>
  module(type = "predict") |>
  optimize_grid(devset, metric = exact_match)

pin_module_config(board, "sentiment-classifier-v1", mod,
                  description = "Optimized sentiment classifier")

# Later, retrieve and reconstruct the module
config <- pins::pin_read(board, "sentiment-classifier-v1")
restored_mod <- restore_module_config(config)
} # }