Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

modal-compute-knowledge

БесплатноБез исполняемых скриптовНе проверен

Modal.com serverless compute, GPU, autoscaling, batching, and deployment knowledge. PROACTIVELY activate for: (1) Modal app/function definitions (modal.App…

JosiahSiegelот JosiahSiegel★ 67 звёзд на GitHub

Об этом скилле

Modal Knowledge Skill

Comprehensive Modal.com platform knowledge covering all features, pricing, and best practices. Activate this skill when users need detailed information about Modal's serverless cloud platform.

Activation Triggers

Activate this skill when users ask about:

  • Modal.com platform features and capabilities
  • GPU-accelerated Python functions
  • Serverless container configuration
  • Modal pricing and billing
  • Modal CLI commands
  • Web endpoints and APIs on Modal
  • Scheduled/cron jobs on Modal
  • Modal volumes, secrets, and storage
  • Parallel processing with Modal
  • Modal deployment and CI/CD

Platform Overview

Modal is a serverless cloud platform for running Python code, optimized for AI/ML workloads with:

  • Zero Configuration: Everything defined in Python code
  • Fast GPU Startup: ~1 second container spin-up
  • Automatic Scaling: Scale to zero, scale to thousands
  • Per-Second Billing: Only pay for active compute
  • Multi-Cloud: AWS, GCP, Oracle Cloud Infrastructure

Core Components Reference

Apps and Functions

import modal

app = modal.App("app-name")

@app.function()
def basic_function(arg: str) -> str:
    return f"Result: {arg}"

@app.local_entrypoint()
def main():
    result = basic_function.remote("test")
    print(result)

Function Decorator Parameters

Parameter Type Description
image Image Container image configuration
gpu str/list GPU type(s): "T4", "A100", ["H100", "A100"]
cpu float CPU cores (0.125 to 64)
memory int Memory in MB (128 to 262144)
timeout int Max execution seconds
retries int Retry attempts on failure
secrets list Secrets to inject
volumes dict Volume mount points
schedule Cron/Period Scheduled execution
concurrency_limit int Max concurrent executions
container_idle_timeout int Seconds to keep warm
include_source bool Auto-sync source code

GPU Reference

Available GPUs

GPU Memory Use Case ~Cost/hr
T4 16 GB Small inference $0.59
L4 24 GB Medium inference $0.80
A10G 24 GB Inference/fine-tuning $1.10
L40S 48 GB Heavy inference $1.50
A100-40GB 40 GB Training $2.00
A100-80GB 80 GB Large models $3.00
H100 80 GB Cutting-edge $5.00
H200 141 GB Largest models $5.00
B200 180+ GB Latest gen $6.25

GPU Configuration

# Single GPU
@app.function(gpu="A100")

# Specific memory variant
@app.function(gpu="A100-80GB")

# Multi-GPU
@app.function(gpu="H100:4")

# Fallbacks (tries in order)
@app.function(gpu=["H100", "A100", "any"])

# "any" = L4, A10G, or T4
@app.function(gpu="any")

Image Building

Base Images

# Debian slim (recommended)
modal.Image.debian_slim(python_version="3.11")

# From Dockerfile
modal.Image.from_dockerfile("./Dockerfile")

# From Docker registry
modal.Image.from_registry("nvidia/cuda:12.1.0-base-ubuntu22.04")

Package Installation

# pip (standard)
image.pip_install("torch", "transformers")

# uv (FASTER - 10-100x)
image.uv_pip_install("torch", "transformers")

# System packages
image.apt_install("ffmpeg", "libsm6")

# Shell commands
image.run_commands("apt-get update", "make install")

Adding Files

# Single file
image.add_local_file("./config.json", "/app/config.json")

# Directory
image.add_local_dir("./models", "/app/models")

# Python source
image.add_local_python_source("my_module")

# Environment variables
image.env({"VAR": "value"})

Build-Time Function

def download_model():
    from huggingface_hub import snapshot_download
    snapshot_download("model-name")

image.run_function(download_model, secrets=[...])

Storage

Volumes

# Create/reference volume
vol = modal.Volume.from_name("my-vol", create_if_missing=True)

# Mount in function
@app.function(volumes={"/data": vol})
def func():
    # Read/write to /data
    vol.commit()  # Persist changes

Secrets

# From dashboard (recommended)
modal.Secret.from_name("secret-name")

# From dictionary
modal.Secret.from_dict({"KEY": "value"})

# From local env
modal.Secret.from_local_environ(["KEY1", "KEY2"])

# From .env file
modal.Secret.from_dotenv()

# Usage
@app.function(secrets=[modal.Secret.from_name("api-keys")])
def func():
    import os
    key = os.environ["API_KEY"]

Dict and Queue

# Distributed dict
d = modal.Dict.from_name("cache", create_if_missing=True)
d["key"] = "value"
d.put("key", "value", ttl=3600)

# Distributed queue
q = modal.Queue.from_name("jobs", create
Полный SKILL.md на GitHub

Установить modal-compute-knowledge в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/batched-dynamic-batching.mdreferences/scaling-autoscaler.md

FAQ

Что делает скилл modal-compute-knowledge?

Modal.com serverless compute, GPU, autoscaling, batching, and deployment knowledge. PROACTIVELY activate for: (1) Modal app/function definitions (modal.App, @app.function, @app.cls), (2) running ML/AI workloads serverlessly, (3) GPU configuration (T4, L4, A10G, A100, H100, H200), (4) Modal volumes and shared state, (5) Modal Image builder (apt, pip, run_commands), (6) Modal secrets and environment management, (7) web endpoints (FastAPI, asgi_app, wsgi_app), (8) cron schedules and continuous deployments, (9) Modal sandboxes, (10) cost optimization on Modal (autoscaling, spot, idle timeout), (11) Modal CLI (modal deploy, modal run, modal serve). Provides: app templates, GPU sizing matrix, Image builder recipes, secret patterns, web endpoint examples, and cost-optimization guidance.

Как установить скилл modal-compute-knowledge?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл modal-compute-knowledge запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить modal-compute-knowledge с