MLC LLM
$ mlc_llm Foundation Med RiskMLC LLM (mlc_llm) compiles and deploys quantized LLMs across CUDA, Metal, Vulkan, OpenCL, and mobile targets using Apache TVM. Its CLI orchestrates weight conversion (convert_weight), config generation (gen_config), model compilation (compile), interactive chat, and OpenAI-compatible serve.
pip install mlc-llm mlc_llm runs heavy native TVM compilation and GPU weight conversion on the local workstation.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Interactive chat and blocking serve are common entrypoints; build subcommands (compile, convert_weight) emit verbose logs without --json.
- No
--jsonoutput mode acrossmlc_llmsubcommands mlc_llm chatopens an interactive REPL with/exitcommands
Executes locally/offline once models are fetched, though convert_weight and compile write multi-GB artifacts to disk.
- Local execution writing compiled libraries and quantized weights to
-o
Requires matching mlc-llm + mlc-ai nightly/CUDA/Metal wheels or complex CMake/TVM source builds.
- Wheel compatibility tied to specific CUDA/Metal/TVM builds
Enables portable GPU compilation across CUDA, Metal, Vulkan, and mobile runtimes.
- Cross-backend
--devicetargets (cuda,metal,vulkan,cpu)
Maintained by MLC AI (mlc-ai/mlc-llm) under Apache-2.0.
- Open-source
mlc-ai/mlc-llmrepository (Apache-2.0)
Thorough docs at llm.mlc.ai, though installation wheels and flags change frequently.
- Official docs at llm.mlc.ai/docs/
Security, Auth & Guardrails
Public models require no auth; gated Hugging Face weights pulled via HF:// read HF_TOKEN.
Apache-2.0 open-source framework; requires GPU drivers/toolchains and matched mlc-ai wheels.
# MLC LLM Agent Rules - Never run `mlc_llm chat` (interactive REPL) or `mlc_llm serve` (blocking daemon) synchronously. - Set `--device` explicitly and confirm disk space before running `mlc_llm convert_weight` or `mlc_llm compile`.
Agent-Ready Command Recipes
Safe Read-Only Queries
mlc_llm --help && mlc_llm compile --help
Lists compilation, weight conversion, and serving options without touching GPUs or downloading models.
Controlled Writes & Previews
mlc_llm gen_config ./dist/Llama-3-8B --quantization q4f16_1 --conv-template llama-3 -o ./dist/Llama-3-8B-q4f16_1-MLC
Writes mlc-chat-config.json without executing a long model compilation.
Strengths for Agents
- + Compiles LLMs across heterogeneous GPUs (CUDA, Metal, Vulkan) from one toolchain.
- + Clean separation between
gen_config,convert_weight, andcompilestages.
Caveats & Pitfalls
- ! Sensitive wheel/CUDA dependency matrix often requires isolated Conda environments.
- ! No
--jsonoutput support;chatis interactive andserveis a blocking daemon.