Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
lmdeploy【部署与运维】Use LMDeploy to run offline LLM/VLM inference, serve OpenAI-compatible APIs, quantize models, tune PyTorch/TurboMind backends, and extend model support.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a task mentions LMDeploy, lmdeploy.pipeline, lmdeploy serve, lmdeploy lite, TurboMind, PyTorchEngine, VLM media prompts, OpenAI-compatible model serving, or adding support for a new LMDeploy model/backend.
references/repo-provenance.md when checking whether this skill matches a current LMDeploy checkout.references/model-and-backend-overview.md when choosing between TurboMind, PyTorch, serving, VLM, quantization, or model-extension routes.references/troubleshooting.md for install/import, CUDA/TurboMind, optional dependency, and runtime triage shared across workflows.python scripts/check_lmdeploy_environment.py --include-cli for a no-model diagnostic of imports, package version, CLI help, torch/CUDA visibility, and optional dependency gaps.For normal use, prefer a packaged install in an isolated Python environment:
pip install lmdeploy
python - <<'PY'
import lmdeploy
from lmdeploy import GenerationConfig, PytorchEngineConfig, TurbomindEngineConfig, pipeline
print(lmdeploy.__version__)
print(GenerationConfig(max_new_tokens=1))
print(PytorchEngineConfig.__name__, TurbomindEngineConfig.__name__, pipeline)
PY
For source checkouts, DISABLE_TURBOMIND=1 pip install -e . avoids compiling the TurboMind extension when the task only needs Python API inspection or PyTorch backend work. Full TurboMind source builds need CUDA/toolchain compatibility; see backend-extension and root troubleshooting before rebuilding.
| User task | Read |
|---|---|
Use lmdeploy.pipeline, Pipeline.infer, streaming, chat sessions, GenerationConfig, chat templates, LoRA adapters, lmdeploy chat | sub-skills/pipeline-inference/SKILL.md |
Launch lmdeploy serve api_server, proxy multiple servers, call OpenAI/Responses/Anthropic endpoints, configure Codex or Claude Code clients | sub-skills/serving-apis/SKILL.md |
Build VLM prompts with images/video/audio/time-series, load_image, OpenAI multimodal content blocks, VisionConfig, media URL/base64 checks | sub-skills/vision-language/SKILL.md |
Plan AWQ/GPTQ/SmoothQuant/KV quantization, lmdeploy lite commands, Qwen3 recipes, quantized artifact handoff | sub-skills/quantization/SKILL.md |
Tune PyTorch/TurboMind backend config, debug _turbomind/NCCL/CUDA issues, inspect module maps, add new PyTorch model support | sub-skills/backend-extension/SKILL.md |
cache_max_entry_count, session_len, batch size, or tensor parallel assumptions before treating OOM as a model bug.--model-name explicitly when downstream clients need a stable ID; use --api-keys and matching Authorization: Bearer ... headers when authentication is enabled.vision-language; server/client transport still belongs to serving-apis.quantization, then route offline loading to pipeline-inference or service loading to serving-apis.python scripts/check_lmdeploy_environment.py --include-cli for package and CLI sanity.python sub-skills/quantization/scripts/plan_quantization_command.py --help.--help for the exact workflow (lmdeploy chat --help, lmdeploy serve api_server --help, or lmdeploy lite auto_awq --help).