hub-and-cli
Use ModelScope Hub, cache, download/upload, and CLI workflows safely from the modelscope package.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- hub-and-cli
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use ModelScope Hub, cache, download/upload, and CLI workflows safely from the modelscope package.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/cli-reference.md9.4 KB
- 参考文档references/hub-api-reference.md12.6 KB
- 参考文档references/troubleshooting.md12.7 KB
- 脚本scripts/plan_download.py14.3 KB
03 SKILL.md 正文
ModelScope Hub and CLI
Use this sub-skill when the task is about ModelScope Hub access, the modelscope/ms command line, downloading repositories or files, upload command selection, authentication boundaries, endpoint/cache settings, offline cache reuse, or cache troubleshooting.
Fast routing
- Need CLI command selection, help boundaries, download/cache syntax, or legacy command aliases: read CLI reference.
- Need Python APIs such as
snapshot_download,dataset_snapshot_download,model_file_download,dataset_file_download,HubApi, credentials, endpoint variables, ormodelscope_hubcompatibility behavior: read Hub API reference. - Need to diagnose auth, repo id/revision, endpoint, network, cache, offline, missing
modelscope_hub, orlocal_dir/cache_dirconfusion: read troubleshooting. - Need a safe dry-run plan before downloading: run
python scripts/plan_download.py --help, then use the generated CLI command or Python snippet after approval. The script performs no network calls.
Boundaries and cross-skill routes
- This sub-skill stops at obtaining or managing local Hub files. For pipeline inference after a model download, route to
../pipelines-and-models/SKILL.md. - For
MsDataset.load, dataset streaming, dataset recipe validation, or config/file I/O after a dataset snapshot is available, route to../datasets-config/SKILL.md. - For server/studio deployment details, vLLM integration, export, and large checkpoint tools, route to
../serving-export-and-tools/SKILL.md. - Treat uploads, cache clearing, login persistence, and endpoint changes as operations with external side effects. Ask for explicit user approval before mutating remote Hub repositories, deleting caches, or saving credentials.
Working checklist
- Identify the interface:
modelscope/msCLI, Python download helper, orHubApi. - Confirm repo id shape (
owner/name), repo type (modelordatasetfor most downloads), revision, and whether the target is public or private. - Decide storage semantics: use
local_dirfor a user-visible copy,cache_dir/MODELSCOPE_CACHEfor reusable cache, andlocal_files_only=Trueonly when the cache is already populated. - Avoid exposing tokens. Prefer environment variables and Python
token=parameters over literal tokens in shell history. - For include/exclude filters, quote glob patterns in shell commands and remember that explicit file paths take precedence over patterns.
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).