kempnerforge.config.adapter

Adapter configuration.

AdapterConfig selects which adapter the VLM wrapper instantiates and parameterizes the chosen adapter. Dispatched via the adapter registry at build time (see kempnerforge/model/adapter.py).

This module is registered-component-shaped (parallel to VisionEncoderConfig, VLMConfig). A follow-up PR will flatten the VLM TOML schema to expose [adapter] as a top-level section; until then build_vlm_wrapper constructs an AdapterConfig internally from the existing VLMConfig fields (adapter_hidden_dim, adapter_activation).

Classes

AdapterConfig

Selects the adapter type and parameterizes it.

class kempnerforge.config.adapter.AdapterConfig[source]

Bases: object

Selects the adapter type and parameterizes it.

Fields:
type: Registry key for the adapter builder. "mlp_2layer" (default)

or "linear". Custom adapters register additional names.

hidden_dim: Hidden width for mlp_2layer. 0 means “match

out_dim”; ignored by linear.

activation: Activation between the two MLP projections. One of

"gelu" (default), "silu", "relu". Ignored by linear.

type: str = 'mlp_2layer'
hidden_dim: int = 0
activation: str = 'gelu'
extra_kwargs()[source]

Builder kwargs beyond in_dim / out_dim.

hidden_dim=0 is mapped to None so the adapter falls back to its own default (e.g., out_dim for MLP2LayerAdapter).

Return type:

dict[str, Any]

__init__(type='mlp_2layer', hidden_dim=0, activation='gelu')
Parameters:
  • type (str)

  • hidden_dim (int)

  • activation (str)

Return type:

None