mlx-bun library API
    Preparing search index...

    Resolved HLG sampling config (the user-facing knobs). The mid gain is NOT here — it folds from temperature (m = 1/T) when the sampler is built.

    interface HlgConfig {
        enabled: boolean;
        eotf?: boolean;
        gain?: number;
        lw?: number;
        maxBrightness?: number;
        oetf?: boolean;
        p?: number;
        pipeline?: boolean;
        pivot?: "top" | "entropy" | "median";
        pivotOffset: number;
        refGap?: number;
        shaper?: boolean;
        shoulder: number;
        shoulderA?: number;
        sM?: number;
        targetGap?: number;
        toe: number;
        width: number;
        window?: number;
        xFloor?: number;
        xM?: number;
        yFloor?: number;
        yM?: number;
    }
    Index
    enabled: boolean
    eotf?: boolean

    Use the LITERAL HLG EOTF (inverse OETF → OOTF gamma) — the decode/display direction (suppresses the tail). Ignores the parametric knobs.

    gain?: number

    Optional explicit mid gain m. Default: folds from temperature (m = 1/T), so temperature stays the contrast knob. An explicit value decouples mid contrast from temperature — needed to probe mid-boost while holding the model's recommended temperature fixed.

    lw?: number

    EOTF only: nominal peak display luminance L_W (cd/m²) → OOTF gamma. Default 1000 (γ = 1.2). Lower = flatter (more diverse), higher = sharper.

    maxBrightness?: number

    Pipeline only: α = max brightness — the top logit the OOTF scales everything under ("the most confidence we want"). Default 5. For the shaper, reused as out_scale (default 12).

    oetf?: boolean

    Use the LITERAL HLG OETF (gamma below 1/12, log above) instead of the parametric toe/mid/shoulder curve. Ignores gain/width/shoulder/toe/pivot.

    p?: number
    pipeline?: boolean

    Use the FULL HLG chain: OETF signal shape → OOTF scaling (applyHlgPipeline). γ from lw. Ignores the parametric knobs.

    pivot?: "top" | "entropy" | "median"
    pivotOffset: number
    refGap?: number

    Shaper only: reference token nats below the top for the auto out_scale. Default 4.

    shaper?: boolean

    Use the user-specified HLGShaper (windowed anchor → piecewise OETF with a cubic suppress-toe → OOTF → ×out_scale). lw→L_W, maxBrightness→out_scale.

    shoulder: number
    shoulderA?: number

    Shaper only: A — shoulder compression (how hard top-end confidence is tamed).

    sM?: number

    Shaper only: s_m — mid sharpness (how hard above-median tokens are elevated).

    targetGap?: number

    Shaper only: target top-to-reference logit gap (out_scale auto-derives from this so it's decoupled from W). Default 15.

    toe: number
    width: number
    window?: number

    Shaper only: W = nats of headroom below the top logit that span the curve (x = clamp((ℓ−ℓmax)/W + 1, 0, 1)). Default 10.

    xFloor?: number
    xM?: number

    Shaper only: curve geometry (the pivots / toe / mid power). Default to the HLGShaper constants (xM 0.55, yM 0.5, xFloor 0.2, yFloor 0.18, p 2.0) when unset.

    yFloor?: number
    yM?: number