본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)18k · #10591

serverless-modal

하는 일

이 스킬은 서버리스 클라우드 서비스인 Modal에서 GPU 코드를 실행합니다. CUDA 코드 디버깅이나 작은 실험처럼 서버를 설정하지 않고 GPU가 필요한 사람을 위한 스킬입니다.

사용하는 경우

  • ✓로컬 GPU가 없고 학습, 미세 조정, 추론용 GPU가 필요할 때.
  • ✓서버를 설정하지 않고 CUDA 코드를 디버깅하거나 짧은 테스트를 하고 싶을 때.
  • ✓코드가 끝나면 과금이 자동으로 멈추기를 원할 때.

스킬 링크

https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/serverless-modal/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/serverless-modal/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“작은 모델을 미세 조정하려면 GPU가 필요합니다. 서버를 설정하지 않고 Modal에서 실행해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 환경과 GPU 함수를 선언하는 짧은 Python 파일을 쓰고, Modal 명령줄로 실행합니다. 코드와 결과는 내 컴퓨터에 남고, GPU 함수만 원격에서 실행됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Modal Cloud GPU — Training & Inference

Task: $ARGUMENTS

Overview

Modal is a serverless GPU cloud. Key advantages over SSH-based platforms (vast.ai, remote servers):

  • Zero config: no SSH, no Docker, no port forwarding. Write Python → modal run → done.
  • Auto scale-to-zero: billing stops the instant your code finishes. No idle instances.
  • Local-first: run modal run from your laptop. Code, data, and results stay local; only the GPU function runs remotely.
  • Reproducible environments: dependencies declared in code via modal.Image, not system-level packages. Treat the modal.Image chain as the RENDERED form of the declarative env spec in ../shared-references/compute-env-contract.md — same spec fields (base, ordered pip phases, env vars, smoke probes), same env:<name>@<specHash> ledger entry in .aris/compute/modal.md, same three-tier validation before a long run.

Best for: Users without a local GPU who need to debug CUDA code, run small-scale tests, or iterate quickly on experiments. The $5 free tier (no card) is enough for code debugging; $30 (with card) covers most small-scale experiment runs.

Trade-off: Modal costs more per GPU-hour than vast.ai or Lightning for some GPU tiers, but eliminates setup time and idle billing, often making it cheaper for short/medium workloads. For long training runs (>4 hours), consider vast.ai for lower $/hr.

Authentication

pip install modal
modal setup          # Opens browser login, writes token to ~/.modal.toml
# Verify:
modal run -q 'print("ok")'
  • Sign up: https://modal.com (GitHub/Google login)
  • Free (no card): $5/month — enough for quick tests
  • Free (with card): $30/month — bind a payment method at https://modal.com/settings for the full free tier. Set a workspace spending limit to prevent accidental overcharge (Settings → Usage → Spending Limit)
  • Academic: apply for $10k credits | Startups: apply for $25k credits
  • Secrets: modal secret create huggingface-secret HF_TOKEN=hf_xxxxx

Recommended setup: Bind a card to unlock $30/month, then immediately set a spending limit (e.g., $30) so you never exceed the free tier. Modal will pause your workloads when the limit is hit.

SECURITY WARNING: Always bind your card and set spending limits directly on https://modal.com/settings in your browser. NEVER enter payment information, card numbers, or billing details through Claude Code or any CLI tool. Only the official Modal website is safe for payment operations.

Pricing (source: modal.com/pricing, per-second billing)

GPU $/sec ≈$/hr VRAM Bandwidth GB/s Free budget → hours
T4 $0.000164 $0.59 16GB 300 ~8.5 hr ($5) / 50.8 hr ($30)
L4 $0.000222 $0.80 24GB 300 ~6.3 hr / 37.5 hr
A10 $0.000306 $1.10 24GB 600 ~4.5 hr / 27.3 hr
L40S $0.000542 $1.95 48GB 864 ~2.6 hr / 15.4 hr
A100-40GB $0.000583 $2.10 40GB 1555 ~2.4 hr / 14.3 hr
A100-80GB $0.000694 $2.50 80GB 2039 ~2.0 hr / 12.0 hr
H100 $0.001097 $3.95 80GB 3352 ~1.3 hr / 7.6 hr
H200 $0.001261 $4.54 141GB 4800 ~1.1 hr / 6.6 hr
B200 $0.001736 $6.25 192GB 8000 ~0.8 hr / 4.8 hr

CPU: $0.047/core/hr | RAM: $0.008/GiB/hr (GPU typically 90%+ of total cost)

!! Cost Estimation Required !!

Before EVERY run, estimate cost and show to user for confirmation.

Key insights:

  • Inference bottleneck is memory bandwidth, not compute → high-bandwidth GPUs are often cheaper overall
  • 7-8B BF16 inference needs ~22GB VRAM (weights 15G + KV cache 1G + overhead), T4 (16GB) insufficient
  • H100 is often cheaper than L4 for benchmarks (11x faster but only 5x more expensive)

Cost Estimation Template (required before every run)

Cost estimate (Modal):
  Model: [name] ([params], [precision])
  VRAM: ~[X]GB (weights + KV cache + overhead)
  GPU: [type] ([VRAM]GB, $[X]/sec = $[X]/hr, bandwidth [X] GB/s)
  Estimate: ~[N] min, ~$[X]

7-8B BF16 Benchmark Cost Comparison

GPU Speed tok/s $/hr 1000 samples x 200tok cost Duration
H100 224 $3.95 $0.98 15 min
A100-40GB 104 $2.10 $1.12 32 min
L4 20 $0.80 $2.22 167 min

Workflow

Step 1: Analyze Task → Estimate Cost → Choose GPU

Same analysis as any GPU skill — determine VRAM needs from model size, pick GPU, estimate hours, calculate cost. See

자주 묻는 질문

SSH나 Docker가 필요한가요?

아니요. 스킬은 Modal에 SSH도 Docker 설정도 필요 없다고 말합니다.

비용은 얼마인가요?

작은 무료 등급과 카드 등록 시 더 큰 금액이 있다고 언급합니다. 현재 가격은 Modal 공식 사이트에서 확인하세요.

Modal이 가장 잘 맞지 않는 경우는 언제인가요?

약 4시간을 넘는 긴 학습 실행에는 Vast.ai를 고려하라고 스킬이 제안합니다.

상세 정보

작성자의 원본 설명

Run GPU workloads on Modal — training, fine-tuning, inference, batch processing. Zero-config serverless: no SSH, no Docker, auto scale-to-zero. Use when user says \"modal run\", \"modal training\", \"modal inference\", \"deploy to modal\", \"need a GPU\", \"run on modal\", \"serverless GPU\", or needs remote GPU compute.

repo: wanshuiyin/Auto-claude-code-research-in-sleep

인기도

GitHub 스타
18k
순위
#10591
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