modal
Qué hace
Modal es una plataforma en la nube que te permite ejecutar tu código de Python, sobre todo para tareas de IA y aprendizaje automático, usando ordenadores potentes (incluidas GPU) sin tener que gestionar servidores.
Cuándo usarla
- ✓Cuando necesitas entrenar o ejecutar modelos de IA con GPU potentes.
- ✓Para crear servicios en línea que respondan a peticiones, como una web o una aplicación.
- ✓Para automatizar tareas repetitivas que deben ejecutarse periódicamente en la nube.
Link de la skill
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/modal/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Quiero entrenar un modelo de IA de recomendación de películas usando una GPU Nvidia H100 y guardar los resultados en almacenamiento persistente.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Escribes tu código de Python y usas las herramientas de Modal para indicar los recursos que necesitas (como GPU o almacenamiento). Modal se encarga de ejecutar tu código en servidores en la nube, escalando automáticamente según haga falta.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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:
…
Preguntas frecuentes
¿Cómo configuro Modal?
Puedes instalar Modal con `uv pip install "modal==1.6.0"` y luego autenticarte con `modal setup` en la terminal, lo que abrirá el navegador; o bien configurar variables de entorno con tu token.
¿Qué son las 'funciones sin servidor'?
Son fragmentos de código que Modal ejecuta en la nube cuando se necesitan. No tienes que preocuparte por encender o apagar servidores: Modal lo hace automáticamente cuando tu código lo requiere.
¿Puedo usar mis propios contenedores de Docker?
Sí, Modal te permite usar tus propios contenedores de Docker o crear otros directamente en el código de Python, lo que facilita preparar el entorno de tus aplicaciones.
Detalles
Descripción original del autor
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.
Popularidad
- Estrellas en GitHub
- 51 mil
- Posición en el ranking
- #3499
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
13c-metabolic-flux
51 milEstima flujos metabólicos a partir de datos de trazado con isótopos de carbono-13. Es útil para analizar el metabolismo celular y las rutas bioquímicas.
adaptyv
51 milDiseña experimentos de caracterización de proteínas con la API de Adaptyv. Ayuda a estimar costos, enviar secuencias y seguir los resultados del laboratorio.
aeon
51 milRealiza tareas de aprendizaje automático con datos de series temporales. Es útil para clasificar, predecir, detectar anomalías y encontrar patrones en datos secuenciales.
alphagenome
51 milConsulta efectos genómicos precalculados de variantes genéticas. Ofrece puntuaciones y explicaciones para entender el impacto de las variantes en el genoma.
Skills parecidas
openclaw-update
394 milAyuda a tu agente a actualizar una Gateway de OpenClaw que ya existe, eligiendo el método de actualización que encaja con cómo se instaló y manteniendo tu sesión activa.
diagnose-gateway
394 milAyuda a tu agente a averiguar por qué falla tu Gateway de OpenClaw, revisando ajustes, canales y puertos sin cambiar nada.
crabbox-apps
394 milAyuda a tu agente a abrir y ejecutar una app en una máquina temporal en la nube y mostrar su vista en el panel lateral de tu chat.