runner
Open source
free + open-source

MLC LLM

TVM-based LLM compilation framework. Compiles models for any GPU with a Vulkan / Metal / WebGPU / CUDA backend. The most-deployed cross-platform on-device LLM runtime — runs Llama, Phi, Gemma, Qwen on phones, browsers, and laptops without per-platform rewrites.

By Eruo Fredoline·Last verified Jun 12, 2026·19,000 GitHub stars

Overview

What it is and how it works

MLC LLM is the deployment-facing project built on top of Apache TVM Unity (and its successor compiler stack, sometimes referred to as Relax), the machine-learning compiler developed out of the same research lineage as TVM itself. Where most local-inference runners ship a hand-written CUDA/Metal/CPU kernel library and a fixed set of supported architectures, MLC LLM takes the opposite approach: it treats the model as a computation graph and compiles it, ahead of time, down to a target-specific executable using TVM's code generation backends. The practical effect is that a single model definition can be lowered to CUDA for NVIDIA GPUs, Metal for Apple Silicon, Vulkan for AMD and most Android GPUs (Mali, Adreno), or WebGPU for in-browser execution — without hand-porting kernels for each platform. This is the core of its pitch and the reason it's positioned as the "most-deployed cross-platform on-device LLM runtime": the compilation model, not the runtime loop, is the product.

Under the hood, MLC LLM's toolchain takes a Hugging Face-format model, converts weights into its own quantized format, and applies a TVM compilation pass that fuses operators, schedules memory layout for the target device, and emits either a shared library or, for the web target, a set of WebGPU shader modules plus a WASM host runtime. The resulting artifact is paired with a lightweight runtime (available as a Python package, a C++ library, a Swift/Kotlin binding for iOS/Android, and a JavaScript package for browsers) that loads the compiled graph and executes it. This is fundamentally different from llama.cpp's model, where GGUF files are interpreted by a generalized kernel dispatcher at load time — MLC's compiled artifacts are narrower and faster to execute but tied to the target they were built for.

The quantization system, which MLC calls its own format conventions rather than reusing GGUF, is TVM-native: weights are packed and dequantized using kernels generated by the same compiler pipeline, rather than a separately maintained quant library. This gives MLC tight integration between quantization scheme and generated kernel (useful for squeezing performance on constrained mobile GPUs) but means the quant ecosystem is narrower and less interoperable than llama.cpp's GGUF, which benefits from a much larger community producing pre-quantized files for nearly every releases model.

Deployment patterns

