mlx-bun library API
    Preparing search index...
    Index
    defaultOutputLength: number
    embedEps: number
    embedProj: VisionLinear
    inputProj: VisionLinear
    layers: DiffVisionBlock[]
    maxPatches: number
    patchSize: number
    posTable: MlxArray
    rootHidden: number
    stdBias: MlxArray | null
    stdScale: MlxArray | null
    • Decode + aspect-preserving resize (multiples of pooling·patch=48, within the max_patches budget) + rescale 1/255 + channel-first. Mirrors optiq's gemma4 preprocess_images (BICUBIC, do_rescale, do_normalize=False). Returns pixel_values [1,3,H,W] f32 and the per-image soft-token count.

      Parameters

      • bytes: Uint8Array

      Returns Promise<{ pixels: MlxArray; softTokens: number }>