Agent Skillssynthetic-sciences/openscience › modal-serverless-gpu

modal-serverless-gpu

GitHub

通过 OpenScience Compute 平台运行受控的 Modal 沙箱作业,支持 CPU/GPU 任务、文件上传及资源调度。禁止直接使用 SDK/CLI,需经审批流程执行,返回状态与日志。

backend/cli/skills/cloud-compute/modal/SKILL.md synthetic-sciences/openscience

Trigger Scenarios

需要在一处性计算环境中运行 Python 脚本或数据分析任务 请求使用 GPU 进行推理或模型训练 需要上传本地文件到远程沙箱环境并获取结果

Install

npx skills add synthetic-sciences/openscience --skill modal-serverless-gpu -g -y
More Options

Non-standard path

npx skills add https://github.com/synthetic-sciences/openscience/tree/main/backend/cli/skills/cloud-compute/modal -g -y

Use without installing

npx skills use synthetic-sciences/openscience@modal-serverless-gpu

指定 Agent (Claude Code)

npx skills add synthetic-sciences/openscience --skill modal-serverless-gpu -a claude-code -g -y

安装 repo 全部 skill

npx skills add synthetic-sciences/openscience --all -g -y

预览 repo 内 skill

npx skills add synthetic-sciences/openscience --list

SKILL.md

Frontmatter
{
    "name": "modal-serverless-gpu",
    "tags": [
        "Infrastructure",
        "Serverless",
        "GPU",
        "Cloud",
        "Modal",
        "Sandboxes",
        "Compute"
    ],
    "author": "Synthetic Sciences",
    "license": "MIT",
    "version": "4.0.0",
    "category": "cloud-compute",
    "description": "Run governed Modal sandbox jobs with OpenScience's modal tool. Use for one-off CPU\/GPU commands, explicit file uploads and captures, dependency provisioning, resource selection, approval, dispatch, and results. This skill does not install or invoke the Modal Python SDK or CLI."
}

Modal through OpenScience Compute

OpenScience uses Modal as a trusted control-plane provider. The agent prepares ordinary project files and calls the modal tool. The tool presents an exact paid-dispatch approval card, resolves credentials only after approval, creates the sandbox through OpenScience's JavaScript adapter, and returns status and logs.

This is different from developing a standalone Modal Python application. For the OpenScience path:

  • Do not inspect MODAL_TOKEN_ID, MODAL_TOKEN_SECRET, or ~/.modal.toml.
  • Do not install or import the Modal Python package.
  • Do not run or recommend modal run, modal deploy, modal serve, or modal setup.
  • Do not use modal.App, Modal decorators, functions, volumes, or Python SDK sandboxes.
  • Do not ask for approval in chat. A chat response such as yes is not dispatch authorization; the modal tool owns approval.
  • Do not send the user to recreate a job manually in Compute when the modal tool is available.
  • Only claim dispatch, status, or completion reported by the tool or Compute job record.

Availability

Use the current <compute-capability> system section as the authority:

  • Configured and enabled: prepare files and call the modal tool.
  • Configured but disabled: explain that new jobs are blocked until the user enables Modal in Settings → Compute.
  • Not configured: direct the user to Settings → Compute. Never fall back to local credentials or CLI setup.

Preparing a job

When the user asks to run work on Modal:

  1. Create or update ordinary project files when useful. Prefer self-contained scripts that work in the configured image and under its network policy.
  2. Call modal with the job name, ordinary command, explicit uploads, outputs, and packages, plus image/GPU/resources when needed.
  3. The tool displays the exact app, image, packages, GPU, network, timeout, inputs, outputs, and paid-run warning. Wait for that approval; do not ask for a second confirmation in chat.
  4. Report the status and log returned by the tool. The same job is visible under Compute → Jobs.

Commands execute inside the configured sandbox image. They are ordinary shell commands:

python analysis.py

They are not Modal launch commands.

CPU and GPU selection

Use GPU type none for CPU-only work. Do not request a GPU for small data processing, linear regression, or other CPU-sufficient jobs merely because Modal supports GPUs.

Common GPU starting points:

Workload Suggested GPU
CPU-only analysis none
Small inference or CUDA smoke test T4
Cost-conscious modern inference L4
Medium training or inference A10G or L40S
Large-model training A100-80GB or H100

Treat GPU prices and availability as provider-controlled and time-sensitive. Do not invent a precise cost or duration estimate.

Inputs, outputs, and dependencies

Only files matching Files to upload are copied into the sandbox. Secrets, .git, node_modules, and .openscience are denied. List every required script, configuration file, and small data input explicitly.

Use Files to capture for outputs that must return to the project, for example:

outputs/**/*.csv, outputs/**/*.png

