[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6J9SEB02PVVP4RTPCYT7ZV0":3,"skill-same:01M6J9SEB02PVVP4RTPCYT7ZV0":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":56,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":67,"ownerDescription":68,"updatedAt":69,"install":70,"resources":82},"01M6J9SEB02PVVP4RTPCYT7ZV0","science-modal",null,"Cloud computing platform for running Python on GPUs and serverless infrastructure. Use when deploying AI\u002FML models, running GPU-accelerated workloads, serving web endpoints, scheduling batch jobs, or scaling Python code to the cloud. Use this skill whenever the user mentions Modal, serverless GPU compute, deploying ML models to the cloud, serving inference endpoints, running batch processing in the cloud, or needs to scale Python workloads beyond their local machine. Also use when the user wants to run code on H100s, A100s, or other cloud GPUs, or needs to create a web API for a model.","Flissel\u002Fvibemind-os","Flissel","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F104565236?v=4","01M6J8Q88NWAJGKPC5TEG9YCNV","Felix Baumann","01M6J8Q8D7XAFY44P70XTJFZBW",1,"MIT","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fskills\u002Fscience\u002Fmodal\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"modal","science modal","science","scaling","Web Endpoints","2026","when","run code","source","for","python code","processing","web api","platform","infrastructure","local","imported","repo","model","api","batch","code","run","create","2026-11-10 10:12:30",false,"---\nname: science-modal\ndescription: Cloud computing platform for running Python on GPUs and serverless infrastructure.\n  Use when deploying AI\u002FML models, running GPU-accelerated workloads, serving web\n  endpoints, scheduling batch jobs, or scaling Python code to the cloud. Use this\n  skill whenever the user mentions Modal, serverless GPU compute, deploying ML models\n  to the cloud, serving inference endpoints, running batch processing in the cloud,\n  or needs to scale Python workloads beyond their local machine. Also use when the\n  user wants to run code on H100s, A100s, or other cloud GPUs, or needs to create\n  a web API for a model.\napp: science\nrequires_approval: true\nagents:\n- '*'\ninputs: []\nexpected_state:\n  description: Imported skill — behavior matches source repo\n  verification_tool: none\nconfidence: 1.0\nattempts: 0\nsuccesses: 0\nlast_adjusted: '2026-05-11T21:21:44+00:00'\n---\n\n# Modal\n\n## Overview\n\nModal is a cloud platform for running Python code serverlessly, with a focus on AI\u002FML workloads. Key capabilities:\n- **GPU compute** on demand (T4, L4, A10, L40S, A100, H100, H200, B200)\n- **Serverless functions** with autoscaling from zero to thousands of containers\n- **Custom container images** built entirely in Python code\n- **Persistent storage** via Volumes for model weights and datasets\n- **Web endpoints** for serving models and APIs\n- **Scheduled jobs** via cron or fixed intervals\n- **Sub-second cold starts** for low-latency inference\n\nEverything in Modal is defined as code — no YAML, no Dockerfiles required (though both are supported).\n\n## When to Use This Skill\n\nUse this skill when:\n- Deploy or serve AI\u002FML models in the cloud\n- Run GPU-accelerated computations (training, inference, fine-tuning)\n- Create serverless web APIs or endpoints\n- Scale batch processing jobs in parallel\n- Schedule recurring tasks (data pipelines, retraining, scraping)\n- Need persistent cloud storage for model weights or datasets\n- Want to run code in custom container environments\n- Build job queues or async task processing systems\n\n## Installation and Authentication\n\n### Install\n\n```bash\nuv pip install modal\n```\n\n### Authenticate\n\nPrefer existing credentials before creating new ones:\n\n1. Check whether `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET` are already present in the current environment.\n2. If not, check for those values in a local `.env` file and load them if appropriate for the workflow.\n3. Only fall back to interactive `modal setup` or generating fresh tokens if neither source already provides credentials.\n\n```bash\nmodal setup\n```\n\nThis opens a browser for authentication. For CI\u002FCD or headless environments, use environment variables:\n\n```bash\nexport MODAL_TOKEN_ID=\u003Cyour-token-id>\nexport MODAL_TOKEN_SECRET=\u003Cyour-token-secret>\n```\n\nIf tokens are not already available in the environment or `.env`, generate them at https:\u002F\u002Fmodal.com\u002Fsettings\n\nModal offers a free tier with $30\u002Fmonth in credits.\n\n**Reference**: See `references\u002Fgetting-started.md` for detailed setup and first app walkthrough.\n\n## Core Concepts\n\n### App and Functions\n\nA Modal `App` groups related functions. Functions decorated with `@app.function()` run remotely in the cloud:\n\n```python\nimport modal\n\napp = modal.App(\"my-app\")\n\n@app.function()\ndef square(x):\n    return x ** 2\n\n@app.local_entrypoint()\ndef main():\n    # .remote() runs in the cloud\n    print(square.remote(42))\n```\n\nRun with `modal run script.py`. Deploy with `modal deploy script.py`.\n\n**Reference**: See `references\u002Ffunctions.md` for lifecycle hooks, classes, `.map()`, `.spawn()`, and more.\n\n### Container Images\n\nModal builds container images from Python code. The recommended package installer is `uv`:\n\n```python\nimage = (\n    modal.Image.debian_slim(python_version=\"3.11\")\n    .uv_pip_install(\"torch==2.8.0\", \"transformers\", \"accelerate\")\n    .apt_install(\"git\")\n)\n\n@app.function(image=image)\ndef inference(prompt):\n    from transformers import pipeline\n    pipe = pipeline(\"text-generation\", model=\"meta-llama\u002FLlama-3-8B\")\n    return pipe(prompt)\n```\n\nKey image methods:\n- `.uv_pip_install()` — Install Python packages with uv (recommended)\n- `.pip_install()` — Install with pip (fallback)\n- `.apt_install()` — Install system packages\n- `.run_commands()` — Run shell commands during build\n- `.run_function()` — Run Python during build (e.g., download model weights)\n- `.add_local_python_source()` — Add local modules\n- `.env()` — Set environment variables\n\n**Reference**: See `references\u002Fimages.md` for Dockerfiles, micromamba, caching, GPU build steps.\n\n### GPU Compute\n\nRequest GPUs via the `gpu` parameter:\n\n```python\n@app.function(gpu=\"H100\")\ndef train_model():\n    import torch\n    device = torch.device(\"cuda\")\n    # GPU training code here\n\n# Multiple GPUs\n@app.function(gpu=\"H100:4\")\ndef distributed_training():\n    ...\n\n# GPU fallback chain\n@app.function(gpu=[\"H100\", \"A100-80GB\", \"A100-40GB\"])\ndef flexible_inference():\n    ...\n```\n\nAvailable GPUs: T4, L4, A10, L40S, A100-40GB, A100-80GB, H100, H200, B200, B200+\n\n- Up to 8 GPUs per container (except A10: up to 4)\n- L40S is recommended for inference (cost\u002Fperformance balance, 48 GB VRAM)\n- H100\u002FA100 can be auto-upgraded to H200\u002FA100-80GB at no extra cost\n- Use `gpu=\"H100!\"` to prevent auto-upgrade\n\n**Reference**: See `references\u002Fgpu.md` for GPU selection guidance and multi-GPU training.\n\n### Volumes (Persistent Storage)\n\nVolumes provide distributed, persistent file storage:\n\n```python\nvol = modal.Volume.from_name(\"model-weights\", create_if_missing=True)\n\n@app.function(volumes={\"\u002Fdata\": vol})\ndef save_model():\n    # Write to the mounted path\n    with open(\"\u002Fdata\u002Fmodel.pt\", \"wb\") as f:\n        torch.save(model.state_dict(), f)\n\n@app.function(volumes={\"\u002Fdata\": vol})\ndef load_model():\n    model.load_state_dict(torch.load(\"\u002Fdata\u002Fmodel.pt\"))\n```\n\n- Optimized for write-once, read-many workloads (model weights, datasets)\n- CLI access: `modal volume ls`, `modal volume put`, `modal volume get`\n- Background auto-commits every few seconds\n\n**Reference**: See `references\u002Fvolumes.md` for v2 volumes, concurrent writes, and best practices.\n\n### Secrets\n\nSecurely pass credentials to functions:\n\n```python\n@app.function(secrets=[modal.Secret.from_name(\"my-api-keys\")])\ndef call_api():\n    import os\n    api_key = os.environ[\"API_KEY\"]\n    # Use the key\n```\n\nCreate secrets via CLI: `modal secret create my-api-keys API_KEY=sk-xxx`\n\nOr from a `.env` file: `modal.Secret.from_dotenv()`\n\n**Reference**: See `references\u002Fsecrets.md` for dashboard setup, multiple secrets, and templates.\n\n### Web Endpoints\n\nServe models and APIs as web endpoints:\n\n```python\n@app.function()\n@modal.fastapi_endpoint()\ndef predict(text: str):\n    return {\"result\": model.predict(text)}\n```\n\n- `modal serve script.py` — Development with hot reload and temporary URL\n- `modal deploy script.py` — Production deployment with permanent URL\n- Supports FastAPI, ASGI (Starlette, FastHTML), WSGI (Flask, Django), WebSockets\n- Request bodies up to 4 GiB, unlimited response size\n\n**Reference**: See `references\u002Fweb-endpoints.md` for ASGI\u002FWSGI apps, streaming, auth, and WebSockets.\n\n### Scheduled Jobs\n\nRun functions on a schedule:\n\n```python\n@app.function(schedule=modal.Cron(\"0 9 * * *\"))  # Daily at 9 AM UTC\ndef daily_pipeline():\n    # ETL, retraining, scraping, etc.\n    ...\n\n@app.function(schedule=modal.Period(hours=6))\ndef periodic_check():\n    ...\n```\n\nDeploy with `modal deploy script.py` to activate the schedule.\n\n- `modal.Cron(\"...\")` — Standard cron syntax, stable across deploys\n- `modal.Period(hours=N)` — Fixed interval, resets on redeploy\n- Monitor runs in the Modal dashboard\n\n**Reference**: See `references\u002Fscheduled-jobs.md` for cron syntax and management.\n\n### Scaling and Concurrency\n\nModal autoscales containers automatically. Configure limits:\n\n```python\n@app.function(\n    max_containers=100,    # Upper limit\n    min_containers=2,      # Keep warm for low latency\n    buffer_containers=5,   # Reserve capacity\n    scaledown_window=300,  # Idle seconds before shutdown\n)\ndef process(data):\n    ...\n```\n\nProcess inputs in parallel with `.map()`:\n\n```python\nresults = list(process.map([item1, item2, item3, ...]))\n```\n\nEnable concurrent request handling per container:\n\n```python\n@app.function()\n@modal.concurrent(max_inputs=10)\nasync def handle_request(req):\n    ...\n```\n\n**Reference**: See `references\u002Fscaling.md` for `.map()`, `.starmap()`, `.spawn()`, and limits.\n\n### Resource Configuration\n\n```python\n@app.function(\n    cpu=4.0,              # Physical cores (not vCPUs)\n    memory=16384,         # MiB\n    ephemeral_disk=51200, # MiB (up to 3 TiB)\n    timeout=3600,         # Seconds\n)\ndef heavy_computation():\n    ...\n```\n\nDefaults: 0.125 CPU cores, 128 MiB memory. Billed on max(request, usage).\n\n**Reference**: See `references\u002Fresources.md` for limits and billing details.\n\n## Classes with Lifecycle Hooks\n\nFor stateful workloads (e.g., loading a model once and serving many requests):\n\n```python\n@app.cls(gpu=\"L40S\", image=image)\nclass Predictor:\n    @modal.enter()\n    def load_model(self):\n        self.model = load_heavy_model()  # Runs once on container start\n\n    @modal.method()\n    def predict(self, text: str):\n        return self.model(text)\n\n    @modal.exit()\n    def cleanup(self):\n        ...  # Runs on container shutdown\n```\n\nCall with: `Predictor().predict.remote(\"hello\")`\n\n## Common Workflow Patterns\n\n### GPU Model Inference Service\n\n```python\nimport modal\n\napp = modal.App(\"llm-service\")\n\nimage = (\n    modal.Image.debian_slim(python_version=\"3.11\")\n    .uv_pip_install(\"vllm\")\n)\n\n@app.cls(gpu=\"H100\", image=image, min_containers=1)\nclass LLMService:\n    @modal.enter()\n    def load(self):\n        from vllm import LLM\n        self.llm = LLM(model=\"meta-llama\u002FLlama-3-70B\")\n\n    @modal.method()\n    @modal.fastapi_endpoint(method=\"POST\")\n    def generate(self, prompt: str, max_tokens: int = 256):\n        outputs = self.llm.generate([prompt], max_tokens=max_tokens)\n        return {\"text\": outputs[0].outputs[0].text}\n```\n\n### Batch Processing Pipeline\n\n```python\napp = modal.App(\"batch-pipeline\")\nvol = modal.Volume.from_name(\"pipeline-data\", create_if_missing=True)\n\n@app.function(volumes={\"\u002Fdata\": vol}, cpu=4.0, memory=8192)\ndef process_chunk(chunk_id: int):\n    import pandas as pd\n    df = pd.read_parquet(f\"\u002Fdata\u002Finput\u002Fchunk_{chunk_id}.parquet\")\n    result = heavy_transform(df)\n    result.to_parquet(f\"\u002Fdata\u002Foutput\u002Fchunk_{chunk_id}.parquet\")\n    return len(result)\n\n@app.local_entrypoint()\ndef main():\n    chunk_ids = list(range(100))\n    results = list(process_chunk.map(chunk_ids))\n    print(f\"Processed {sum(results)} total rows\")\n```\n\n### Scheduled Data Pipeline\n\n```python\napp = modal.App(\"etl-pipeline\")\n\n@app.function(\n    schedule=modal.Cron(\"0 *\u002F6 * * *\"),  # Every 6 hours\n    secrets=[modal.Secret.from_name(\"db-credentials\")],\n)\ndef etl_job():\n    import os\n    db_url = os.environ[\"DATABASE_URL\"]\n    # Extract, transform, load\n    ...\n```\n\n## CLI Reference\n\n| Command | Description |\n|---------|-------------|\n| `modal setup` | Authenticate with Modal |\n| `modal run script.py` | Run a script's local entrypoint |\n| `modal serve script.py` | Dev server with hot reload |\n| `modal deploy script.py` | Deploy to production |\n| `modal volume ls \u003Cname>` | List files in a volume |\n| `modal volume put \u003Cname> \u003Cfile>` | Upload file to volume |\n| `modal volume get \u003Cname> \u003Cfile>` | Download file from volume |\n| `modal secret create \u003Cname> K=V` | Create a secret |\n| `modal secret list` | List secrets |\n| `modal app list` | List deployed apps |\n| `modal app stop \u003Cname>` | Stop a deployed app |\n\n## Reference Files\n\nDetailed documentation for each topic:\n\n- `references\u002Fgetting-started.md` — Installation, authentication, first app\n- `references\u002Ffunctions.md` — Functions, classes, lifecycle hooks, remote execution\n- `references\u002Fimages.md` — Container images, package installation, caching\n- `references\u002Fgpu.md` — GPU types, selection, multi-GPU, training\n- `references\u002Fvolumes.md` — Persistent storage, file management, v2 volumes\n- `references\u002Fsecrets.md` — Credentials, environment variables, dotenv\n- `references\u002Fweb-endpoints.md` — FastAPI, ASGI\u002FWSGI, streaming, auth, WebSockets\n- `references\u002Fscheduled-jobs.md` — Cron, periodic schedules, management\n- `references\u002Fscaling.md` — Autoscaling, concurrency, .map(), limits\n- `references\u002Fresources.md` — CPU, memory, disk, timeout configuration\n- `references\u002Fexamples.md` — Common use cases and patterns\n- `references\u002Fapi_reference.md` — Key API classes and methods\n\nRead these files when detailed information is needed beyond this overview.\n","# Modal\n\n## Overview\n\nModal is a cloud platform for running Python code serverlessly, with a focus on AI\u002FML workloads. Key capabilities:\n- **GPU compute** on demand (T4, L4, A10, L40S, A100, H100, H200, B200)\n- **Serverless functions** with autoscaling from zero to thousands of containers\n- **Custom container images** built entirely in Python code\n- **Persistent storage** via Volumes for model weights and datasets\n- **Web endpoints** for serving models and APIs\n- **Scheduled jobs** via cron or fixed intervals\n- **Sub-second cold starts** for low-latency inference\n\nEverything in Modal is defined as code — no YAML, no Dockerfiles required (though both are supported).\n\n## When to Use This Skill\n\nUse this skill when:\n- Deploy or serve AI\u002FML models in the cloud\n- Run GPU-accelerated computations (training, inference, fine-tuning)\n- Create serverless web APIs or endpoints\n- Scale batch processing jobs in parallel\n- Schedule recurring tasks (data pipelines, retraining, scraping)\n- Need persistent cloud storage for model weights or datasets\n- Want to run code in custom container environments\n- Build job queues or async task processing systems\n\n## Installation and Authentication\n\n### Install\n\n```bash\nuv pip install modal\n```\n\n### Authenticate\n\nPrefer existing credentials before creating new ones:\n\n1. Check whether `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET` are already present in the current environment.\n2. If not, check for those values in a local `.env` file and load them if appropriate for the workflow.\n3. Only fall back to interactive `modal setup` or generating fresh tokens if neither source already provides credentials.\n\n```bash\nmodal setup\n```\n\nThis opens a browser for authentication. For CI\u002FCD or headless environments, use environment variables:\n\n```bash\nexport MODAL_TOKEN_ID=\u003Cyour-token-id>\nexport MODAL_TOKEN_SECRET=\u003Cyour-token-secret>\n```\n\nIf tokens are not already available in the environment or `.env`, generate them at https:\u002F\u002Fmodal.com\u002Fsettings\n\nModal offers a free tier with $30\u002Fmonth in credits.\n\n**Reference**: See `references\u002Fgetting-started.md` for detailed setup and first app walkthrough.\n\n## Core Concepts\n\n### App and Functions\n\nA Modal `App` groups related functions. Functions decorated with `@app.function()` run remotely in the cloud:\n\n```python\nimport modal\n\napp = modal.App(\"my-app\")\n\n@app.function()\ndef square(x):\n    return x ** 2\n\n@app.local_entrypoint()\ndef main():\n    # .remote() runs in the cloud\n    print(square.remote(42))\n```\n\nRun with `modal run script.py`. Deploy with `modal deploy script.py`.\n\n**Reference**: See `references\u002Ffunctions.md` for lifecycle hooks, classes, `.map()`, `.spawn()`, and more.\n\n### Container Images\n\nModal builds container images from Python code. The recommended package installer is `uv`:\n\n```python\nimage = (\n    modal.Image.debian_slim(python_version=\"3.11\")\n    .uv_pip_install(\"torch==2.8.0\", \"transformers\", \"accelerate\")\n    .apt_install(\"git\")\n)\n\n@app.function(image=image)\ndef inference(prompt):\n    from transformers import pipeline\n    pipe = pipeline(\"text-generation\", model=\"meta-llama\u002FLlama-3-8B\")\n    return pipe(prompt)\n```\n\nKey image methods:\n- `.uv_pip_install()` — Install Python packages with uv (recommended)\n- `.pip_install()` — Install with pip (fallback)\n- `.apt_install()` — Install system packages\n- `.run_commands()` — Run shell commands during build\n- `.run_function()` — Run Python during build (e.g., download model weights)\n- `.add_local_python_source()` — Add local modules\n- `.env()` — Set environment variables\n\n**Reference**: See `references\u002Fimages.md` for Dockerfiles, micromamba, caching, GPU build steps.\n\n### GPU Compute\n\nRequest GPUs via the `gpu` parameter:\n\n```python\n@app.function(gpu=\"H100\")\ndef train_model():\n    import torch\n    device = torch.device(\"cuda\")\n    # GPU training code here\n\n# Multiple GPUs\n@app.function(gpu=\"H100:4\")\ndef distributed_training():\n    ...\n\n# GPU fallback chain\n@app.function(gpu=[\"H100\", \"A100-80GB\", \"A100-40GB\"])\ndef flexible_inference():\n    ...\n```\n\nAvailable GPUs: T4, L4, A10, L40S, A100-40GB, A100-80GB, H100, H200, B200, B200+\n\n- Up to 8 GPUs per container (except A10: up to 4)\n- L40S is recommended for inference (cost\u002Fperformance balance, 48 GB VRAM)\n- H100\u002FA100 can be auto-upgraded to H200\u002FA100-80GB at no extra cost\n- Use `gpu=\"H100!\"` to prevent auto-upgrade\n\n**Reference**: See `references\u002Fgpu.md` for GPU selection guidance and multi-GPU training.\n\n### Volumes (Persistent Storage)\n\nVolumes provide distributed, persistent file storage:\n\n```python\nvol = modal.Volume.from_name(\"model-weights\", create_if_missing=True)\n\n@app.function(volumes={\"\u002Fdata\": vol})\ndef save_model():\n    # Write to the mounted path\n    with open(\"\u002Fdata\u002Fmodel.pt\", \"wb\") as f:\n        torch.save(model.state_dict(), f)\n\n@app.function(volumes={\"\u002Fdata\": vol})\ndef load_model():\n    model.load_state_dict(torch.load(\"\u002Fdata\u002Fmodel.pt\"))\n```\n\n- Optimized for write-once, read-many workloads (model weights, datasets)\n- CLI access: `modal volume ls`, `modal volume put`, `modal volume get`\n- Background auto-commits every few seconds\n\n**Reference**: See `references\u002Fvolumes.md` for v2 volumes, concurrent writes, and best practices.\n\n### Secrets\n\nSecurely pass credentials to functions:\n\n```python\n@app.function(secrets=[modal.Secret.from_name(\"my-api-keys\")])\ndef call_api():\n    import os\n    api_key = os.environ[\"API_KEY\"]\n    # Use the key\n```\n\nCreate secrets via CLI: `modal secret create my-api-keys API_KEY=sk-xxx`\n\nOr from a `.env` file: `modal.Secret.from_dotenv()`\n\n**Reference**: See `references\u002Fsecrets.md` for dashboard setup, multiple secrets, and templates.\n\n### Web Endpoints\n\nServe models and APIs as web endpoints:\n\n```python\n@app.function()\n@modal.fastapi_endpoint()\ndef predict(text: str):\n    return {\"result\": model.predict(text)}\n```\n\n- `modal serve script.py` — Development with hot reload and temporary URL\n- `modal deploy script.py` — Production deployment with permanent URL\n- Supports FastAPI, ASGI (Starlette, FastHTML), WSGI (Flask, Django), WebSockets\n- Request bodies up to 4 GiB, unlimited response size\n\n**Reference**: See `references\u002Fweb-endpoints.md` for ASGI\u002FWSGI apps, streaming, auth, and WebSockets.\n\n### Scheduled Jobs\n\nRun functions on a schedule:\n\n```python\n@app.function(schedule=modal.Cron(\"0 9 * * *\"))  # Daily at 9 AM UTC\ndef daily_pipeline():\n    # ETL, retraining, scraping, etc.\n    ...\n\n@app.function(schedule=modal.Period(hours=6))\ndef periodic_check():\n    ...\n```\n\nDeploy with `modal deploy script.py` to activate the schedule.\n\n- `modal.Cron(\"...\")` — Standard cron syntax, stable across deploys\n- `modal.Period(hours=N)` — Fixed interval, resets on redeploy\n- Monitor runs in the Modal dashboard\n\n**Reference**: See `references\u002Fscheduled-jobs.md` for cron syntax and management.\n\n### Scaling and Concurrency\n\nModal autoscales containers automatically. Configure limits:\n\n```python\n@app.function(\n    max_containers=100,    # Upper limit\n    min_containers=2,      # Keep warm for low latency\n    buffer_containers=5,   # Reserve capacity\n    scaledown_window=300,  # Idle seconds before shutdown\n)\ndef process(data):\n    ...\n```\n\nProcess inputs in parallel with `.map()`:\n\n```python\nresults = list(process.map([item1, item2, item3, ...]))\n```\n\nEnable concurrent request handling per container:\n\n```python\n@app.function()\n@modal.concurrent(max_inputs=10)\nasync def handle_request(req):\n    ...\n```\n\n**Reference**: See `references\u002Fscaling.md` for `.map()`, `.starmap()`, `.spawn()`, and limits.\n\n### Resource Configuration\n\n```python\n@app.function(\n    cpu=4.0,              # Physical cores (not vCPUs)\n    memory=16384,         # MiB\n    ephemeral_disk=51200, # MiB (up to 3 TiB)\n    timeout=3600,         # Seconds\n)\ndef heavy_computation():\n    ...\n```\n\nDefaults: 0.125 CPU cores, 128 MiB memory. Billed on max(request, usage).\n\n**Reference**: See `references\u002Fresources.md` for limits and billing details.\n\n## Classes with Lifecycle Hooks\n\nFor stateful workloads (e.g., loading a model once and serving many requests):\n\n```python\n@app.cls(gpu=\"L40S\", image=image)\nclass Predictor:\n    @modal.enter()\n    def load_model(self):\n        self.model = load_heavy_model()  # Runs once on container start\n\n    @modal.method()\n    def predict(self, text: str):\n        return self.model(text)\n\n    @modal.exit()\n    def cleanup(self):\n        ...  # Runs on container shutdown\n```\n\nCall with: `Predictor().predict.remote(\"hello\")`\n\n## Common Workflow Patterns\n\n### GPU Model Inference Service\n\n```python\nimport modal\n\napp = modal.App(\"llm-service\")\n\nimage = (\n    modal.Image.debian_slim(python_version=\"3.11\")\n    .uv_pip_install(\"vllm\")\n)\n\n@app.cls(gpu=\"H100\", image=image, min_containers=1)\nclass LLMService:\n    @modal.enter()\n    def load(self):\n        from vllm import LLM\n        self.llm = LLM(model=\"meta-llama\u002FLlama-3-70B\")\n\n    @modal.method()\n    @modal.fastapi_endpoint(method=\"POST\")\n    def generate(self, prompt: str, max_tokens: int = 256):\n        outputs = self.llm.generate([prompt], max_tokens=max_tokens)\n        return {\"text\": outputs[0].outputs[0].text}\n```\n\n### Batch Processing Pipeline\n\n```python\napp = modal.App(\"batch-pipeline\")\nvol = modal.Volume.from_name(\"pipeline-data\", create_if_missing=True)\n\n@app.function(volumes={\"\u002Fdata\": vol}, cpu=4.0, memory=8192)\ndef process_chunk(chunk_id: int):\n    import pandas as pd\n    df = pd.read_parquet(f\"\u002Fdata\u002Finput\u002Fchunk_{chunk_id}.parquet\")\n    result = heavy_transform(df)\n    result.to_parquet(f\"\u002Fdata\u002Foutput\u002Fchunk_{chunk_id}.parquet\")\n    return len(result)\n\n@app.local_entrypoint()\ndef main():\n    chunk_ids = list(range(100))\n    results = list(process_chunk.map(chunk_ids))\n    print(f\"Processed {sum(results)} total rows\")\n```\n\n### Scheduled Data Pipeline\n\n```python\napp = modal.App(\"etl-pipeline\")\n\n@app.function(\n    schedule=modal.Cron(\"0 *\u002F6 * * *\"),  # Every 6 hours\n    secrets=[modal.Secret.from_name(\"db-credentials\")],\n)\ndef etl_job():\n    import os\n    db_url = os.environ[\"DATABASE_URL\"]\n    # Extract, transform, load\n    ...\n```\n\n## CLI Reference\n\n| Command | Description |\n|---------|-------------|\n| `modal setup` | Authenticate with Modal |\n| `modal run script.py` | Run a script's local entrypoint |\n| `modal serve script.py` | Dev server with hot reload |\n| `modal deploy script.py` | Deploy to production |\n| `modal volume ls \u003Cname>` | List files in a volume |\n| `modal volume put \u003Cname> \u003Cfile>` | Upload file to volume |\n| `modal volume get \u003Cname> \u003Cfile>` | Download file from volume |\n| `modal secret create \u003Cname> K=V` | Create a secret |\n| `modal secret list` | List secrets |\n| `modal app list` | List deployed apps |\n| `modal app stop \u003Cname>` | Stop a deployed app |\n\n## Reference Files\n\nDetailed documentation for each topic:\n\n- `references\u002Fgetting-started.md` — Installation, authentication, first app\n- `references\u002Ffunctions.md` — Functions, classes, lifecycle hooks, remote execution\n- `references\u002Fimages.md` — Container images, package installation, caching\n- `references\u002Fgpu.md` — GPU types, selection, multi-GPU, training\n- `references\u002Fvolumes.md` — Persistent storage, file management, v2 volumes\n- `references\u002Fsecrets.md` — Credentials, environment variables, dotenv\n- `references\u002Fweb-endpoints.md` — FastAPI, ASGI\u002FWSGI, streaming, auth, WebSockets\n- `references\u002Fscheduled-jobs.md` — Cron, periodic schedules, management\n- `references\u002Fscaling.md` — Autoscaling, concurrency, .map(), limits\n- `references\u002Fresources.md` — CPU, memory, disk, timeout configuration\n- `references\u002Fexamples.md` — Common use cases and patterns\n- `references\u002Fapi_reference.md` — Key API classes and methods\n\nRead these files when detailed information is needed beyond this overview.\n",{"app":26,"name":5,"agents":53,"inputs":55,"attempts":56,"successes":56,"confidence":14,"description":7,"last_adjusted":57,"expected_state":58,"requires_approval":61},[54],"*",[],0,"2026-05-11T21:21:44+00:00",{"description":59,"verification_tool":60},"Imported skill — behavior matches source repo","none",true,"master","5f13b5d2b532c0ab6f847e3aa24d4bfe66f7d461","skills\u002Fscience\u002Fmodal","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os","https:\u002F\u002Fgithub.com\u002FFlissel","https:\u002F\u002Fvibemind.space","Co-founder & CTO, VibeMind - a voice-first agentic OS for non-technical founders. Agents that do the work, not describe it.","2026-11-13 22:15:26",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":61},[72,75,78],{"tool":73,"command":74},"npx","npx skills add Flissel\u002Fvibemind-os --skill science-modal",{"tool":76,"command":77},"bunx","bunx skills add Flissel\u002Fvibemind-os --skill science-modal",{"tool":79,"command":80},"pnpm","pnpm dlx skills add Flissel\u002Fvibemind-os --skill science-modal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fskills\u002Fscience\u002Fmodal\u002FSKILL.md",[],[84,92,99,127,135,149],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":48},"01M6JAA67M92TRE7GWDJDBTA9T","review","Review a change.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Frowboat\u002Fpackages\u002Fopenai-plugin-runtime\u002Ftest\u002Ffixtures\u002Fcomplete-plugin\u002Fskills\u002Freview\u002FSKILL.md",[],[86,91],"change",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":48},"01M6JAA3DZR55G8ZY493BE9NBB","triage","Triage a change.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Frowboat\u002Fpackages\u002Fopenai-plugin-runtime\u002Ftest\u002Ffixtures\u002Fcomplete-plugin\u002Fskills\u002Fgroup\u002Ftriage\u002FSKILL.md",[],[94,91],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":48},"01M6JA9XPVHENK0FQN7HBK54NV","zentrale-werkzeuge","Werkzeuge der Zentrale – nutzen bei GitHub-Fragen (Projekte updaten, Repos, Issues, PRs, Commits, CI\u002FActions-Status, README), bei Fragen zum eigenen Gitea (Sicherung\u002FSpiegel, Repos, Issues, Commits), wenn neueste Docs\u002FDoku zu einer Bibliothek oder einem Dienst geholt werden sollen, wenn ein Dashboard aus meinen Daten gebaut werden soll und wenn ich sage 'auf meinem PC suchen' oder 'such auf dem Rechner nach …'.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Fdeploy\u002Fheadless\u002Fskills\u002Fzentrale-werkzeuge\u002FSKILL.md",[],[106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"zentrale werkzeuge","grep","file","README","list","fetch","todo","gitea","add","URL","mkdir","prs","commits","ci","actions","issues","status","repos","dashboard","github","docs",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":48},"01M6JA9SQPX187CVC148SQT1SP","wissen-suchen","Bedeutungssuche im Rowboat-Wissen – IMMER zuerst nutzen, wenn nach Kunden, Kontakten, Themen, Interessen, Notizen oder 'was wissen wir über …' gefragt wird, besonders wenn die genauen Wörter unklar sind.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Fdeploy\u002Fheadless\u002Fskills\u002Fwissen-suchen\u002FSKILL.md",[],[134],"wissen suchen",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":48},"01M6JA9P6GNFPE21101SDZS3BT","reel-aus-material","Reel aus vorhandenen Laura-Videos: passende Stellen im Transkript finden; spricht dort eine Person, bleibt ihr Originalton (mit Untertiteln aus dem Transkript), sonst trägt ein eingesprochener Satz den Clip. Bei Aufträgen der Art 'material'.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Fmarketing\u002Fvideo_claw\u002Fskills\u002Freel-aus-material\u002FSKILL.md",[],[142,143,144,145,146,147,148],"material","reel","reel aus material","person","videos","Art","clip",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":48},"01M6JA9KSATRT42ACWT66514ZP","reel-aus-bildern","Reel ohne Filmmaterial: Titelkarte, 3–5 Markenbilder mit wechselnder Bewegung, Schlusskarte mit Handlung; Farben und Logo der Firma. Bei Aufträgen der Art 'bilder'.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Fmarketing\u002Fvideo_claw\u002Fskills\u002Freel-aus-bildern\u002FSKILL.md",[],[143,156,157,147],"reel aus bildern","logo"]