InternLM
Compress, deploy, and serve open models with high throughput.
GitHub Stars
8.0K
Contributors
145
PyPI / Month
51.5K
3%LMDeploy is a toolkit for compressing, deploying, and serving open large language models, maintained by the InternLM team at Shanghai AI Laboratory. First released in 2023 and licensed under Apache 2.0, it occupies the serving engine category — designed for teams that need to run open models on their own hardware with high throughput and low cost per token. The engine is written in a mix of Python and C++/CUDA, with its core inference backend, TurboMind, built on NVIDIA’s FasterTransformer.
LMDeploy competes directly with vLLM, SGLang, and TensorRT-LLM. Its design philosophy emphasizes throughput and simplicity: you get an OpenAI-compatible server, built-in quantization, and continuous batching out of the box, all behind a single pip install lmdeploy command. With roughly 7,900 GitHub stars, 140 contributors, and over 52,000 monthly PyPI downloads, it has a smaller English-language community than vLLM but a focused, active development cycle.
LMDeploy operates as both a Python library and a standalone server. The primary abstraction is the TurboMind engine, which handles model loading, inference, and batching. You can use LMDeploy in three modes:
lmdeploy serve api_server <model> to start an OpenAI-compatible HTTP server. It listens on a configurable port and exposes endpoints like /v1/chat/completions and /v1/completions. Existing OpenAI clients can point at this endpoint without code changes.lmdeploy and use the pipeline function for offline inference. This is useful for batch processing or embedding LMDeploy into a larger application.The runtime model is a persistent batch (continuous batching) with blocked KV cache management. When a request arrives, it joins the running batch if a slot is free; otherwise it queues. The engine dynamically splits and fuses attention computations across tokens in the batch, maximizing GPU utilization. Streaming responses are supported via server-sent events.
To serve a model, you point LMDeploy at a Hugging Face model ID or a local path. It downloads the weights automatically if needed, applies any configured quantization (AWQ, GPTQ, SmoothQuant, or INT4/INT8 KV cache), and starts the server. The entire flow from install to a running endpoint can be under five minutes on a modern GPU rig.
LMDeploy is optimized for NVIDIA GPUs. The TurboMind engine uses high-performance CUDA kernels, tensor parallelism, and dynamic split-and-fuse attention to deliver strong throughput. The maintainers report up to 1.8x higher request throughput than vLLM in their benchmarks, and 4-bit quantized inference at 2.4x the tokens per second of FP16. These numbers are workload-dependent, but the engine consistently ranks among the fastest for batch serving on H100 and A100-class hardware.
Hardware support (confirmed capabilities): NVIDIA GPUs (V100 and newer). The engine also has experimental support for AMD ROCm, Ascend NPUs, and Cambricon accelerators via community contributions, but these are not covered in the confirmed capabilities and should be evaluated case by case. There is no CPU-only inference path; LMDeploy requires a GPU for any meaningful performance.
Memory management: LMDeploy supports weight-only quantization (AWQ, GPTQ, SmoothQuant) and KV cache quantization (INT4/INT8). This allows running larger models on smaller GPUs — for example, a 70B parameter model quantized to 4-bit can fit on a single 80GB A100 or H100. The blocked KV cache manager pages memory efficiently, and automatic prefix caching further reduces redundant computation for repeated prompt prefixes.
Scaling: Multi-GPU inference is handled via tensor parallelism across up to 8 GPUs on a single node. For multi-node deployments, the request distributor server can route across machines, though this adds operational complexity. Continuous batching is the default, and it works with all quantization modes simultaneously.
/v1/chat/completions and /v1/completions. This means any OpenAI client library (Python, JavaScript, curl) can be pointed at LMDeploy with only a URL change. It also supports tool calling, streaming, and structured output (JSON mode).LMDeploy is a poor fit for CPU-only deployments, edge devices without NVIDIA GPUs, or teams that need tight integration with AMD or Intel hardware. It also has a smaller ecosystem of community extensions compared to vLLM.
Install: pip install lmdeploy
Minimum path to a running server:
lmdeploy serve api_server internlm/internlm2-chat-7bhttp://localhost:23333. Send a request:1 curl http://localhost:23333/v1/chat/completions \2 -H "Content-Type: application/json" \3 -d '{"model": "internlm/internlm2-chat-7b", "messages": [{"role": "user", "content": "Hello"}]}'
What you need: A GPU with CUDA 11.8 or later. For quantized models, you may need additional packages (lmdeploy[awq] or autoawq). The documentation at [lmdeploy.readthedocs.io](https://lmdeploy.readthedocs.io) covers supported models, quantization recipes, and advanced configuration.
Community: GitHub issues and discussions are active. The project has a WeChat group, Discord server, and Twitter account for updates. The documentation is thorough and includes quickstart guides, benchmark instructions, and deployment recipes.
LMDeploy vs vLLM: vLLM has broader hardware support (AMD, Intel, Apple Silicon via community forks) and a larger ecosystem of model architectures. LMDeploy tends to win on raw throughput for NVIDIA workloads, especially with quantization enabled. If you are on NVIDIA and want the fastest tokens per second with minimal setup, LMDeploy is the stronger choice. If you need multi-platform support or a larger community for troubleshooting, vLLM is safer.
LMDeploy vs Ollama: Ollama focuses on ease of use for local experimentation on a single machine, including Mac and CPU support. LMDeploy is built for production serving with high throughput and multi-GPU scaling. For a single developer running models on a laptop, Ollama is simpler. For a team serving a model to thousands of users, LMDeploy is more appropriate.
LMDeploy vs SGLang: SGLang introduces a custom frontend language for structured generation and has strong support for agentic workflows. LMDeploy’s structured output is simpler (JSON schema via the API) but less flexible. SGLang also supports a wider range of hardware. LMDeploy wins on throughput and quantization maturity; SGLang wins on programmable generation and multi-hardware support.
Choose LMDeploy when your primary goal is maximum throughput on NVIDIA GPUs with built-in quantization and an OpenAI-compatible API. Avoid it if you need CPU inference, AMD-first hardware, or a large English-language community.
What the engine gives you out of the box, in plain language.
A fast inference backend tuned for throughput on NVIDIA GPUs.
Shrink models with weight and KV cache quantization to save memory.
Serves a familiar API so existing clients connect without changes.
The jobs this engine is best suited for.
Serve an open model to a busy app with low cost per token.
Use quantization to run a bigger model on a smaller card.
Point existing OpenAI clients at your own GPU box.

Side-by-Side
Add a second or third engine and see stars, downloads, and capabilities lined up next to each other.
Close alternatives worth a look before you decide.
High-throughput GPU serving with an OpenAI-compatible API out of the box.
High-throughput GPU serving
pip install vllmStars
88.8K
PyPI / mo
5.1M
Fast serving engine tuned for structured output and complex prompting.
High-throughput serving with structured output
pip install "sglang[all]"Stars
31.7K
PyPI / mo
327.4M
Run open models locally with a single command.
One-line local model running
curl -fsSL https://ollama.com/install.sh | shStars
178.2K
PyPI / mo
—