MCPcopy Index your code
hub / github.com/mlc-ai/mlc-llm

github.com/mlc-ai/mlc-llm @v0.19.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.19.0 ↗ · + Follow
2,577 symbols 9,798 edges 379 files 893 documented · 35% 5 cross-repo links updated 6d agov0.1.dev0 · 2023-04-29★ 22,905288 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MLC LLM

Installation License Join Discoard Related Repository: WebLLM

Universal LLM Deployment Engine with ML Compilation

Get Started | Documentation | Blog

About

MLC LLM is a machine learning compiler and high-performance deployment engine for large language models. The mission of this project is to enable everyone to develop, optimize, and deploy AI models natively on everyone's platforms. 

AMD GPU NVIDIA GPU Apple GPU Intel GPU
Linux / Win ✅ Vulkan, ROCm ✅ Vulkan, CUDA N/A ✅ Vulkan
macOS ✅ Metal (dGPU) N/A ✅ Metal ✅ Metal (iGPU)
Web Browser ✅ WebGPU and WASM
iOS / iPadOS ✅ Metal on Apple A-series GPU
Android ✅ OpenCL on Adreno GPU ✅ OpenCL on Mali GPU

MLC LLM compiles and runs code on MLCEngine -- a unified high-performance LLM inference engine across the above platforms. MLCEngine provides OpenAI-compatible API available through REST server, python, javascript, iOS, Android, all backed by the same engine and compiler that we keep improving with the community.

Get Started

Please visit our documentation to get started with MLC LLM. - Installation - Quick start - Introduction

Citation

Please consider citing our project if you find it useful:

@software{mlc-llm,
    author = {{MLC team}},
    title = {{MLC-LLM}},
    url = {https://github.com/mlc-ai/mlc-llm},
    year = {2023-2025}
}

The underlying techniques of MLC LLM include:

References (Click to expand)

```bibtex @inproceedings{tensorir, author = {Feng, Siyuan and Hou, Bohan and Jin, Hongyi and Lin, Wuwei and Shao, Junru and Lai, Ruihang and Ye, Zihao and Zheng, Lianmin and Yu, Cody Hao and Yu, Yong and Chen, Tianqi}, title = {TensorIR: An Abstraction for Automatic Tensorized Program Optimization}, year = {2023}, isbn = {9781450399166}, publisher = {Association for Computing Machinery}, address = {New York, NY, USA}, url = {https://doi.org/10.1145/3575693.3576933}, doi = {10.1145/3575693.3576933}, booktitle = {Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2}, pages = {804–817}, numpages = {14}, keywords = {Tensor Computation, Machine Learning Compiler, Deep Neural Network}, location = {Vancouver, BC, Canada}, series = {ASPLOS 2023} }

@inproceedings{metaschedule, author = {Shao, Junru and Zhou, Xiyou and Feng, Siyuan and Hou, Bohan and Lai, Ruihang and Jin, Hongyi and Lin, Wuwei and Masuda, Masahiro and Yu, Cody Hao and Chen, Tianqi}, booktitle = {Advances in Neural Information Processing Systems}, editor = {S. Koyejo and S. Mohamed and A. Agarwal and D. Belgrave and K. Cho and A. Oh}, pages = {35783--35796}, publisher = {Curran Associates, Inc.}, title = {Tensor Program Optimization with Probabilistic Programs}, url = {https://proceedings.neurips.cc/paper_files/paper/2022/file/e894eafae43e68b4c8dfdacf742bcbf3-Paper-Conference.pdf}, volume = {35}, year = {2022} }

@inproceedings{tvm, author = {Tianqi Chen and Thierry Moreau and Ziheng Jiang and Lianmin Zheng and Eddie Yan and Haichen Shen and Meghan Cowan and Leyuan Wang and Yuwei Hu and Luis Ceze and Carlos Guestrin and Arvind Krishnamurthy}, title = {{TVM}: An Automated {End-to-End} Optimizing Compiler for Deep Learning}, booktitle = {13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18)}, year = {2018}, isbn = {978-1-939133-08-3}, address = {Carlsbad, CA}, pages = {578--594}, url = {https://www.usenix.org/conference/osdi18/presentation/chen}, publisher = {USENIX Association}, month = oct, } ```

Extension points exported contracts — how you extend this code

KotlinFunction (Interface)
(no doc) [1 implementers]
android/mlc4j/src/main/java/ai/mlc/mlcllm/JSONFFIEngine.java

Core symbols most depended-on inside this repo

print
called by 412
examples/rest/nodejs/sample_client.js
bold
called by 160
python/mlc_llm/support/style.py
add_mapping
called by 131
python/mlc_llm/loader/mapping.py
quantize_model
called by 77
python/mlc_llm/quantization/ft_quantization.py
get
called by 64
python/mlc_llm/nn/rnn_state.py
compute
called by 54
python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py
decode
called by 44
python/mlc_llm/tokenizers/tokenizers.py
register_conv_template
called by 42
python/mlc_llm/conversation_template/registry.py

Shape

Method 1,386
Function 739
Class 436
Route 15
Interface 1

Languages

Python99%
Java1%
TypeScript1%

Modules by API surface

python/mlc_llm/bench/request_processor.py55 symbols
python/mlc_llm/serve/engine_base.py48 symbols
python/mlc_llm/model/deepseek_v2/deepseek_v2_model.py46 symbols
python/mlc_llm/model/nemotron/nemotron_model.py44 symbols
python/mlc_llm/model/olmo/olmo_model.py41 symbols
python/mlc_llm/model/llama/llama_model.py41 symbols
python/mlc_llm/serve/engine.py38 symbols
python/mlc_llm/model/rwkv6/rwkv6_model.py36 symbols
python/mlc_llm/model/phi/phi_model.py36 symbols
python/mlc_llm/model/minicpm/minicpm_model.py36 symbols
python/mlc_llm/model/cohere/cohere_model.py35 symbols
python/mlc_llm/model/rwkv5/rwkv5_model.py34 symbols

Dependencies from manifests, versioned

@types/node20.4.4 · 1×
dotenv16.3.1 · 1×
langchain0.0.117 · 1×
needle3.2.0 · 1×
openai3.3.0 · 1×
ts-node10.9.1 · 1×
typescript5.1.6 · 1×
sphinx5.2.3 · 1×
sphinx-reredirects0.1.2 · 1×
sphinx-tabs3.4.1 · 1×
sphinx-toolbox3.4.0 · 1×
sphinxcontrib-napoleon0.7 · 1×

For agents

$ claude mcp add mlc-llm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact