默认从 HuggingFace 下载模型,用 ModelScope 需装 modelscope 并设 LMDEPLOY_USE_MODELSCOPE=True;建议在 conda 环境用 Python 3.10–3.13 安装;预编译 wheel 基于 CUDA 12.8,其他 CUDA 版本需自行处理。
lmdeploy
InternLMApache-2.0活跃维护LMDeploy 是面向大模型的高效推理与服务工具包,支持模型压缩、部署和在线服务,内置 TurboMind 推理引擎和 CUDA 算子,可加速 Llama、InternLM 等模型的推理。
LMDeploy is a toolkit for compressing, deploying, and serving LLMs.
conda create -n lmdeploy python=3.12 -y
conda activate lmdeploy
pip install lmdeployREADME 未给出具体显存要求;预编译 wheel 自 v0.13.0 起基于 CUDA 12.8 构建,覆盖 GeForce RTX 50 系列;TurboMind 支持 NVIDIA GPU(MXFP4 自 V100 起),PyTorch 引擎支持华为 Ascend。
压缩、部署并服务大模型的一站式工具包,主打高吞吐推理与量化
LMDeploy 是面向大模型的高效推理与服务工具包,支持模型压缩、部署和在线服务,内置 TurboMind 推理引擎和 CUDA 算子,可加速 Llama、InternLM 等模型的推理。
核心能力
- 用持续批处理与分块 KV 缓存提升请求吞吐
- 支持权重与 KV 的 4bit 量化推理
- 提供 TurboMind 与纯 Python 的 PyTorch 双推理引擎
- 支持张量并行与多机多卡推理服务
- 提供 OpenAI 兼容的 LLM/VLM 服务接口
容易踩的坑
- v0.18.0最新正式版2026-09-28 · 2026-09-28 07:04 UTC
What's Changed
🚀 Features
- [Feat]: Support output input logprobs by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4793
- Expand SM90 quantized GEMMs and unify TurboMind linear execution by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4943
- [ascend] support glm52 by @wanfengcxz in https://github.com/InternLM/lmdeploy/pull/4928
- Support dflash for qwen3.5 by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4789
- Move shared expert into the MoE FFN layer; shard dense FFN node-locally in MoE models by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4973
💥 Improvements
- fix: shard MLA attention under hybrid DP and TP by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4908
- refactor(serving): share chat serving runner by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4876
- feat(pytorch): prototype TurboMind W4A16 backend for AWQ linear by @qescccczmr in https://github.com/InternLM/lmdeploy/pull/4897
- refactor(pytorch): redesign CacheEngine around plans and allocations by @grimoire in https://github.com/InternLM/lmdeploy/pull/4862
- fix: reject multimodal requests for text models by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4926
- refactor(pytorch): replace backend operator builders with typed build specs by @grimoire in https://github.com/InternLM/lmdeploy/pull/4890
- Migrate TurboMind to C++20 by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4946
- feat(pytorch): add piecewise CUDA graph prefill by @grimoire in https://github.com/InternLM/lmdeploy/pull/4895
- feat: add XTuner TileLang sparse MLA backend by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4904
- feat: add request-only cache usage metric by @grimoire in https://github.com/InternLM/lmdeploy/pull/4940
- refactor: stream tool parameters incrementally by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4802
- feat: support checkpoint-engine weight updates by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4913
- feat: add symmetric-memory LM-head all-gather by @qescccczmr in https://github.com/InternLM/lmdeploy/pull/4915
- Refactor PyTorch scheduler ownership and API boundaries by @grimoire in https://github.com/InternLM/lmdeploy/pull/4921
- feat(gpt-oss): combine xgrammar structural_tag grammar with Harmony parser by @windreamer in https://github.com/InternLM/lmdeploy/pull/4907
- Decouple GEMM workspace from Linear handle by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4978
- feat(kv_connector): mooncake store support mtp by @caikun-pjlab in https://github.com/InternLM/lmdeploy/pull/4948
- fix(pytorch): avoid health RPC scheduling delay by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4966
- refactor: remove legacy OpenAI API client by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4993
🐞 Bug fixes
- fix: fall back to model generation config by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4929
- fix: initialize MLA KV-B after online FP8 quantization by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4925
- fix tool_choice='required' by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4909
- fix: exclude glm-5.2 mtp projection from online fp8 by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4945
- Fix TurboMind vision workspace overflows by @irexyc in https://github.com/InternLM/lmdeploy/pull/4924
- fix(proxy): interpolate node_url in the terminate_node failure response by @Anai-Guo in https://github.com/InternLM/lmdeploy/pull/4941
- fix(disagg): make zmq_disconnect synchronous so p2p_drop_connect actually closes the sockets by @Anai-Guo in https://github.com/InternLM/lmdeploy/pull/4916
- Remove cuBLAS grouped GEMM and give cuBLAS dense priority over native BF16/FP16 kernels by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4975
- fix(internvit): allocate pin
- v0.17.02026-09-01 · 2026-09-01 07:13 UTC
查看更新说明
What's Changed
🚀 Features
- Integrate DeepEPv2 by @irexyc in https://github.com/InternLM/lmdeploy/pull/4783
- feat(pytorch): support Kimi K2.6 by @qescccczmr in https://github.com/InternLM/lmdeploy/pull/4846
- feat(kv_connector): support mooncake store by @caikun-pjlab in https://github.com/InternLM/lmdeploy/pull/4903
💥 Improvements
- feat(chat-completions): server-side fan-out for n>1 choices by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4841
- perf: further optimize GLM-5.2 serving by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4853
- perf(cuda): use PDL for paged attention and V4 prefill by @grimoire in https://github.com/InternLM/lmdeploy/pull/4861
- [ascend] update attn op_backend by @wanfengcxz in https://github.com/InternLM/lmdeploy/pull/4900
- perf(pytorch): optimize compact blocked FP8 MoE and route preparation by @grimoire in https://github.com/InternLM/lmdeploy/pull/4857
- perf(pytorch): reduce speculative decoding pre/post-processing overhead by @grimoire in https://github.com/InternLM/lmdeploy/pull/4877
- support page size that are not power of two by @irexyc in https://github.com/InternLM/lmdeploy/pull/4854
- feat: support structural_tag response_format for turbomind and pytorch engines by @windreamer in https://github.com/InternLM/lmdeploy/pull/4906
🐞 Bug fixes
- fix(turbomind): restore FP8 weight-only fallback on pre-sm90 GPUs by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4871
- fix(vl): raise a clear error on malformed data URLs by @SuperMarioYL in https://github.com/InternLM/lmdeploy/pull/4837
- fix(api): fix reponses interface by @caikun-pjlab in https://github.com/InternLM/lmdeploy/pull/4893
- Fix/dsv4 native transformers warmup by @grimoire in https://github.com/InternLM/lmdeploy/pull/4878
- fix: support inline system messages in Anthropic API by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4882
- fix: bound DSA prefill score memory by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4896
- fix(build): correct GEMM kernel archive link order by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4910
- fix: reject unavailable GLM tool calls by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4901
- fix(pytorch): avoid Triton miscompile in paged attention reduction by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4920
- fix Intern-S2-Preview-FP8 convert by @irexyc in https://github.com/InternLM/lmdeploy/pull/4923
🌐 Other
- [Fix] Validate cross-file Markdown link targets by @JimmyWang0417 in https://github.com/InternLM/lmdeploy/pull/4868
- Update README to Reflect EuroSys 2027 Paper Acceptance by @Youhe-Jiang in https://github.com/InternLM/lmdeploy/pull/4891
- docs: fix grammar in README by @MarkHe1222 in https://github.com/InternLM/lmdeploy/pull/4866
- improve(autotest): trim unused model configs and gate routed_experts on yaml by @littlegy in https://github.com/InternLM/lmdeploy/pull/4885
- build: remove flashinfer from CUDA runtime requirements by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4902
- [ci] add base api eval test workflow by @zhulinJulia24 in https://github.com/InternLM/lmdeploy/pull/4874
- bump version to v0.17.0 by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4914
New Contributors
- @JimmyWang0417 made their first contribution in https://github.com/InternLM/lmdeploy/pull/4868
- @Youhe-Jiang made their first contribution in https://github.com/InternLM/lmdeploy/pull/4891
- @MarkHe1222 made their first contribution in https://github.com/InternLM/lmdeploy/pull/4866
- @qescccczmr made their first contribution in https://github.com/InternLM/lmdeploy/pull/4846
Full Changelog: https://github.com/InternLM/lmdeploy/compare/v0.16.0...v0.17.0
- v0.16.02026-08-19 · 2026-08-19 04:43 UTC
查看更新说明
What's Changed
🚀 Features
- Support Interns2 mobius by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4816
- feat: support GLM-5.2 by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4737
- Intern-S2-Mobius meta-MoE support, MoE gate v2, CP attention fixes by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4835
- Add TurboMind ViT support for InternVL and Qwen VL models by @irexyc in https://github.com/InternLM/lmdeploy/pull/4719
- feat: add Hy3 support, MTP, and FP8 optimizations by @yidingcheng0206 in https://github.com/InternLM/lmdeploy/pull/4815
💥 Improvements
- refactor: report cache usage directly by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4798
- SM90 native BF16/FP8 GEMM kernels, fused-SiLU quantization, and linear test harness by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4795
- refactor: split api server endpoints by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4797
- refactor(pytorch): derive CUDA step metadata from selected operators by @grimoire in https://github.com/InternLM/lmdeploy/pull/4805
- optimize and modularize SSM prefix caching by @grimoire in https://github.com/InternLM/lmdeploy/pull/4788
- perf(guided-decoding): optimize with async D2H copy and xgrammar v0.2.1 by @windreamer in https://github.com/InternLM/lmdeploy/pull/4605
- refactor(serve): split chat_completions endpoint into a package by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4840
- feat(chat-completions): add usage.completion_tokens_details by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4842
- feat(pytorch): add optimized Gluon blocked FP8 GEMM for Hopper by @grimoire in https://github.com/InternLM/lmdeploy/pull/4830
- perf(pytorch): add opt-in torch.compile for decode CUDA graphs by @grimoire in https://github.com/InternLM/lmdeploy/pull/4808
- Ssm prefix cache non aligned by @grimoire in https://github.com/InternLM/lmdeploy/pull/4799
- perf: optimize GLM-5.2 serving by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4827
- refactor: separate request preprocessing from generation by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4856
🐞 Bug fixes
- [Bugfix] Fix PyTorch H2D input lifetime across CUDA streams by @grimoire in https://github.com/InternLM/lmdeploy/pull/4792
- fix(serve): reject empty/falsy prompt input in format_prompts and AsyncEngine.generate by @SuperMarioYL in https://github.com/InternLM/lmdeploy/pull/4803
- Fix ray mp duplicate output by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4833
- fix(turbomind): dispatch cuMemcpyBatchAsync by CUDA runtime version by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4838
- fix(disagg): use JSON instead of pickle for P2P ZMQ requests (#4804) by @Anai-Guo in https://github.com/InternLM/lmdeploy/pull/4812
- fix(serve): emit signatures for Anthropic thinking blocks by @matrix72c in https://github.com/InternLM/lmdeploy/pull/4851
- Fix int4 KV cache quantization range when the packed head width is not a power of two by @truong-v in https://github.com/InternLM/lmdeploy/pull/4850
- fix: harden serving request validation by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4872
- fix: fix allgather/allgather2d for cuda-ipc when byte_width is not multiple of uint by @irexyc in https://github.com/InternLM/lmdeploy/pull/4873
📚 Documentations
- docs: update recent model support by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4855
- docs,tests: cover Qwen3.8 preserve_thinking support by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4869
🌐 Other
- docs: remove non-existent
--enable-metricsflag from metrics/spec_decoding guides by @latent-9 in https://github.com/InternLM/lmdeploy/pull/4809 - Upgrade to cu130 by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4753
- TEST: update turbomind qwen3.5 con
- v0.15.02026-07-31 · 2026-07-31 13:00 UTC
查看更新说明
What's Changed
🚀 Features
- Support long-context and MTP prefix-cache hits by @grimoire in https://github.com/InternLM/lmdeploy/pull/4688
- [Feature] Add guided decoding support for speculative decoding by @windreamer in https://github.com/InternLM/lmdeploy/pull/4559
- feat(turbomind): memory allocator, object cache, and scheduler integration by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4717
- feat: add AgRs all2all backend by @irexyc in https://github.com/InternLM/lmdeploy/pull/4739
- DeepSeek V4 support by @grimoire in https://github.com/InternLM/lmdeploy/pull/4554
- Support memdecode by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4767
💥 Improvements
- Force blksize=128 for linear attention on ascend by @jinminxi104 in https://github.com/InternLM/lmdeploy/pull/4705
- refactor: unify interleaved MRoPE rotary embedding by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4644
- Refine multi-node support on ascend-A3 by @jinminxi104 in https://github.com/InternLM/lmdeploy/pull/4711
- [Improve]: Remove dlblas from lmdeploy by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4682
- replace sync with wait event in h2d by @grimoire in https://github.com/InternLM/lmdeploy/pull/4709
- Respect --server-port in DP mode when proxy-url is set by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4712
- add --language-model-only for text-only VLM inference and remove --disable-vision-encoder by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4716
- Optimize TTFT by @grimoire in https://github.com/InternLM/lmdeploy/pull/4695
- Optimize BaseResponseParser streaming and add parser benchmark by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4697
- Support fp8 moe only for qwen3.5 by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4740
- clear runtime state in sleep by @grimoire in https://github.com/InternLM/lmdeploy/pull/4729
- feat(serve): add --generation-config CLI for server sampling defaults by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4708
- fix: gzip torch profiler traces by default by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4747
- Optimize tp fp8 moe for small average router per expert by @grimoire in https://github.com/InternLM/lmdeploy/pull/4751
- refactor(pytorch): clarify scheduler and input-maker control flow by @grimoire in https://github.com/InternLM/lmdeploy/pull/4727
- Guard DP dummy inputs around pending work by @grimoire in https://github.com/InternLM/lmdeploy/pull/4738
- Remove interactive chat and make inference stateless by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4730
- feat(turbomind): Derive composable TurboMind parallel configurations by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4769
- Add generic tensor copy and architecture-aware Gated Delta Rule support by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4757
- Add GDR CP controls and legacy kernel override by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4779
- fix(turbomind): fix zero-centered RMSNorm for Qwen3.5 by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4790
🐞 Bug fixes
- fix prefix caching by @grimoire in https://github.com/InternLM/lmdeploy/pull/4700
- fix
_reduce_split_kernelfor triton 3.5.1 by @irexyc in https://github.com/InternLM/lmdeploy/pull/4696 - fix triton fp8 all_reduce group by @grimoire in https://github.com/InternLM/lmdeploy/pull/4702
- fix(serve): use unique chatcmpl id for chat completions responses by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4707
- [Bugfix] Fix ImportError in get_chat_template for builtin chat-template names by @waynehacking8 in https://github.com/InternLM/lmdeploy/pull/4690
- [Bugfix] Fix InternVL/InternVL3 LoRA loading TypeError in adapter fallback by @waynehacking8 in https://github.com/InternLM/lmdeploy/pull/4684
- v0.14.02026-06-24 · 2026-06-24 04:36 UTC
查看更新说明
What's Changed
🚀 Features
- FP8 kv cache quantization by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4563
- Support Qwen3 Omni by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4411
- support qwen3.5(vit) inference in turbomind backend by @irexyc in https://github.com/InternLM/lmdeploy/pull/4602
- Add OpenAI Responses-compatible endpoint by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4582
- Add /get_ppl endpoint by @irexyc in https://github.com/InternLM/lmdeploy/pull/4679
💥 Improvements
- Update turbomind modeling infrastructure by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4557
- refactor(turbomind): consolidate CUDA error handling and add manual stacktracing by @lzhangzz in https://github.com/InternLM/lmdeploy/pull/4565
- Add Qwen3.5 Moe lite awq by @43758726 in https://github.com/InternLM/lmdeploy/pull/4561
- [Improve]: Drain queues when sleep engine by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4577
- Extend chat completions by introducing token-in/out and returning routed experts by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4593
- Follow openai's spec to add "AllowedToolChoice" and report 400 when parsing request failed by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4585
- Improve health endpoint by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4615
- Remove state init by @grimoire in https://github.com/InternLM/lmdeploy/pull/4604
- Include spec stats in metrics by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4625
- Add raw chat completion logprob output by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4637
- fix(pytorch): offload guided decoding CPU ops to thread pool to prevent event loop blocking by @windreamer in https://github.com/InternLM/lmdeploy/pull/4590
- update gated delta rule state layout by @grimoire in https://github.com/InternLM/lmdeploy/pull/4636
- Improve kernel dispatch for dp>1 by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4653
- Extend v1/messages by introducing token-in/out and returning routed experts by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4642
- Fuse gdr preprocess by @grimoire in https://github.com/InternLM/lmdeploy/pull/4656
- refactor: simplify multimodal preprocessing expansion by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4663
- feat: configure cudagraph capture batch sizes by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4573
- Refactor prefix caching for pytorch engine by @grimoire in https://github.com/InternLM/lmdeploy/pull/4618
- Pading one more block for fa3 prefill by @RunningLeon in https://github.com/InternLM/lmdeploy/pull/4674
- Add usage.prompt_tokens_details.cached_tokens for prefix caching by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4670
- Optimize XML tool parsers with incremental streaming and fast-path buffering by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4664
🐞 Bug fixes
- fix the anthropic adapter by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4578
- Fix Structured Output for GPT-OSS Models by @windreamer in https://github.com/InternLM/lmdeploy/pull/4386
- Allow W8A8Linear to accept dtype during initialization instead of hard code by @43758726 in https://github.com/InternLM/lmdeploy/pull/4586
- fix: compact split multimodal tensors by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4583
- Fix legacy VLM preprocessors for normalized image data by @CUHKSZzxy in https://github.com/InternLM/lmdeploy/pull/4584
- fix dockerfile which missing common.txt by @lvhan028 in https://github.com/InternLM/lmdeploy/pull/4608
- fix: enable FA3 for SM80+ GPUs and fix CUDA version comparison by @windreamer in https://github.com/InternLM/lmdeploy/pull/4591
- flatten_kv_cache zero padding by @grimoire in https://github.com/InternLM/lmdeploy/pu
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
📘Documentation | 🛠️Quick Start | 🤔Reporting Issues
Latest News 🎉
- [2026/08] Our paper, “LMDeploy Accelerates Mixed-Precision LLM Inference with TurboMind,” has been accepted to EuroSys 2027.
- [2026/04] PyPI has expanded the storage quota for LMDeploy and wheel uploads have resumed.
v0.12.3is now available on PyPI, so you can install it directly viapip install lmdeploy. - [2026/02] Support Qwen3.5
- [2026/02] Support vllm-project/llm-compressor 4bit symmetric/asymmetric quantization. Refer here for a detailed guide
- [2025/09] TurboMind supports MXFP4 on NVIDIA GPUs starting from V100, achieving 1.5x the performance of vLLM on H800 for openai gpt-oss models!
- [2025/06] Comprehensive inference optimization for FP8 MoE Models
- [2025/06] DeepSeek PD Disaggregation deployment is now supported through integration with DLSlime and Mooncake. Huge thanks to both teams!
- [2025/04] Enhance DeepSeek inference performance by integrating deepseek-ai techniques: FlashMLA, DeepGemm, DeepEP, MicroBatch and eplb
- [2025/01] Support DeepSeek V3 and R1
- [2024/11] Support Mono-InternVL with PyTorch engine
- [2024/10] PyTorchEngine supports graph mode on ascend platform, doubling the inference speed
- [2024/09] LMDeploy PyTorchEngine adds support for Huawei Ascend. See supported models here
- [2024/09] LMDeploy PyTorchEngine achieves 1.3x faster on Llama3-8B inference by introducing CUDA graph
- [2024/08] LMDeploy is integrated into modelscope/swift as the default accelerator for VLMs inference
- [2024/07] Support Llama3.1 8B, 70B and its TOOLS CALLING
- [2024/07] Support InternVL2 full-series models, InternLM-XComposer2.5 and function call of InternLM2.5
- [2024/06] PyTorch engine support DeepSeek-V2 and several VLMs, such as CogVLM2, Mini-InternVL, LlaVA-Next
- [2024/05] Balance vision model when deploying VLMs with multiple GPUs
- [2024/05] Support 4-bit weight-only quantization and inference on VLMs, such as InternVL v1.5, LLaVa, InternLMXComposer2
- [2024/04] Support Llama3 and more VLMs, such as InternVL v1.1, v1.2, MiniGemini, InternLMXComposer2.
- [2024/04] TurboMind adds online int8/int4 KV cache quantization and inference for all supported devices. Refer here for detailed guide
- [2024/04] TurboMind latest upgrade boosts GQA, rocketing the internlm2-20b model inference to 16+ RPS, about 1.8x faster than vLLM.
- [2024/04] Support Qwen1.5-MOE and dbrx.
- [2024/03] Support DeepSeek-VL offline inference pipeline and serving.
- [2024/03] Support VLM offline inference pipeline and serving.
- [2024/02] Support Qwen 1.5, Gemma, Mistral, Mixtral, Deepseek-MOE and so on.
- [2024/01] OpenAOE seamless integration with LMDeploy Serving Service.
- [2024/01] Support for multi-model, multi-machine, multi-card inference services. For usage instructions, please refer to here
- [2024/01] Support PyTorch inference engine, developed entirely in Python, helping to lower the barriers for developers and enable rapid experimentation with new features and technologies.
- [2023/12] Turbomind supports multimodal input.
- [2023/11] Turbomind supports loading hf model directly. Click here for details.
- [2023/11] TurboMind major upgrades, including: Paged Attention, faster attention kernels without sequence length limitation, 2x faster KV8 kernels, Split-K decoding (Flash Decoding), and W4A16 inference for sm_75
- [2023/09] TurboMind supports Qwen-14B
- [2023/09] TurboMind supports InternLM-20B
- [2023/09] TurboMind supports all features of Code Llama: code completion, infilling, chat / instruct, and python specialist. Click here for deployment guide
- [2023/09] TurboMind supports Baichuan2-7B
- [2023/08] TurboMind supports flash-attention2.
- [2023/08] TurboMind supports Qwen-7B, dynamic NTK-RoPE scaling and dynamic logN scaling
- [2023/08] TurboMind supports Windows (tp=1)
- [2023/08] TurboMind supports 4-bit inference, 2.4x faster than FP16, the fastest open-source implementation. Check this guide for detailed info
- [2023/08] LMDeploy has launched on the HuggingFace Hub, providing ready-to-use 4-bit models.
- [2023/08] LMDeploy supports 4-bit quantization using the AWQ algorithm.
- [2023/07] TurboMind supports Llama-2 70B with GQA.
- [2023/07] TurboMind supports Llama-2 7B/13B.
- [2023/07] TurboMind supports tensor-parallel inference of InternLM.
Introduction
LMDeploy is a toolkit for compressing, deploying, and serving LLM, developed by the MMRazor and MMDeploy teams. It has the following core features:
-
Efficient Inference: LMDeploy delivers up to 1.8x higher request throughput than vLLM, by introducing key features like persistent batch(a.k.a. continuous batching), blocked KV cache, dynamic split&fuse, tensor parallelism, high-performance CUDA kernels and so on.
-
Effective Quantization: LMDeploy supports weight-only and k/v quantization, and the 4-bit inference performance is 2.4x higher than FP16. The quantization quality has been confirmed via OpenCompass evaluation.
-
Effortless Distribution Server: Leveraging the request distribution service, LMDeploy facilitates an easy and efficient deployment of multi-model services across multiple machines and cards.
-
Excellent Compatibility: LMDeploy supports KV Cache Quant, AWQ and Automatic Prefix Caching to be used simultaneously.
Performance
Supported Models
LMDeploy has developed two inference engines - TurboMind and PyTorch, each with a different focus. The former strives for ultimate optimization of inference performance, while the latter, developed purely in Python, aims to decrease the barriers for developers.
They differ in the types of supported models and the inference data type. Please refer to this table for each engine's capability and choose the proper one that best fits your actual needs.
Quick Start 
Installation
It is recommended to install lmdeploy using pip in a conda environment (python 3.10 - 3.13):
conda create -n lmdeploy python=3.12 -y
conda activate lmdeploy
pip install lmdeploy
Starting from v0.13.0, the default prebuilt wheels published on PyPI are built against CUDA 12.8, so pip install lmdeploy is sufficient for typical setups including GeForce RTX 50 series.
Offline Batch Inference
import lmdeploy
with lmdeploy.pipeline("internlm/internlm3-8b-instruct") as pipe:
response = pipe(["Hi, pls intro yourself", "Shanghai is"])
print(response)
[!NOTE] By default, LMDeploy downloads model from HuggingFace. If you would like to use models from ModelScope, please install ModelScope by
pip install modelscopeand set the environment variable:
export LMDEPLOY_USE_MODELSCOPE=TrueIf you would like to use models from openMind Hub, please install openMind Hub by
pip install openmind_huband set the environment variable:
export LMDEPLOY_USE_OPENMIND_HUB=True
For more information about inference pipeline, please refer to here.
Tutorials
Please review getting_started section for the basic usage of LMDeploy.
For detailed user guides and advanced guides, please refer to our tutorials:
- User Guide
- Advanced Guide
Third-party projects
-
Deploying LLMs offline on the NVIDIA Jetson platform by LMDeploy: LMDeploy-Jetson
-
Example project for deploying LLMs using LMDeploy and BentoML: BentoLMDeploy
Contributing
We appreciate all contributions to LMDeploy. Please refer to CONTRIBUTING.md for the contributing guideline.
Acknowledgement
Citation
@misc{2023lmdeploy,
title={LMDeploy: A Toolkit for Compressing, Deploying, and Serving LLM},
author={LMDeploy Contributors},
howpublished = {\url{https://github.com/InternLM/lmdeploy}},
year={2023}
}
@article{zhang2025lmdeploy,
title={LMDeploy Accelerates Mixed-Precision LLM Inference with TurboMind},
author={Zhang, Li and Jiang, Youhe and He, Guoliang and Chen, Xin and Lv, Han and Yao, Qian and Ma, Ningsheng and Fu, Fangcheng and Chen, Kai},
journal={arXiv preprint arXiv:2508.15601},
year={2025}
}
License
This project is released under the Apache 2.0 license.