Overview
h3.c (the repository calls the program h3-metal) is a native inference engine for the MiniMax H3 multimodal model on Apple Silicon, written in C with Metal compute kernels. You point it at a local Hugging Face snapshot of the model weights and it generates video and audio from a text prompt on your own machine — no Python stack, no server, one `./h3` binary plus FFmpeg and FFprobe on your PATH.
The project is built as a sequence of working vertical slices: host and model metadata first, then portable Metal block parity, prompt encoding, prompt-to-video/audio, and first/last-frame conditioning. Prompt-to-video/audio, first/last-frame conditioning and ordered Ref2VA image/video/audio references all work end to end, with ongoing work on H3-specific Metal performance and memory optimisation on M3 Max and M5 Max hardware.
Its most distinctive feature is how hard it pushes on the memory/quality/speed trade-off. Flags let you run a subset of the transformer blocks (`--layers`), reuse denoiser velocities instead of computing every pass (`--reuse`), or stream weights from SSD (`--ssd-streaming`), which the README measured as dropping tracked DiT tensor storage from about 36.5 GiB to 2.0 GiB at 512-square resolution on an M5 Max, using the original BF16 checkpoint with no quantization. Without `-p` the same binary opens an interactive session that keeps prompt conditioning, the prepared DiT and the video decoder resident between generations.
What it does
- Native C plus Metal implementation for Apple Silicon — one binary, no Python runtime
- Prompt-to-video and prompt-to-audio generation, with first-frame and last-frame conditioning anchors
- Ordered Ref2VA references: attach images that the model sees as <Picture 1>, <Picture 2> and refer to by number in the prompt
- Interactive session mode that caches prompt conditioning and decoders so re-rolling a seed skips reloading
- Explicit quality/speed controls — --steps, --reuse and --layers — plus --ssd-streaming for low-memory runs of the unquantized BF16 checkpoint
- In-terminal previews of the evolving frame via the Kitty/Ghostty and iTerm2/WezTerm/Konsole graphics protocols
Getting started
The examples assume the Hugging Face snapshot of MiniMax H3 is in ./MiniMax-H3 and that FFmpeg and FFprobe are on your PATH.
Build and inspect the model
Compile the binary, then run --info: it checks the model layout and prints the selected Metal device without mapping all the weights or generating media. ./h3 --help prints the full CLI reference.
make -j8
mkdir -p outputs
./h3 --info -d ./MiniMax-H3Generate a first video
The README's balanced preset generates 22 frames at 24 fps (about 0.92 seconds), running 45 of the 50 transformer blocks and extrapolating half the denoiser transitions.
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest. Medium tracking shot, natural winter light, realistic fur, soft footsteps and wind." \
--width 512 --height 512 \
--frames 22 --steps 20 \
--layers 45 --reuse 2 \
--show \
-o outputs/fox-fast.mp4Run interactively
Omitting -p starts an interactive session. Type a prompt to generate a numbered video; !status, !seed random, !seconds 2, !show, !save output.mp4 and !cache are the common commands, and !help lists them all.
./h3 -d ./MiniMax-H3 --width 512 --height 512 --steps 6Anchor the first and last frames
First/last-frame conditioning persists across a session; use !first clear or !last clear to remove an anchor. For a general conditioning image use !ref-image instead — the two modes cannot be mixed.
h3> !first opening.png
h3> !last ending.png
h3> The camera moves slowly around the subject.Run with a small memory footprint
--ssd-streaming keeps two DiT blocks in memory and reads the next from SSD while the GPU works. It is an explicit memory/speed trade-off, is not the default, and cannot be combined with --use-int8-row-fc2.
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest." \
--width 512 --height 512 --frames 22 --steps 20 \
--layers 50 --reuse 1 --ssd-streaming \
-o outputs/fox-ssd.mp4Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Generate video and audio from a prompt entirely on a Mac, with the weights and the output staying on your machine
- Iterate on a shot cheaply — four-pass drafts first, then restore layers and denoising passes as the composition settles
- Fit a large multimodal checkpoint onto a machine with limited unified memory by streaming DiT blocks from SSD instead of quantizing
- Read a compact C implementation to understand how a diffusion-transformer video model is actually executed
How h3.c compares
h3.c alongside other open-source local runtimes tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Ollama | ★ 180k | A developer-friendly tool that downloads and runs local LLMs from the terminal with a built-in OpenAI-compatible API. |
| llama.cpp | ★ 127k | A C/C++ inference engine that runs LLMs in the GGUF format on CPUs, Apple Silicon, and GPUs with low memory use. |
| GPT4All | ★ 77.4k | GPT4All is a free desktop app and Python client that runs large language models locally on your own computer, with no API calls or GPU required. |
| LocalAI | ★ 49k | A self-hosted server that exposes an OpenAI-compatible API for running text, vision, voice, and image models on local hardware. |
| Jan | ★ 44.4k | An open-source desktop app that runs LLMs fully offline as a ChatGPT-style assistant on your own computer. |
| AirLLM | ★ 33.8k | A Python inference library that keeps only one transformer layer on the GPU at a time, so a 70B model runs on a single 4GB card and a 671B MoE model on about 12GB, without quantization. |
| llamafile | ★ 25.9k | A Mozilla project that packages a model and its runtime into one executable file you can copy and run on any OS. |
| h3.c | ★ 2.6k | A dependency-light C and Metal inference engine that runs the MiniMax H3 multimodal model natively on Apple Silicon, turning a text prompt into video and audio |