mlx-bun library API
    Preparing search index...
    Index
    weightsBytes: number
    • Materialize the logical [output,input] tensor as f32.

      This is intentionally the slow correctness path. Colibri int4 is offset-binary (nibble - 8); int8 is signed two's-complement. Neither is inferred from config.quantization_config, which still describes the pre-conversion FP8 checkpoint.

      Parameters

      • name: string
      • outputRows: number
      • inputColumns: number

      Returns MlxArray

    • G2 reference embedding lookup. This intentionally materializes the checkpoint-native quantized table through the same exact dequantizer as linear weights; G3 replaces the full-table materialization with a row-gather path.

      Parameters

      • ids: MlxArray
      • name: string
      • vocabSize: number
      • hiddenSize: number

      Returns MlxArray

    • Gather only the requested embedding rows before dequantization.

      The production GLM table is signed int8 and expands to ~3.8 GiB as f32. The streamed path must never create that full-table transient merely to read a handful of token rows.

      Parameters

      • ids: MlxArray
      • name: string
      • vocabSize: number
      • hiddenSize: number

      Returns MlxArray

    • Bounded signed-int8 linear used by the streamed production lm_head.

      Each output-row tile is fully evaluated before the next tile is built, so MLX cannot retain a lazy graph containing the complete f32-expanded head. Concatenation retains only the small materialized logits tiles.

      Parameters

      • x: MlxArray
      • name: string
      • outputRows: number
      • inputColumns: number
      • tileRows: number = 2048

      Returns MlxArray

    • MLX affine-Q4 linear for the streamed resident spine.

      Colibri stores already-packed nibbles but exposes them as uint8. Packing those bytes into MLX's uint32 view is still far smaller than expanding the complete matrix to f32, and preserves the exact (nibble - 8) * scale affine values.

      Parameters

      • x: MlxArray
      • name: string
      • outputRows: number
      • inputColumns: number

      Returns MlxArray

    • Open only the shards that own tensorNames.

      This is an explicit probe/tooling seam, not a partial-model constructor. Quantized callers must include both the packed tensor and its .qs companion. Accessing any catalogued tensor in an unopened shard fails.

      Parameters

      • modelDir: string
      • tensorNames: readonly string[]

      Returns ColibriGlm52Weights