魔搭创空间部署Skill
Deploy a local project to a ModelScope Studio. Supports Gradio, Streamlit, Docker, and static website types. Covers creation, code sync, deployment, log monitoring, plaintext/secret variable management, and automatic diagnosis and repair. Use when the user mentions deploying to ModelScope, Studio, the ModelScope community, ModelScope, Studio deployment, Gradio deployment, Streamlit deployment, Docker deployment, FastAPI deployment, or static website deployment, or wants to publish a local app, w
价格
免费
- 安装:免费
在组织开通时一次性收取;再次读取清单或下载不重复收费。
以上为公开标价。你的组织可能有协议价,以控制台显示的价格为准。
如何使用
为组织安装
开通即安装:组织固定使用开通时的版本(当前为 1.0.0)。升级到新版本需要取消后重新开通。
创建凭证
客户端使用组织凭证读取;绑定到数字人后,数字人使用绑定凭证按需加载。请求中携带:
Authorization: Bearer $ZGI_MARKET_KEY读取清单与安装包
清单列出版本、文件和校验值;安装包是一个 zip 文件。
读取清单 curl "https://market-api.zgi.im/v1/market/skills/modelscope-modelscope-studio-31f3994d/manifest" \ -H "Authorization: Bearer $ZGI_MARKET_KEY"下载安装包 curl "https://market-api.zgi.im/v1/market/skills/modelscope-modelscope-studio-31f3994d/package" \ -H "Authorization: Bearer $ZGI_MARKET_KEY" \ -o modelscope-modelscope-studio-31f3994d.zip读取清单和下载安装包不计入用量。下载后请用响应头中的 SHA-256 校验文件。
技能说明
- 名称
- ms-studio-deploy
- 说明
- Deploy a local project to a ModelScope Studio. Supports Gradio, Streamlit, Docker, and static website types. Covers creation, code sync, deployment, log monitoring, plaintext/secret variable management, and automatic diagnosis and repair. Use when the user mentions deploying to ModelScope, Studio, the ModelScope community, ModelScope, Studio deployment, Gradio deployment, Streamlit deployment, Docker deployment, FastAPI deployment, or static website deployment, or wants to publish a local app, web app, or API service to the cloud. Also applies when the user encounters a Studio build failure or runtime error and needs to inspect logs, wants to update an already-deployed Studio, or wants to manage a Studio's plaintext variables or secrets. Not applicable to: Hub repository management, model/dataset operations, MCP/skill management, model training, or model evaluation.
技能包内没有脚本文件:这个技能是供模型阅读的文本。
SKILL.md 节选
# ModelScope Studio Deployment
> Verified live against ModelScope OpenAPI | modelscope 1.37.1 / modelscope_hub 0.1.2 (2026-06-29)
Deploy a local project to a ModelScope Studio. **This Skill uses OpenAPI as the source of truth**, with the `ms` CLI as an equivalent convenience alias, `modelscope_hub.HubApi` as the API-first Python client, and MCP tools as optional.
## Quick Decision Guide
```
User wants to...
│
├── Deploy a local project to a Studio
│ └── Follow the 10 steps in "Full Deployment Workflow" below
│
├── Update an already-deployed Studio
│ └── Modify code → git push → POST /studios/{o}/{r}/deploy (or ms deploy)
│
├── View Studio status/logs
│ └── GET /studios/{o}/{r}/logs/run (or ms logs --log-type run)
│
├── Manage variables
│ ├── Plaintext variables: GET/POST/PUT/DELETE /studios/{o}/{r}/variables
│ └── Secrets: GET/POST/PUT/DELETE /studios/{o}/{r}/secrets (or ms secret ...)
│
└── Repository file management / model & dataset operations
└── hand off → ms-hub
```
## Prerequisites
### 1. MODELSCOPE_API_KEY
The entire workflow depends on this token (API authentication, Git push, variable/secret configuration); it must be confirmed first.
```bash
# 1. First check the environment variable
echo $MODELSCOPE_API_KEY
# 2. If empty, try extracting from the git remote (may have been configured before)
git remote -v 2>/dev/null | grep modelscope.cn
```
If the environment variable is empty but the git remote contains an address of the form `https://oauth2:<token>@www.modelscope.cn/studios/...` (or `www.modelscope.ai/...` for the international site), extract `<token>` from it as `MODELSCOPE_API_KEY`.
If neither is available, guide the user:
1. Visit $MODELSCOPE_ENDPOINT/my/myaccesstoken to obtain a token
2. `export MODELSCOPE_API_KEY=your_token`
> **Site routing:** this skill targets whichever site `$MODELSCOPE_ENDPOINT` points to (default domestic `https://modelscope.cn`; international `https://www.modelscope.ai`). Export `MODELSCOPE_ENDPOINT` plus a **site-scoped** token before deploying — the OpenAPI base and the git remote host below both derive from it. Full guidance: ms-hub → "Site selection & endpoint routing".
### 2. Runtime Environment
```bash
pip install modelscope # Also provides the OpenAPI/SDK and the ms CLI
```
OpenAPI basic conventions:
| Item | Value |
|------|-----|
| **Base URL** | `$MODELSCOPE_ENDPOINT/openapi/v1` (default `https://modelscope.cn`) |
| **Authentication** | `Authorization: Bearer $MODELSCOPE_API_KEY` |
| **Success response** | `{"success": true, "data": {...}, "request_id": "..."}` |
| **Default branch** | `master` (not main) |
### 3. Git Environment
Studio code is synced via Git; ensure Git is installed and user information is configured.
## Operations Overview: OpenAPI (source of truth) ↔ CLI ↔ Python
| Operation | OpenAPI (source of truth) | ms CLI (equivalent alias) | `modelscope_hub.HubApi` (Python) | MCP tool (optional) |
|------|---------------------|---------------------|-----------------------------------|------------------|
| User info | `GET /users/me` | `ms whoami` | `api.whoami()` | `getCurrentUser` |
| Create Studio | `POST /studios` | `ms create o/r --repo-type studio` | `api.create_repo("o/r", repo_type="studio", ...)` | `createStudio` |
| Get details | `GET /studios/{o}/{r}` | `ms info o/r --repo-type studio` | `api.get_repo("o/r", repo_type="studio")` | `getStudio` |
| Deploy/restart | `POST /studios/{o}/{r}/deploy` | `ms deploy o/r --repo-type studio` | `api.deploy_repo("o/r")` | `deployStudio` |
| Stop | `POST /studios/{o}/{r}/stop` | `ms stop o/r --repo-type studio` | `api.stop_repo("o/r")` | `stopStudio` |
| Logs | `GET /studios/{o}/{r}/logs/{run\|build}` | `ms logs o/r --log-type run` | `api.get_repo_logs("o/r", log_type="run")` | `getStudioLogs` |
| Update settings | `PATCH /studios/{o}/{r}/settings` | `ms settings o/r --repo-type studio k=v` | `api.update_repo_settings("o/r","studio",**kw)` | `updateStudioSettings` |SKILL.md 不止这些内容,安装后可阅读全文。
技能包内容
共 4 个文件,合计 30.7 KiB
- SKILL.md20.5 KiB
- references/docker-templates.md1.4 KiB
- references/openapi-studio-endpoints.md5.9 KiB
- references/troubleshooting.md2.9 KiB
来源与审核
- 审核状态
- 尚未审核,内容来自上游来源
- 许可证
- 未说明
审核状态是平台对上架信息的记录,不构成对上游服务质量或可用性的担保。