writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
pipeline-inferenceUse LMDeploy pipeline APIs and chat CLI for offline text LLM inference, streaming, sessions, generation settings, backend configs, and chat templates.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is offline text LLM inference through lmdeploy.pipeline, Pipeline, or lmdeploy chat.
references/api-reference.md for exact constructors, methods, response fields, and config defaults.references/workflows.md for copy-ready offline inference patterns, batch prompts, streaming, sessions, LoRA, logits, hidden states, and PPL.references/chat-templates.md for JSON chat templates, Python registration, prompt-format mismatch diagnosis, and safe inspection.references/troubleshooting.md for OOM, multiprocessing, missing TurboMind extension, stop-token, model download, and trust boundary failures.scripts/inspect_pipeline_config.py for no-download inspection of installed API signatures, dataclass defaults, chat-template registry names, and CLI availability.Own these tasks:
from lmdeploy import pipeline and TurbomindEngineConfig or PytorchEngineConfig.GenerationConfig, cache_max_entry_count, tp, session_len, max_batch_size, LoRA adapters, and chat templates for inference.lmdeploy chat for local interactive text inference and CLI smoke checks.Route elsewhere:
vision-language.serving-apis.lmdeploy lite: quantization.backend-extension.from lmdeploy import GenerationConfig, TurbomindEngineConfig, pipeline
backend_config = TurbomindEngineConfig(cache_max_entry_count=0.6, tp=1)
gen_config = GenerationConfig(max_new_tokens=128, top_p=0.9, temperature=0.7)
with pipeline("org/model-or-local-path", backend_config=backend_config) as pipe:
responses = pipe(["Explain LMDeploy in one sentence.", "List two use cases."], gen_config=gen_config)
for response in responses:
print(response.text)
For PyTorch backend, use PytorchEngineConfig(...). When tp > 1 with PyTorch in a script, wrap pipeline creation in if __name__ == "__main__":.
Use these checks before recommending or shipping an offline pipeline workflow:
python sub-skills/pipeline-inference/scripts/inspect_pipeline_config.py --include-cli
lmdeploy chat --help
These checks do not download a model. Model execution requires the user’s chosen model weights, backend dependencies, GPU/accelerator memory, and any required trust_remote_code decision.