On a single workstation or laptop, MLC LLM is used largely the way llama.cpp or Ollama are used: pull or convert a model, run the compilation step once (this is the part that differs — there's a genuine build/compile phase, not just a load), and then serve it through the Python mlc_llm CLI, a local REST-compatible server, or a chat app binary. The compile step is the tradeoff operators pay for: it's not a drop-in "download GGUF, run" experience — expect to spend real time (and disk space for intermediate artifacts) getting a new model or a new quantization variant compiled for your specific device before you can use it.

The distinguishing deployment pattern for MLC LLM, though, is mobile and browser. It ships prebuilt iOS and Android apps (MLC Chat) that run compiled models fully on-device via Metal/Vulkan, which is a genuinely differentiated capability — most local runners target desktop/server GPUs first and treat phones as an afterthought or don't support them at all. The WebGPU/WebLLM path is similarly distinctive: models compiled for the web target run inference entirely in-browser via WebGPU with no server round trip, which is useful for demos, privacy-sensitive browser extensions, or edge deployments where you can't install a native binary. In a homelab or small-team context, MLC LLM is less commonly the default choice for a always-on inference server — vLLM or TGI dominate that niche — but it does get used where the deployment target is heterogeneous hardware (e.g., a fleet of different-vendor GPUs or ARM devices) where a single TVM-compiled artifact per target is easier to manage than vendor-specific kernel builds.

How it compares

Against llama.cpp, MLC LLM trades breadth of adoption and quant ecosystem for compiled-kernel performance on non-CUDA/non-Metal backends. llama.cpp's GGUF format and massive community mean any new model is usually quantized and shared within hours; MLC requires its own conversion/compile step per target, which is slower to iterate but can yield better throughput on backends like Vulkan where llama.cpp's generic kernels are less tuned. Documentation and community support clearly favor llama.cpp.

Against vLLM, the comparison is more about scope than overlap: vLLM is a server-oriented, CUDA-first (with growing ROCm/other support) throughput engine built around PagedAttention and continuous batching for multi-user serving, while MLC LLM's cross-platform compilation targets single-user, on-device, and edge scenarios including phones and browsers that vLLM does not address at all. If the deployment target is a datacenter GPU serving many concurrent requests, vLLM is the better fit; if the target is a phone, a browser tab, or heterogeneous consumer GPUs, MLC is in a different lane entirely.

Against ONNX Runtime / Apple's MLX for on-device inference, MLC LLM's advantage is genuine platform breadth from one compilation pipeline — MLX is Apple-only, and ONNX Runtime's mobile/web execution providers require more manual per-backend tuning. MLC's TVM foundation gives it a real, non-marketing claim to "compile once, deploy to (almost) anywhere," even if the operational cost is a real compile step and a smaller community to lean on when something breaks.

Best use cases and honest limitations

MLC LLM is the right choice when the deployment target is mobile, browser (WebGPU), or a genuinely heterogeneous GPU fleet where a compiled, per-target artifact is worth the setup cost — teams building an on-device mobile AI feature or an in-browser inference demo have few real alternatives with this level of platform coverage. It's a poor choice for someone who wants to ollama run a new model in thirty seconds, or a team running a straightforward NVIDIA-only inference server where vLLM's serving features (continuous batching, PagedAttention, broader model-parallelism support) are more directly useful. The compile-time overhead is a recurring cost, not a one-time inconvenience — new model architectures or quant variants require re-running the compilation pipeline, and the narrower quant ecosystem means you're more often building your own quantized weights rather than downloading a community one. Documentation density lags llama.cpp and vLLM, so expect more source-diving when something doesn't work as expected. Teams should adopt MLC LLM specifically for its cross-platform reach, not as a general-purpose default local runner.

Setup guidance

Install via pip: pip install mlc-llm. Requires Python 3.10+ and a supported runtime: CUDA 12.1+ (NVIDIA), Metal (Apple Silicon), Vulkan (all GPUs including Intel iGPU), or ROCm (AMD). MLC-LLM works differently from most engines: models must be compiled to a platform-specific library via TVM Unity before inference. For pre-compiled models: mlc_llm chat HF://mlc-ai/Llama-3.2-3B-Instruct-q4f16_1-MLC — this downloads a pre-compiled model and starts an interactive CLI. For server mode: mlc_llm serve HF://mlc-ai/Llama-3.2-3B-Instruct-q4f16_1-MLC --port 8080. The server exposes an OpenAI-compatible API at /v1/chat/completions. Verify: curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"default","messages":[{"role":"user","content":"Hello"}]}'. For custom models, compile with mlc_llm compile <model-path> --device <target>. First run downloads the pre-compiled model package (~4–6 GB for a 7B) and starts in 3–8 minutes. Time-to-first-response from zero: ~3 minutes with pre-compiled model. MLC-LLM also supports WebGPU (browser) and iOS/Android via native runtime.

Workload fit

Best for: cross-platform local inference where the same model must run on phone, laptop, and server, WebGPU browser-based inference (in-browser LLM demos without a backend server), mobile on-device inference with optimized native runtimes, heterogeneous GPU deployments (Intel Arc, AMD Radeon, Qualcomm Adreno, Apple GPU) where CUDA-only engines can't deploy, research and experimentation with model compilation pipelines. Not suited for: rapid model iteration where compilation cost kills velocity (use Ollama or llama.cpp), maximum-throughput NVIDIA datacenter serving (use vLLM), GGUF-based model ecosystems without MLC-format re-compilation, users who need point-and-click setup (MLC-LLM requires compilation awareness).

Alternatives

Use MLC-LLM when you need inference across the widest range of device targets — Windows, Linux, macOS, iOS, Android, and WebGPU (browser) from a single compilation pipeline. MLC-LLM's TVM-based compilation approach produces the best GPU utilization on non-NVIDIA hardware (Intel iGPU, Mali, Adreno mobile GPUs) of any engine. Switch to llama.cpp when you need instant model loading without a compilation step — MLC-LLM requires pre-compiled model packages. Use vLLM for NVIDIA datacenter production serving where throughput matters more than deployment breadth. Use MLX-LM on Apple Silicon for simpler setup — MLC-LLM works on Apple Silicon but requires the compilation step that MLX-LM skips. MLC-LLM's unique value is "write once, deploy everywhere" — the same compiled model runs on a phone, laptop, and server.

Troubleshooting + when to switch

Problem: TVMError: Cannot find tuned kernel for target <gpu_arch>. Fix: The pre-compiled model was built for a different GPU architecture. Download a model compiled for your specific target: mlc_llm chat HF://mlc-ai/Llama-3.2-3B-Instruct-q4f16_1-MLC --device vulkan:1.3 for Vulkan, --device metal for Apple, --device cuda for NVIDIA. MLC-LLM model packages are device-specific. Problem: Compilation from source takes hours. Fix: MLC-LLM model compilation is TVM-level auto-tuning — it searches a kernel space for optimal tensor operations. Use --opt O2 instead of O3 for faster compilation with 5–10% throughput loss. For development, always use pre-compiled models from the MLC-AI org on HuggingFace. Problem: WebGPU browser deployment fails on Firefox. Fix: WebGPU model serving requires Chrome/Edge (Chromium) with WebGPU enabled. Firefox WebGPU support is behind a flag and not production-ready. Test on Chrome Canary or Edge Dev with --enable-unsafe-webgpu flag.

Featured in this stack

The L3 execution stacks that pick this tool as a recommended component, with the one-line note explaining the role it plays in each.

Pros

  • Cross-platform via TVM — same model compiles for iOS/Android/Web/desktop
  • Strongest mobile LLM benchmark numbers as of 2026
  • WebGPU path enables in-browser LLM inference

Cons

  • Compile-time overhead is real — not a drop-in runtime
  • Quant ecosystem narrower than llama.cpp (relies on TVM-specific quants)
  • Documentation density trails llama.cpp / vLLM

Compatibility

Operating systems
iOS
Android
Windows
macOS
Linux
GPU backends
NVIDIA
AMD
Apple
Qualcomm Adreno
Mali
LicenseOpen source · free + open-source

Runtime health

Operator-grade signals on how actively MLC LLM is being maintained, how fresh its measurements are, and what failure classes operators have flagged. Every label below is anchored to a real date or count — we never infer maintainer activity we can't show.

Release cadence

Derived from the most recent editorial signal on this row.

Active
Updated Jul 3, 2026

40 days since last refresh · source: enrichedAt

Benchmark freshness

How recent the editorial measurements on this runtime are.

0editorial benchmarks

No editorial benchmarks for this runtime yet.

Community reproduction

Submissions that match an editorial measurement on similar hardware.

0reproduced reports

No community reproductions on file yet.

Get MLC LLM

Frequently asked

Is MLC LLM free?

Yes — MLC LLM is free to use and open-source.

What operating systems does MLC LLM support?

MLC LLM supports iOS, Android, Windows, macOS, Linux.

Which GPUs work with MLC LLM?

MLC LLM supports NVIDIA, AMD, Apple, Qualcomm Adreno, Mali. CPU-only operation is also possible but typically slower.

Reviewed by RunLocalAI Editorial. See our editorial policy for how we evaluate tools.

Related — keep moving

Before you buy

Verify MLC LLM runs on your specific hardware before committing money.