Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

modelscope-api-skill

modelscope-api-skill 是一个独立维护的 Codex skill 仓库,面向 ModelScope 魔搭社区相关任务。

仓库中的 skill 目录是:

modelscope-api/

这个 skill 主要覆盖三类能力:

  • ModelScope OpenAPI 查询与管理
  • ModelScope SDK / CLI 模型与数据集下载
  • ModelScope Skill 打包、上传、发布与更新

仓库结构

modelscope-api/
  SKILL.md
  agents/
    openai.yaml
  references/
    api-summary.md
    openapi.json
    publishing-skills.md
    sdk-downloads.md
    setup.md
  scripts/
    check_setup.py
    modelscope_api.py
    modelscope_download.py
    package_skill.py

docs/
  model-download-guide.md

tests/
  test_check_setup.py
  test_modelscope_api.py
  test_modelscope_download.py
  test_package_skill.py

这个 skill 解决什么问题

适用场景:

  • 查 ModelScope 模型、数据集、Skill、MCP、Studio 信息
  • 调用 ModelScope OpenAPI
  • 下载模型或数据集资源
  • 打包并上传 ModelScope Skill
  • 更新已发布的 ModelScope Skill
  • 检查本机是否已配置 token 和 modelscope CLI

不适用场景:

  • 直接替代 Hugging Face 全部工作流
  • 处理训练、推理、微调本身
  • 管理业务项目中的私有 token 存储

快速使用

1. 配置 ModelScope token

需要认证的 OpenAPI 操作前,先配置:

export MODELSCOPE_API_TOKEN="YOUR_MODELSCOPE_TOKEN"

也兼容:

export MODELSCOPE_TOKEN="YOUR_MODELSCOPE_TOKEN"

2. 安装 ModelScope CLI

如果要下载模型或数据集:

python3 -m pip install -U modelscope

3. 运行环境检查

python3 modelscope-api/scripts/check_setup.py

JSON 输出:

python3 modelscope-api/scripts/check_setup.py --json

4. 调用 OpenAPI

python3 modelscope-api/scripts/modelscope_api.py GET /users/me
python3 modelscope-api/scripts/modelscope_api.py GET /models --query search=Qwen --query page_size=5

5. 下载模型或数据集

python3 modelscope-api/scripts/modelscope_download.py model qwen/Qwen3-8B --local-dir ./Qwen3-8B --dry-run
python3 modelscope-api/scripts/modelscope_download.py dataset modelscope/test-dataset --cache-dir ./ms-cache --dry-run

6. 打包当前 skill

python3 modelscope-api/scripts/package_skill.py --output /tmp/modelscope-api-skill.zip

文档入口

验证

运行测试:

python3 -m unittest tests/test_modelscope_api.py tests/test_modelscope_download.py tests/test_check_setup.py tests/test_package_skill.py

编译脚本:

python3 -m py_compile modelscope-api/scripts/modelscope_api.py modelscope-api/scripts/modelscope_download.py modelscope-api/scripts/check_setup.py modelscope-api/scripts/package_skill.py

打包校验:

python3 modelscope-api/scripts/package_skill.py --output /tmp/modelscope-api-skill.zip --json

注意事项

  • 不要把真实 token 提交到仓库。
  • 不要把下载得到的模型权重、数据集、缓存目录提交到仓库。
  • openapi.json 是较大的参考文件,保留它是为了让 skill 可以离线读取官方 schema。
  • docs/model-download-guide.md 是单独的命令行下载说明,不依赖 skill 机制。

About

魔塔社区的skill 主要用于模型和数据集查询 、下载 skill和mcp的查询和下载

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages