model-deployment
Guides LazyLLM model modules, online providers, local serving, fine-tuning, multimodal examples, and backend-aware deployment diagnostics.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-deployment
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides LazyLLM model modules, online providers, local serving, fine-tuning, multimodal examples, and backend-aware deployment diagnostics.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/backend-matrix.md2.7 KB
- 参考文档references/model-workflows.md3.7 KB
- 参考文档references/troubleshooting.md2.4 KB
- 脚本scripts/model_surface_smoke.py2.8 KB
03 SKILL.md 正文
LazyLLM Model Deployment
Use this sub-skill for LazyLLM tasks about TrainableModule, OnlineModule, OnlineChatModule, ServerModule, ActionModule, model type mapping, model deployment, fine-tuning, distillation, local serving, provider calls, streaming tool calls, or multimodal examples.
Start here when
- The user asks how to wrap a local model or online provider in LazyLLM.
- The task mentions
lazyllm deploy, vLLM, LMDeploy, LightLLM, Infinity, LLaMA-Factory, model caches, CUDA, or serving ports. - A provider/chat module fails due to model type, API key, timeout, message inspection, streaming tool calls, or provider response format.
- The user wants to adapt chatbot, online chatbot, multimodal, painting, TTS, STT, OCR, fine-tuning, or distillation examples.
Files to read
- model-workflows.md for class selection, online/local/multimodal recipes, and safe provider-free checks.
- backend-matrix.md for optional dependency and backend classification.
- troubleshooting.md for provider, CUDA, model path, and serving failures.
- scripts/model_surface_smoke.py for a no-network check of model type inference and online chat message utilities.
Safe workflow
- Classify the module type.
OnlineModule/OnlineChatModule: provider or endpoint backed.TrainableModule: local model/fine-tune/deploy abstraction.ServerModule: wraps functions/modules/services and may start/bind servers.ActionModule: wraps deterministic actions in a LazyLLM module chain.
- Classify backend requirements. Do not run a model call until provider credentials or local model/GPU/backend are confirmed.
- Perform no-network checks first.
python scripts/model_surface_smoke.py python ../../scripts/inspect_lazyllm_surface.py --include-optional - Route composed apps to their owner. If model modules are only nodes inside a
pipeline, read flow-orchestration. If they serve RAG or agents, read the RAG or agent sub-skill too. - Record optional verification clearly. Online/GPU/model-download tests are optional unless the user explicitly asks to execute them and supplies resources.
Verified signatures to remember
TrainableModule(base_model='', target_path='', *, stream=False, return_trace=False, trust_remote_code=True, type=None, source=None, use_model_map=True)OnlineModule(model=None, source=None, *, type=None, url=None, **kwargs)OnlineChatModule(model=None, source=None, url=None, stream=True, return_trace=False, skip_auth=False, type=None, api_key=None, static_params=None, id=None, name=None, group_id=None, dynamic_auth=False, timeout=180, **kwargs)ServerModule(m=None, pre=None, post=None, stream=False, return_trace=False, port=None, pythonpath=None, launcher=None, url=None, num_replicas=1, security_key=None)ActionModule(*action, return_trace=False)
Model type and streaming facts
LazyLLM has provider model-name mapping helpers that classify names into categories including llm, vlm, stt, tts, embed, sd, text2video, and cross_modal_embed. Tests also verify online chat helper behavior that removes prior tool traces and merges streamed tool-call chunks by index.
Use these pure helpers to debug provider message formatting without calling the provider.
Backend boundaries
- Safe CPU checks: signature inspection, model type mapping, chat history sanitization, stream chunk merge utility.
- Provider-required: online chat/completion, online multimodal, web-search-backed flows, writer pipeline with cloud LLM.
- GPU/local backend: vLLM/LMDeploy/LightLLM, local TrainableModule inference, fine-tuning, distillation, painting, speech, OCR.
- External service: deployed server endpoints, k8s/slurm/SCO launcher tests.
Handoff outputs
When you finish a model-deployment task, leave:
- chosen LazyLLM module class and constructor parameters,
- exact optional extra/backend/provider requirements,
- safe smoke result or reason it was not executable,
- explicit status of credentials, model path/cache, GPU, server port, and budget,
- routes to flow/RAG/agent/writer sub-skills for composed apps.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).