MLC-LLM
Universal LLM deployment through ML Compilation — run any large language model on any hardware with maximum performance using machine learning compilation.
🌟 20,000+ GitHub stars | Maintained by the MLC AI team | Apache-2.0 License
What is MLC-LLM?
MLC-LLM (Machine Learning Compilation for Large Language Models) is a universal framework that enables efficient deployment of large language models across diverse hardware backends. By leveraging TVM (Tensor Virtual Machine) as its compilation backend, MLC-LLM compiles LLM models directly to native hardware code — achieving near-optimal performance without hardware-specific engineering.
Key Capabilities
Universal hardware support — NVIDIA CUDA, AMD ROCm, Apple Metal, Vulkan, WebGPU
OpenAI-compatible REST API — drop-in replacement for existing workflows
Multiple model formats — Llama, Mistral, Gemma, Phi, Qwen, Falcon, and more
4-bit / 8-bit quantization — run large models on consumer GPUs
Chat interface — built-in web UI for immediate testing
Python & CLI tools — flexible integration options
Why Use MLC-LLM on Clore.ai?
Clore.ai GPU marketplace gives you access to high-performance NVIDIA GPUs at competitive rental rates. MLC-LLM's compilation approach squeezes maximum throughput from every GPU — making it ideal for:
Production API inference at scale
Research and benchmarking across model sizes
Cost-efficient serving with quantized models
Multi-model deployment on a single GPU instance
Quick Start on Clore.ai
Step 1: Find a GPU Server
Go to clore.ai marketplace
Filter servers: NVIDIA GPU, minimum 8GB VRAM (16GB+ recommended for 7B+ models)
For optimal performance: RTX 3090, RTX 4090, A100, or H100
Step 2: Deploy MLC-LLM
Use an NVIDIA CUDA base image in your Clore.ai order configuration:
Port mappings:
22
SSH access
8000
REST API server
Recommended environment variables:
Startup script (run after SSH):
Step 3: Connect via SSH
Installation & Setup
Option A: Use Pre-compiled Models (Fastest)
MLC-AI maintains a library of pre-compiled models on Hugging Face. No compilation needed:
Option B: Compile Your Own Model
For custom models or specific quantization requirements:
Running the API Server
Start the OpenAI-Compatible Server
Server Startup Output
Available API Endpoints
/v1/chat/completions
POST
Chat completions (OpenAI format)
/v1/completions
POST
Text completions
/v1/models
GET
List available models
/v1/debug/dump_event_trace
GET
Performance debugging
API Usage Examples
Chat Completions (Python)
Streaming Response
cURL Example
Available Pre-compiled Models
MLC-AI provides ready-to-use compiled models on Hugging Face:
Llama 3 Series
Mistral / Mixtral
Gemma
Phi
Quantization Options
MLC-LLM supports multiple quantization schemes. Choose based on your VRAM budget:
q4f16_1
4-bit
★★★★☆
~4GB
~7GB
q4f32_1
4-bit (f32 accum)
★★★★☆
~4GB
~7GB
q8f16_1
8-bit
★★★★★
~8GB
~14GB
q0f16
16-bit (no quant)
★★★★★
~14GB
~26GB
q0f32
32-bit (no quant)
★★★★★
~28GB
~52GB
Multi-GPU Deployment
For large models (70B+) requiring multiple GPUs:
Check GPU topology before deploying:
Web Chat Interface
MLC-LLM includes a built-in web UI accessible once the server is running:
Access the UI at: http://<clore-node-ip>:<api-port>
Performance Tuning
Optimize Batch Size
Monitor GPU Utilization
Benchmark Throughput
Docker Compose Setup
For a production-ready deployment on Clore.ai using an NVIDIA CUDA base image with MLC-LLM installed via pip:
Troubleshooting
Model Download Fails
Out of Memory (OOM)
CUDA Version Mismatch
Server Not Accessible
Clore.ai GPU Recommendations
MLC-LLM's compilation approach delivers near-optimal throughput on every GPU tier. Pick based on model size and budget:
RTX 3090
24 GB
$0.07–0.21/hr
7B–13B models, budget serving
~85 tok/s
RTX 4090
24 GB
$0.14–0.42/hr
7B–34B models, fast serving
~140 tok/s
H100 SXM
80 GB
~$1.04/hr
Maximum throughput, FP8
~280 tok/s
Recommended starting point: RTX 3090 at $0.07–0.21/hr is the best price-performance ratio for Llama 3 8B and Mistral 7B serving via MLC-LLM. The compiled kernels extract near-maximum utilization from consumer GPUs.
For 70B models (e.g., Llama 3 70B Q4): use A100 40GB (bare metal) or two RTX 3090s via tensor parallelism.
Resources
📦 Pip Wheels: mlc.ai/wheels (install via pip, no Docker Hub image available)
🐙 GitHub: github.com/mlc-ai/mlc-llm
📚 Documentation: llm.mlc.ai/docs
🤗 Pre-compiled Models: huggingface.co/mlc-ai
💬 Discord: discord.gg/9Xpy2HGBuD
Last updated
Was this helpful?