Install
openclaw skills install @huaweicloudskill/huawei-cloud-msmodelslim-model-analysisAnalyze candidate models before adapter implementation. Determine model implementation source (transformers or model-local), structural features, layer-by-layer loading requirements, and MoE fused weight risks. Use this skill when the user wants to assess model adaptation feasibility before creating msModelSlim adapters, analyze model structure and type classification, or evaluate MoE compatibility for quantization. Triggers include: "model analysis", "msModelSlim", "adapter", "transformers", "MoE", "layer-by-layer", "model assessment", "feasibility", "模型分析", "适配可行性", "模型评估", "MoE分析"
openclaw skills install @huaweicloudskill/huawei-cloud-msmodelslim-model-analysisThis skill analyzes candidate models before adapter implementation for msModelSlim.
Architecture: Implementation Source Detection → Model Type Classification → Structural Feature Analysis → Risk Assessment
Related Skills:
huawei-cloud-msmodelslim-model-adapt - Adapter creation based on analysis
resultsThis skill involves the following cloud services and components:
Architecture Diagram:
┌─────────────────────────────────────────────────────────────┐
│ msModelSlim Model Analysis Skill │
├─────────────────────────────────────────────────────────────┤
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Model │───▶│ Source │───▶│ Structure │ │
│ │ Input │ │ Detection │ │ Analysis │ │
│ │ (config) │ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Type │ │ MoE │ │ Risk │ │
│ │ Classification│ │ Assessment │ │ Assessment │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
Typical Problem Scenarios:
Typical User Phrases:
Supported:
Not supported:
Model path or model repository identifier
config.json
Optional: modeling_*.py, model.safetensors.index.json in the model
directory
If files are missing locally:
modelscope download --model <org>/<model> --local_dir ./models/<name> --exclude '*.safetensors'config.json and modeling_*.py from the download directory as input
for analysis.Must complete before any structural analysis. Agent should manually parse following these steps:
Read config.json:
model_typeauto_map (if present)Try parsing from transformers:
transformers library supports the model_type.transformers/models/<model_type>/modeling_<model_type>.py.transformers implementation.If not parsed, try model-local implementation:
auto_map exist in the model directory.modeling_*.py files exist in the model directory.model-local implementation.If neither path available:
Parse implementation source (complete hard requirement above).
Determine model type, structural differences, and connections:
Identify structural features:
Determine features affecting adaptation:
Output structured analysis results (refer to template below).
Provide next steps:
(relative to common Qwen2)
gate/up/down linear layers).gate/up/down stored in [..., num_experts, ...] or
[num_experts, ...] form, treat as "fused".MoE fused, with "may need unpack"
marked in report.Agent should directly generate analysis report (Markdown format), must include following elements. Refer to template below:
# Analysis Report
## Model Identification
- Model Path/Repository: {model_path}
- `model_type`: {model_type}
- `architectures`: {architectures}
## Implementation Source Analysis
- Result: `transformers` | `model-local` | `unsupported`
- Basis:
- Resolved file path: {path}
- Related configuration fields (`model_type`, `auto_map`): {details}
## Model Features and Specifications
- Hidden size: {hidden_size}
- Number of layers: {num_layers}
- Attention heads / KV heads: {num_heads} / {num_kv_heads}
- Analyze only VLM text portion: Yes/No
## Model Type, Structural Differences and Connections
- Model type: Pure LLM | Multimodal understanding | Multimodal generation
- Special structures vs common Qwen2: {special_structures}
- Special structure connections: {special_structure_connections}
- Impact on adaptation workflow: {structure_impact}
## Layer-by-Layer Loading Assessment
- Need layer-by-layer loading: Yes/No
- Reason: {reason}
- Constraints (memory/runtime environment): {constraints}
## MoE Assessment
- Contains MoE: Yes/No
- Layout type: No MoE | Non-fused MoE | Fused MoE
- Suspected fused keys/modules: {keys}
- Expert weight form: Independent linear layers | Packaged tensors
- Needs unpack: Yes/No
## Adaptation Impact Points
- Decoder traversal path: {traversal_path}
- Attention module naming: {attn_module}
- MLP module naming: {mlp_module}
- `visit/forward` strict alignment points: {alignment_points}
## Quantization and MTP Risk Assessment
- Model already quantized: Yes/No
- Quantization determination basis: {quant_evidence}
- Dequantization script provided: Yes/No
- Dequantization script status: {dequant_status}
- MTP structure exists: Yes/No
- MTP implementation code accessibility: Accessible/Not accessible
- MTP risk description: {mtp_risk}
## Risks and Next Steps
- Risk level: Low | Medium | High
- Blockers: {blockers}
- Recommended next steps:
- Proceed to adapter creation workflow
- Or request user to provide implementation code
If identified as "model already quantized", must mark "missing dequantization script" as blocker, explicitly requiring user to actively provide dequantization script before continuing adaptation.
If MTP structure identified but implementation code inaccessible, must explicitly inform:
When at least one of above two risk types hits, risk level must not be
lower than "Medium".
transformers or model-local, model
type is pure LLM or multimodal understanding, and report is complete; if
quantization/MTP risks hit, clear user action requirements given in report.This skill ships an automated analysis script
(scripts/analyze_model.py) that runs the SKILL.md analysis flow against a
local model directory and produces a Markdown report:
python3 scripts/analyze_model.py --model-path <model_dir> --cli-region <region> [--output report.md] [--verbose]
Features:
config.json and reports whether
the model is transformers-supported, model-local, or unsupportedhidden_size, number of layers,
attention / KV heads, and MoE indicators from configThe report generated follows the analysis report template in the "Required
Output" section above and must be interpreted together with the agent manual
analysis steps (analysis-checklist.md). The script output is a structured
starting point, not a replacement for code-level inspection of modeling_*.py.
The analysis workflow follows these steps:
config.json)The skill does not call cloud APIs; model analysis is performed on local model files. Two equivalent execution paths are supported:
python3 scripts/analyze_model.py --model-path <model_dir> --cli-region <region> [--output <report.md>] [--verbose]
Produces a Markdown report following the "Required Output" template.
Follow the "Hard Requirement: Parse Implementation Source First" and "Minimum
Workflow" sections above; use references/analysis-checklist.md to verify each
step. Read config.json, modeling_*.py, and safetensors metadata from the
local model directory.
modelscope download --model <org>/<model> --local_dir ./models/<name> --exclude '*.safetensors'
For the automated analysis script:
| Parameter | Description | Required |
|---|---|---|
--model-path | Local model directory containing config.json | Yes |
--cli-region | Region context for the downstream msModelSlim adapter workflow, e.g. cn-north-4 (default cn-north-4) | No |
--output | Analysis report output path | No |
--verbose | Print extra progress information | No |
For the manual workflow, the required input is the model path or repository
identifier plus its config.json (and optionally modeling_*.py /
model.safetensors.index.json).