跳到主要内容Skip to main content
本地推理与部署Local Inference & Serving本地优先Local-first

MLC LLM

mlc-ai / mlc-llm

基于 TVM 的通用 LLM 编译部署引擎,可把模型编译到 CUDA、ROCm、Metal、Vulkan、WebGPU 等后端。A TVM-based compiler and deployment engine that compiles LLMs to CUDA, ROCm, Metal, Vulkan and WebGPU backends.

23.4k stars 2207 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-11-20

为什么选Why choose it

  • 同一模型跨 NVIDIA、AMD、Apple、移动端和浏览器部署时,编译路线比逐平台写 kernel 统一。Compilation targets many hardware backends, including browsers.
  • WebGPU 后端能在浏览器本地跑模型,适合做隐私优先的端侧 demo。Useful when the deployment device is not a standard NVIDIA server.
  • 量化与图优化在编译期完成,能观察到不同后端对同一模型的性能差异。Can produce portable runtimes.

不适合Not for

追求极致单卡吞吐的数据中心 serving;编译和调优门槛高于 vLLM。You need same-day support for every new model.
需要快速接上新模型、不想处理编译错误的使用者。You want a simple pip-install-and-run experience.

最小上手Minimum setup

  1. 按平台文档安装 mlc-llm 与 TVM 运行时。Compile one small model for a supported target.
  2. 编译并跑一个 1B–3B 模型的 CLI chat。Run it and record latency and memory.
  3. 换 WebGPU 或 Metal 后端,记录加载时间、token/s 与内存占用。Try a second backend and compare output consistency.

依赖与成本Dependencies and cost

Python;TVM;目标平台工具链;编译需要模型权重。Check runtime, model weights and external service dependencies in the README.

许可与使用边界License and usage boundaries

代码 Apache-2.0;模型权重另计。Code is Apache-2.0; model weights, training data and generated content may have separate terms — check each before commercial use.

开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

替代与相邻Alternatives and neighbors

  • llama.cpp — 本地优先Local-first,C/C++ 推理引擎,CPU、Apple Silicon、消费级 GPU 都能跑,量化格式丰富。A C/C++ inference engine that runs on CPUs, Apple Silicon and consumer GPUs, with a wide range of quantisation formats.
  • llamafile — 轻量Lightweight,把 llama.cpp 与模型权重打包成单个可执行文件,跨 macOS/Windows/Linux/BSD 运行,无需安装 Python。Package llama.cpp and model weights into a single executable that runs on macOS, Windows, Linux and BSD without Python.
  • TensorRT-LLM — 规模 / 性能Scale / performance,NVIDIA 的 LLM 推理优化栈:自定义 kernel、量化、in-flight batching 与多卡并行,面向生产吞吐。NVIDIA’s LLM inference optimisation stack: custom kernels, quantisation, in-flight batching and multi-GPU for production throughput.

下一步Next steps

  • 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
  • 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.

GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare

快照口径:stars / forks / language / license / pushed_at 来自 GitHub API 2026-11-20 快照;之后的变化没有回写。标签与“适合 / 不适合”是编辑判断,不是 GitHub 元数据。Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
不背书:本站只做索引与风险提示,不审计代码、不保证安全、不替你做许可判断。仓库脚本与模型权重请自行审查。No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.