modal
यह क्या करती है
Modal एक क्लाउड प्लेटफ़ॉर्म है जिसमें आप अपना Python कोड चला सकते हैं, खासकर AI और मशीन लर्निंग के काम के लिए, शक्तिशाली कंप्यूटर (GPU समेत) का उपयोग करके, बिना सर्वर संभाले।
कब इस्तेमाल करें
- ✓जब आपको शक्तिशाली GPU पर AI मॉडल ट्रेन या चलाने हों।
- ✓ऐसी ऑनलाइन सेवाएँ बनाने के लिए जो अनुरोधों का जवाब दें, जैसे कोई वेबसाइट या ऐप।
- ✓नियमित रूप से चलने वाले दोहराव वाले कामों को क्लाउड में अपने आप चलाने के लिए।
Skill का लिंक
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/modal/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं Nvidia H100 GPU का उपयोग करके एक मूवी रिकमेंडेशन AI मॉडल ट्रेन करना चाहता हूँ और नतीजे persistent storage में सेव करना चाहता हूँ।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
आप अपना Python कोड लिखते हैं और Modal के टूल से बताते हैं कि आपको किन संसाधनों की ज़रूरत है (जैसे GPU या स्टोरेज)। Modal क्लाउड सर्वरों पर आपका कोड चलाने का काम संभालता है और ज़रूरत के हिसाब से अपने आप स्केल करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Modal
Overview
Modal is a cloud platform for running Python code serverlessly, with a focus on AI/ML workloads. Key capabilities:
- GPU compute on demand (including H100, H200, B200 and B300)
- Serverless functions with autoscaling from zero to thousands of containers
- Custom container images built entirely in Python code
- Persistent storage via Volumes for model weights and datasets
- Web endpoints for serving models and APIs
- Scheduled jobs via cron or fixed intervals
- Container reuse and warm pools to reduce cold starts (model loading still takes time)
Modal Apps and Images are defined in Python; existing Dockerfiles are also supported.
When to Use This Skill
Use this skill when:
- Deploy or serve AI/ML models in the cloud
- Run GPU-accelerated computations (training, inference, fine-tuning)
- Create serverless web APIs or endpoints
- Scale batch processing jobs in parallel
- Schedule recurring tasks (data pipelines, retraining, scraping)
- Need persistent cloud storage for model weights or datasets
- Want to run code in custom container environments
- Build job queues or async task processing systems
Installation and Authentication
Install
uv pip install "modal==1.6.0"
Reviewed against SDK 1.6.0 and current release notes. Local SDK construction and selected handlers were tested; remote builds, deployments, GPU inference and cloud limits were not executed. Snippets using model/data placeholders or third-party workloads are illustrative and require their stated dependencies.
Authenticate
Prefer existing credentials before creating new ones. Only the two Modal-specific
variables below are relevant — do not read, load, or expose any other environment
variables or .env file contents:
- Reuse an existing Modal profile, or check whether both
MODAL_TOKEN_IDandMODAL_TOKEN_SECRETare set; report presence only. - If not, look up only those two keys in a local
.envfile (ignore all other entries) and load them if appropriate for the workflow. - Only fall back to interactive
modal setupif no usable profile or token pair exists. The SDK supports profiles in.modal.toml; environment tokens are optional when a profile authenticates.
modal setup
This opens a browser for authentication. For CI/CD or headless environments, use environment variables:
export MODAL_TOKEN_ID=<your-token-id>
export MODAL_TOKEN_SECRET=<your-token-secret>
If neither an existing profile nor a token pair is available, create credentials at https://modal.com/settings
Check current pricing and workspace quotas before sizing a run. GPU use requires a payment method even when credits remain.
Reference: See references/getting-started.md for detailed setup and first app walkthrough.
Core Concepts
App and Functions
A Modal App groups related functions. Functions decorated with @app.function() run remotely in the cloud:
import modal
app = modal.App("my-app")
@app.function()
def square(x):
return x ** 2
@app.local_entrypoint()
def main():
# .remote() runs in the cloud
print(square.remote(42))
Run with modal run script.py. Deploy with modal deploy script.py.
Reference: See references/functions.md for lifecycle hooks, classes, .map(), .spawn(), and more.
Container Images
Modal builds container images from Python code. The recommended package installer is uv:
image = (
modal.Image.debian_slim(python_version="3.11")
.uv_pip_install("torch==2.12.0", "transformers==5.9.0", "accelerate==1.13.0")
.apt_install("git")
)
@app.function(image=image, gpu="L40S")
def inference(prompt):
from transformers import pipeline
pipe = pipeline("text-generation", model="openai-community/gpt2", device=0)
return pipe(prompt)
Key image methods:
.uv_pip_install()— Install Python packages with uv (recommended).pip_install()— Install with pip (fallback).apt_install()— Install system packages.run_commands()— Run shell commands during build.run_function()— Run Python during build (e.g., download model weights).add_local_python_source()— Add local modules.env()— Set environment variables
Reference: See references/images.md for Dockerfiles, micromamba, caching, GPU build steps.
GPU Compute
Request GPUs via the gpu parameter:
…
अक्सर पूछे जाने वाले सवाल
Modal कैसे सेट करें?
आप `uv pip install "modal==1.6.0"` से Modal इंस्टॉल कर सकते हैं, फिर अपने टर्मिनल में `modal setup` से प्रमाणीकरण (authenticate) कर सकते हैं, जो एक ब्राउज़र खोलेगा। या अपने टोकन के साथ एनवायरनमेंट वेरिएबल सेट करके भी यह हो सकता है।
'सर्वरलेस फ़ंक्शन' क्या होते हैं?
ये ऐसे कोड के टुकड़े हैं जिन्हें Modal ज़रूरत पड़ने पर क्लाउड में चलाता है। आपको सर्वर चालू या बंद करने की चिंता नहीं करनी पड़ती; जब कोड को चलना होता है, Modal यह अपने आप करता है।
क्या मैं अपने खुद के Docker कंटेनर इस्तेमाल कर सकता हूँ?
हाँ, Modal आपके अपने Docker कंटेनर इस्तेमाल करने देता है, या Python कोड में सीधे नए कंटेनर बनाने देता है, जिससे आपके ऐप्स के लिए एनवायरनमेंट सेट करना आसान हो जाता है।
जानकारी
लेखक का मूल विवरण
Modal is a serverless cloud platform for running Python on demand, including on-demand GPUs. Use when deploying or serving AI/ML models, running GPU-accelerated workloads (training, fine-tuning, inference), serving web endpoints, scheduling batch jobs, or scaling Python code to cloud containers with the Modal SDK.
लोकप्रियता
- GitHub स्टार
- 51k
- रैंकिंग में स्थान
- #3499
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
13c-metabolic-flux
51kकार्बन-13 आइसोटोप ट्रेसिंग डेटा से मेटाबोलिक फ़्लक्स का अनुमान लगाता है। कोशिका के मेटाबॉलिज़्म और बायोकेमिकल मार्गों का विश्लेषण करने के लिए यह उपयोगी है।
adaptyv
51kAdaptyv API का उपयोग करके प्रोटीन कैरेक्टराइज़ेशन प्रयोग डिज़ाइन करता है। लागत का अनुमान लगाने, सीक्वेंस सबमिट करने और लैब के नतीजों पर नज़र रखने में मदद करता है।
aeon
51kटाइम सीरीज़ डेटा पर मशीन लर्निंग के काम करता है। क्रमबद्ध डेटा में वर्गीकरण, पूर्वानुमान, एनोमली डिटेक्शन और पैटर्न खोजने के लिए यह उपयोगी है।
alphagenome
51kजेनेटिक वेरिएंट्स के पहले से गणना किए गए जीनोमिक प्रभाव देखता है। वेरिएंट का जीनोम पर असर समझने के लिए स्कोर और स्पष्टीकरण देता है।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।