graniet/kheish/modal
Claude Code and agent skill by graniet/kheish
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Serverless GPU cloud platform for running ML workloads. Use when you
Install
npx vskill@latest install graniet/kheish/modalSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Kheish Compatibility
This skill is repo-local and stays inactive until explicitly activated.
When the original instructions refer to legacy tool names, use these Kheish mappings:
terminal=>bashweb_extract=>web_fetch, plusweb_searchwhen discovery is neededsearch_files=>grep_searchandglob_searchbrowser_*tools require a browser-capable surfaced tool or MCP; if none is available, use the closest available surface and say so explicitly
When the instructions mention local helper files, resolve them from ${KHEISH_SKILL_DIR}.
Modal Serverless GPU
Comprehensive guide to running ML workloads on Modal's serverless GPU cloud platform.
When to use Modal
Use Modal when:
- Running GPU-intensive ML workloads without managing infrastructure
- Deploying ML models as auto-scaling APIs
- Running batch processing jobs (training, inference, data processing)
- Need pay-per-second GPU pricing without idle costs
- Prototyping ML applications quickly
- Running scheduled jobs (cron-like workloads)
Key features:
- Serverless GPUs: T4, L4, A10G, L40S, A100, H100, H200, B200 on-demand
- Python-native: Define infrastructure in Python code, no YAML
- Auto-scaling: Scale to zero, scale to 100+ GPUs instantly
- Sub-second cold starts: Rust-based infrastructure for fast container launches
- Container caching: Image layers cached for rapid iteration
- Web endpoints: Deploy functions as REST APIs with zero-downtime updates
Use alternatives instead:
- RunPod: For longer-running pods with persistent state
- Lambda Labs: For reserved GPU instances
- SkyPilot: For multi-cloud orchestration and cost optimization
- Kubernetes: For complex multi-service architectures
Quick start
Installation
Hello World with GPU
Run: modal run hello_gpu.py
Basic inference endpoint
Core concepts
Key components
| Component | Purpose | |
|---|---|---|
App | Container for functions and resources | |
Function | Serverless function with compute specs | |
Cls | Class-based functions with lifecycle hooks | |
Image | Container image definition | |
Volume | Persistent storage for models/data | |
Secret | Secure credential storage |
Execution modes
| Command | Description | |
|---|---|---|
modal run script.py | Execute and exit | |
modal serve script.py | Development with live reload | |
modal deploy script.py | Persistent cloud deployment |
GPU configuration
Available GPUs
| GPU | VRAM | Best For | |
|---|---|---|---|
T4 | 16GB | Budget inference, small models | |
L4 | 24GB | Inference, Ada Lovelace arch | |
A10G | 24GB | Training/inference, 3.3x faster than T4 | |
L40S | 48GB | Recommended for inference (best cost/perf) | |
A100-40GB | 40GB | Large model training | |
A100-80GB | 80GB | Very large models | |
H100 | 80GB | Fastest, FP8 + Transformer Engine | |
H200 | 141GB | Auto-upgrade from H100, 4.8TB/s bandwidth | |
B200 | Latest | Blackwell architecture |
GPU specification patterns
Container images
Persistent storage
Web endpoints
FastAPI endpoint decorator
Full ASGI app
Web endpoint types
| Decorator | Use Case | |
|---|---|---|
@modal.fastapi_endpoint() | Simple function → API | |
@modal.asgi_app() | Full FastAPI/Starlette apps | |
@modal.wsgi_app() | Django/Flask apps | |
@modal.web_server(port) | Arbitrary HTTP servers |
Dynamic batching
Secrets management
Scheduling
Performance optimization
Cold start mitigation
Model loading best practices
Parallel processing
Common configuration
Debugging
Common issues
| Issue | Solution | |
|---|---|---|
| Cold start latency | Increase container_idle_timeout, use @modal.enter() | |
| GPU OOM | Use larger GPU (A100-80GB), enable gradient checkpointing | |
| Image build fails | Pin dependency versions, check CUDA compatibility | |
| Timeout errors | Increase timeout, add checkpointing |
References
- [Advanced Usage](references/advanced-usage.md) - Multi-GPU, distributed training, cost optimization
- [Troubleshooting](references/troubleshooting.md) - Common issues and solutions
Resources
- Documentation: https://modal.com/docs
- Examples: https://github.com/modal-labs/modal-examples
- Pricing: https://modal.com/pricing
- Discord: https://discord.gg/modal
Security
- Security scanPassed, 98 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/mlops/cloud/modal/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/graniet/kheish/modal)