mlex 0.1.3

Safe, idiomatic Rust runtime for Apple MLX: quantized LLM inference (Qwen, Gemma4, NemotronH, DharaAR, ...) with multi-modal support
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Raw FFI bindings to Apple MLX via the official `mlx-c` C API.
//!
//! Everything in this module is `unsafe` and mirrors the C API exactly.
//! It is private to this crate; the rest of `mlex` builds a safe, idiomatic
//! interface on top of it (see [`crate::array`], [`crate::ops`], ...).

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(improper_ctypes)]
#![allow(dead_code)]
#![allow(clippy::all)]

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

/// Absolute path of the `mlx.metallib` produced by the CMake build, if any.
/// Useful for colocating the metallib next to a distributed binary.
pub const BUILD_METALLIB_PATH: Option<&str> = option_env!("MLEX_METALLIB_PATH");