What Is MLC LLM? Run Language Models Locally on Any Device

Emre Çitak
Updated •
AI

MLC LLM is an open-source machine learning compiler and deployment engine that runs large language models natively on your own hardware: Windows, Linux, macOS, web browsers, iPhones and Android phones. It is released under the Apache-2.0 license, exposes an OpenAI-style REST API through its MLCEngine, and runs on Vulkan, CUDA, ROCm, Metal, OpenCL and WebGPU.

This page explains what MLC LLM is, where it runs, how to install it and serve a model, how it compares with other local LLM tools, and what limits to expect.

What is MLC LLM?

MLC LLM describes itself as "a machine learning compiler and high-performance deployment engine for large language models", with the mission of letting anyone develop, optimize and deploy AI models natively on their own platforms. The project is developed by the mlc-ai group on GitHub.

The core idea is machine learning compilation: a model is compiled once for each target (a CUDA GPU, an Apple GPU, a phone, a browser tab), and a single inference engine, MLCEngine, runs the compiled result everywhere. That is why one project covers servers, laptops, browsers and phones.

Which hardware and platforms does MLC LLM support?

MLC LLM supports Linux, Windows and macOS desktops, web browsers, iOS and iPadOS, and Android. According to the project README, each platform maps to specific GPU backends:

Platform and GPU Backend
Linux or Windows, AMD Vulkan, ROCm
Linux or Windows, NVIDIA Vulkan, CUDA
Linux or Windows, Intel Vulkan
macOS (Apple, AMD, Intel GPUs) Metal
Web browser WebGPU, WASM
iOS and iPadOS, Apple A-series Metal
Android, Adreno and Mali OpenCL

Browser inference is delivered by the companion project WebLLM, which needs a WebGPU-capable browser. Chrome added WebGPU in version 113, as we covered in Chrome 113 with WebGPU support. For phones, the project provides an iOS Swift SDK and an Android SDK for building on-device chat apps.

How do I install MLC LLM and run a model?

Install MLC LLM with pip inside an isolated conda environment, then point it at a prebuilt model from Hugging Face. The documentation recommends Python 3.13 and currently offers nightly wheels, with CPU, CUDA, ROCm and Vulkan variants.

  1. Create an environment: conda create --name mlc-prebuilt python=3.13
  2. Install a nightly build, for example the CPU wheels: python -m pip install --pre -U -f https://mlc.ai/wheels mlc-llm-nightly-cpu mlc-ai-nightly-cpu. Pick the CUDA, ROCm or Vulkan package for GPU use.
  3. Check the install: python -c "import mlc_llm; print(mlc_llm)"
  4. On Windows or Linux with Vulkan, add the loader: conda install -c conda-forge clang libvulkan-loader git-lfs git
  5. Load a model by its Hugging Face name, for example HF://mlc-ai/Llama-3-8B-Instruct-q4f16_1-MLC.

The quick start notes that the int4-quantized Llama 3 8B model needs at least 6 GB of free VRAM, so start with a smaller model on weaker GPUs. Full details are in the MLC LLM quick start and the installation guide.

Does MLC LLM have an OpenAI-compatible API?

Yes, MLC LLM can run a local REST server with OpenAI-style endpoints. Start it with mlc_llm serve MODEL; the server listens on port 8000 by default.

Two endpoints matter: GET /v1/models lists the loaded models and POST /v1/chat/completions returns chat responses, with or without streaming, using the familiar messages and tools fields. Interactive API docs are served at http://127.0.0.1:PORT/docs. The documentation does not promise full drop-in compatibility, so test your client against it before relying on it.

Besides REST, the engine has a command line interface (mlc_llm chat), a Python API, a JavaScript SDK (WebLLM), an iOS Swift SDK and an Android SDK.

How does MLC LLM compare with other local LLM tools?

MLC LLM is a compiler-based engine focused on running one model across many kinds of hardware, whereas desktop tools such as Ollama or LM Studio focus on simple downloads and chat on a PC. Choose MLC LLM when you need mobile, browser or non-NVIDIA GPU targets, or when you want to embed an engine in an app.

  • Strength: one engine across Vulkan, Metal, OpenCL, CUDA, ROCm and WebGPU.
  • Trade-off: setup is more technical (conda, nightly wheels, model libraries) than a one-click desktop app.
  • Privacy: prompts stay on your device when you run the model locally, the same reason on-device features such as VLC's offline AI subtitles appeal to privacy-minded users.

Why does MLC LLM fail to run or run slowly?

Most failures come from missing GPU drivers, too little VRAM or a missing Vulkan loader. Work through this list:

  • "vulkan not found" on Windows, Linux or Steam Deck: install the loader with conda install -c conda-forge gcc libvulkan-loader.
  • FileNotFoundError for tvm.dll on Windows: run conda install zstd.
  • Model download or compile fails: install git-lfs, which automatic downloads and JIT compilation need.
  • Out of memory: use a smaller or more heavily quantized model; an 8B model at 4-bit already needs about 6 GB of VRAM.
  • Slow generation: confirm the engine uses your GPU backend and not the CPU wheel.

History: how MLC LLM launched in 2023

MLC LLM first appeared in May 2023 as an open-source project that brought chat with language models to phones and PCs, with a command line tool and an iOS chat app as demos. It has since grown into the MLCEngine platform with REST, Python, web and mobile SDKs described above.

FAQ

Is MLC LLM free?

Yes. MLC LLM is open source under the Apache-2.0 license, and the models you run keep their own licenses.

What does MLC stand for?

MLC stands for machine learning compilation, the technique the project uses to prepare a model for each target device.

Can MLC LLM run in a web browser?

Yes. The companion WebLLM project runs models in the browser through WebGPU, with no server involved.

Related: Chrome 113 and WebGPU, VLC offline AI subtitles

Comments

There are no comments on this post yet, be the first one to share your thoughts!

Leave a Reply

By commenting, you accept our privacy policy and keep the discussion respectful and on topic.