跳到主要内容Skip to main content
本地推理与部署Local Inference & Serving生产可用Production

LMDeploy

InternLM / lmdeploy

高吞吐 LLM 推理与部署工具,提供 TurboMind/PyTorch 引擎、KV 量化、多卡并行和 OpenAI 兼容 API。A high-throughput inference and deployment toolkit with TurboMind and PyTorch engines, KV quantisation, multi-GPU and an OpenAI-compatible API.

8.2k stars 786 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-11-20

为什么选Why choose it

  • 中文模型和国产/多卡环境里,TurboMind + KV 量化常比通用 serving 更容易压显存、提吞吐。Two engines let you trade compatibility for speed.
  • 支持离线批量推理和在线 API 两种形态,方便从评测切到服务。KV-cache quantisation reduces memory.
  • 量化工具链完整,适合做 4-bit 权重与 KV cache 的部署对比。Ships an OpenAI-compatible server.

不适合Not for

只跑单卡小模型玩具;或需要最广泛新模型 day-0 支持的场景,vLLM 更强。Your model architecture is not supported by either engine.
没有 CUDA 环境的纯 CPU 部署。You need a managed cloud endpoint.

最小上手Minimum setup

  1. pip install lmdeploy,确认 CUDA 与 PyTorch 版本。Serve a supported model and run a chat completion.
  2. 用 lmdeploy serve api_server 起一个模型,发一条 chat completion。Measure KV-cache memory with and without quantisation.
  3. 开 KV 量化与多卡,测并发 1/8/32 下的吞吐和首 token 延迟。Compare TurboMind and PyTorch engine throughput.

依赖与成本Dependencies and cost

CUDA 11.8+/12.x;Python;模型权重;多卡需要 NCCL。Check runtime, model weights and external service dependencies in the README.

许可与使用边界License and usage boundaries

代码 Apache-2.0;模型权重另计。Code is Apache-2.0; model weights, training data and generated content may have separate terms — check each before commercial use.

开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

替代与相邻Alternatives and neighbors

  • vLLM — 规模 / 性能Scale / performance,高吞吐推理与服务引擎,PagedAttention、连续批处理、多卡并行。A high-throughput inference and serving engine with PagedAttention, continuous batching and multi-GPU support.
  • SGLang — 规模 / 性能Scale / performance,高性能推理运行时,擅长结构化生成、前缀缓存与多卡服务。A high-performance inference runtime strong at structured generation, prefix caching and multi-GPU serving.
  • TensorRT-LLM — 规模 / 性能Scale / performance,NVIDIA 的 LLM 推理优化栈:自定义 kernel、量化、in-flight batching 与多卡并行,面向生产吞吐。NVIDIA’s LLM inference optimisation stack: custom kernels, quantisation, in-flight batching and multi-GPU for production throughput.

下一步Next steps

  • 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
  • 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.

GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare

快照口径:stars / forks / language / license / pushed_at 来自 GitHub API 2026-11-20 快照;之后的变化没有回写。标签与“适合 / 不适合”是编辑判断,不是 GitHub 元数据。Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
不背书:本站只做索引与风险提示,不审计代码、不保证安全、不替你做许可判断。仓库脚本与模型权重请自行审查。No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.