The default image does not promise third-party Python packages. Put requirements such as numpy==2.3.2 and scikit-learn==1.7.1 in the tool's packages field. OpenScience installs them into an image layer before the sandbox starts; package installation is part of the signed approval plan and does not depend on runtime network access.

Example tool call

For a CPU-only regression script already created at linear_regression.py:

{
  "name": "Linear regression smoke test",
  "command": "python linear_regression.py",
  "uploads": ["linear_regression.py"],
  "outputs": ["outputs/results.json"],
  "packages": ["numpy==2.3.2", "scikit-learn==1.7.1"],
  "gpu": "none",
  "timeout_minutes": 10
}

Standalone Modal SDK requests

If the user explicitly asks to author an independent Modal Python application, explain that it is a separate workflow outside governed OpenScience Compute. You may discuss architecture conceptually, but do not install the SDK, access credentials, execute Modal CLI commands, or imply that OpenScience's enabled provider authorizes that workflow. The legacy reference files in this skill directory are not execution instructions for OpenScience Compute.

Version History

  • edd5854 Current 2026-08-12 11:41

    从通用 Modal Serverless 指南转为基于 OpenScience Compute 的受控执行技能,移除 SDK/CLI 使用,强调审批流程和沙箱隔离。

  • e9844a4 2026-07-11 17:22

Same Skill Collection

.openscience/skill/bun-file-io/SKILL.md
backend/cli/skills/biology/anndata/SKILL.md
backend/cli/skills/biology/benchling-integration/SKILL.md
backend/cli/skills/biology/bioimage-analysis/SKILL.md
backend/cli/skills/biology/bioservices/SKILL.md
backend/cli/skills/biology/cancer-genomics-analysis/SKILL.md
backend/cli/skills/biology/clinical-imaging/SKILL.md
backend/cli/skills/biology/clinical-reports/SKILL.md
backend/cli/skills/biology/cobrapy/SKILL.md
backend/cli/skills/biology/curated-bio-datasets/SKILL.md
backend/cli/skills/biology/deeptools/SKILL.md
backend/cli/skills/biology/dnanexus-integration/SKILL.md
backend/cli/skills/biology/etetoolkit/SKILL.md
backend/cli/skills/biology/flow-cytometry-analysis/SKILL.md
backend/cli/skills/biology/flowio/SKILL.md
backend/cli/skills/biology/gget/SKILL.md
backend/cli/skills/biology/glycobiology/SKILL.md
backend/cli/skills/biology/histolab/SKILL.md
backend/cli/skills/biology/immunology-assays/SKILL.md
backend/cli/skills/biology/latchbio-integration/SKILL.md
backend/cli/skills/biology/microbial-dynamics/SKILL.md
backend/cli/skills/biology/molecular-cloning/SKILL.md
backend/cli/skills/biology/neurokit2/SKILL.md
backend/cli/skills/biology/neuropixels-analysis/SKILL.md
backend/cli/skills/biology/omero-integration/SKILL.md
backend/cli/skills/biology/opentrons-integration/SKILL.md
backend/cli/skills/biology/pathml/SKILL.md
backend/cli/skills/biology/pharmacology-wetlab/SKILL.md
backend/cli/skills/biology/protocolsio-integration/SKILL.md
backend/cli/skills/biology/pydeseq2/SKILL.md
backend/cli/skills/biology/pyhealth/SKILL.md
backend/cli/skills/biology/pylabrobot/SKILL.md
backend/cli/skills/biology/pysam/SKILL.md
backend/cli/skills/biology/scanpy/SKILL.md
backend/cli/skills/biology/scikit-bio/SKILL.md
backend/cli/skills/biology/scikit-survival/SKILL.md
backend/cli/skills/biology/scvi-tools/SKILL.md
backend/cli/skills/biology/synthetic-biology/SKILL.md
backend/cli/skills/biology/treatment-plans/SKILL.md
backend/cli/skills/chemistry/admet-prediction/SKILL.md
backend/cli/skills/chemistry/admet-reasoning/SKILL.md
backend/cli/skills/chemistry/binding-affinity/SKILL.md
backend/cli/skills/chemistry/datamol/SKILL.md
backend/cli/skills/chemistry/deepchem/SKILL.md
backend/cli/skills/chemistry/denovo-design/SKILL.md
backend/cli/skills/chemistry/diffdock/SKILL.md
backend/cli/skills/chemistry/drug-design/SKILL.md
backend/cli/skills/chemistry/hypogenic/SKILL.md
backend/cli/skills/chemistry/matchms/SKILL.md
backend/cli/skills/chemistry/medchem/SKILL.md

Metadata

Files
0
Version
edd5854
Hash
b1ed2b1a
Indexed
2026-07-11 17:22

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-15 01:12
浙ICP备14020137号-1 $お客様$