Indexed from modal-examples. Use the slug to pin an example on an event.
| Slug | Title | Themes | GPU | Run |
|---|---|---|---|---|
generators | Run a generator function on Modal | modal run 01_getting_started/generators.py | ||
hello_world | Hello, world! | getting_started, batch | modal run 01_getting_started/hello_world.py | |
install_cuda | Installing the CUDA Toolkit on Modal | web | T4 | modal run 02_building_containers/install_cuda.py |
install_flash_attn | Install Flash Attention on Modal | vision | L40S | modal run 02_building_containers/install_flash_attn.py |
basic_grid_search | Hyperparameter search | rag, vision, getting_started | modal run 03_scaling_out/basic_grid_search.py | |
cls_with_options | Override Modal resource options (GPU, scaling) at runtime with `Cls.with_options` | T4 | modal run 03_scaling_out/cls_with_options.py | |
dynamic_batching | Dynamic batching for ASCII and character conversion | batch | modal run 03_scaling_out/dynamic_batching.py | |
db_to_sheet | Write to Google Sheets from Postgres | web | modal deploy 04_secrets/db_to_sheet.py | |
hackernews_alerts | Run cron jobs in the cloud to search Hacker News | rag, vision | modal run 05_scheduling/hackernews_alerts.py | |
schedule_simple | Scheduling remote jobs | getting_started | modal run 05_scheduling/schedule_simple.py | |
whisperx_transcribe | WhisperX transcription with word-level timestamps | speech, vision | H100 | modal run 06_gpu_and_ml/audio-to-text/whisperx_transcribe.py |
esmfold2_binder_design | Design protein binders at scale with ESMFold2 and ESMC | H100 | modal run 06_gpu_and_ml/binder-design/esmfold2_binder_design.py | |
blender_video | Render a video with Blender on many GPUs or CPUs in parallel | vision, batch | L40S | modal run 06_gpu_and_ml/blender/blender_video.py |
controlnet_gradio_demos | Play with the ControlNet demos | vision, web | A10G | modal run 06_gpu_and_ml/controlnet/controlnet_gradio_demos.py |
amazon_embeddings | Embed 30 million Amazon reviews at 575k tokens per second with Qwen2-7B | rag, batch, llm | L40S | modal run 06_gpu_and_ml/embeddings/amazon_embeddings.py |
image_embeddings_infinity | Modal Cookbook: Recipe for Inference Throughput Maximization | rag, batch, vision | gpu | modal run 06_gpu_and_ml/embeddings/image_embeddings_infinity.py |
liquidai_embeddings_server | Serve Liquid AI ColBERT embeddings with llama.cpp and Modal Servers | rag, batch, llm | modal run 06_gpu_and_ml/embeddings/liquidai_embeddings_server.py | |
gpu_fallbacks | Set "fallback" GPUs | subprocess | modal run 06_gpu_and_ml/gpu_fallbacks.py | |
gpu_snapshot | Snapshot GPU memory to speed up cold starts | a10 | modal deploy 06_gpu_and_ml/gpu_snapshot.py | |
hp_sweep_gpt | Train an SLM from scratch with early-stopping grid search over hyperparameters | llm, vision, rag | A10G | modal run 06_gpu_and_ml/hyperparameter-sweep/hp_sweep_gpt.py |
image_to_video | Animate images with Lightricks LTX-Video via CLI, API, and web UI | vision, web | H100 | modal run 06_gpu_and_ml/image-to-video/image_to_video.py |
potus_speech_qanda | Retrieval-augmented generation (RAG) for question-answering with LangChain | rag, llm, speech | modal run 06_gpu_and_ml/langchains/potus_speech_qanda.py | |
chat_with_pdf_vision | Chat with PDF: RAG with ColQwen2 | llm, rag, vision | A100-80GB | modal run 06_gpu_and_ml/llm-serving/chat_with_pdf_vision.py |
deepseek_v4 | Serve DeepSeek V4 Pro on Modal with SGLang | llm, vision | f | modal run 06_gpu_and_ml/llm-serving/deepseek_v4.py |
deepseek_v4_flash | Deploy DeepSeek-V4-Flash with SGLang and Modal | llm | f | modal run 06_gpu_and_ml/llm-serving/deepseek_v4_flash.py |
gpt_oss_inference | Run OpenAI's gpt-oss model with vLLM | llm | f | modal run 06_gpu_and_ml/llm-serving/gpt_oss_inference.py |
inkling_small | Serve Inkling-Small on Modal with SGLang | llm, vision | f | modal run 06_gpu_and_ml/llm-serving/inkling_small.py |
lfm_snapshot | Low Latency, Serverless LFM2 with vLLM and Modal | llm, rag | GPU | modal run 06_gpu_and_ml/llm-serving/lfm_snapshot.py |
ministral3_inference | Serverless Ministral 3 with vLLM and Modal | llm, vision | f | modal run 06_gpu_and_ml/llm-serving/ministral3_inference.py |
nemotron_inference | Low latency Nvidia Nemotron 3 with SGLang and Modal | llm | GPU | modal run 06_gpu_and_ml/llm-serving/nemotron_inference.py |
sglang_low_latency | Low latency Qwen 3.6 with SGLang and Modal | llm | GPU | modal run 06_gpu_and_ml/llm-serving/sglang_low_latency.py |
sglang_snapshot | Serverless Qwen 3-8B with SGLang and Modal Snapshots | llm | GPU | modal run 06_gpu_and_ml/llm-serving/sglang_snapshot.py |
sglang_vlm | Serve the Qwen 3.6 Vision-Language Model with SGLang | llm, vision, web, getting_started | GPU | modal run 06_gpu_and_ml/llm-serving/sglang_vlm.py |
stepfun_inference | Run StepFun models with SGLang | llm | GPU | modal run 06_gpu_and_ml/llm-serving/stepfun_inference.py |
trtllm_latency | Serve an interactive language model app with low-latency TensorRT-LLM (LLaMA 3 8B) | llm | GPU | modal run 06_gpu_and_ml/llm-serving/trtllm_latency.py |
trtllm_throughput | Serverless TensorRT-LLM (LLaMA 3 8B) | llm | GPU | modal run 06_gpu_and_ml/llm-serving/trtllm_throughput.py |
very_large_models | Serve very large language models (DeepSeek V3, Kimi-K2, GLM 4.7/5) | llm, rag | f | modal run 06_gpu_and_ml/llm-serving/very_large_models.py |
vllm_inference | Run OpenAI-compatible LLM inference with Gemma and vLLM | llm, web | f | modal run 06_gpu_and_ml/llm-serving/vllm_inference.py |
vllm_low_latency | Low latency Qwen 3 8B with vLLM and Modal | llm, getting_started | GPU | modal run 06_gpu_and_ml/llm-serving/vllm_low_latency.py |
vllm_throughput | Run LLM inference at maximum throughput | llm, getting_started | GPU | modal run 06_gpu_and_ml/llm-serving/vllm_throughput.py |
long-training | Run long, resumable training jobs on Modal | training | a10g | modal run 06_gpu_and_ml/long-training.py |
fine_tune_asr | Fine-tune Whisper to Improve Transcription on Domain-Specific Vocab | speech, training | H100 | modal run 06_gpu_and_ml/openai_whisper/fine_tune_asr.py |
paint_flowers | Painting flowers with code | training, llm, vision | modal run 06_gpu_and_ml/paint_flowers/paint_flowers.py | |
boltz_predict | Fold proteins with Boltz-2 | H100 | modal run 06_gpu_and_ml/protein-folding/boltz_predict.py | |
chai1 | Fold proteins with Chai-1 | getting_started | H100 | modal run 06_gpu_and_ml/protein-folding/chai1.py |
esm3 | Build a protein folding dashboard with ESM3, Molstar, and Gradio | vision, web | A10G | modal run 06_gpu_and_ml/protein-folding/esm3.py |
esmfold2 | Fold proteins and biomolecular complexes with ESMFold2 | H100 | modal run 06_gpu_and_ml/protein-folding/esmfold2.py | |
isaac_lab | Train a robot in a simulated environment with Isaac Lab | training | f | modal run 06_gpu_and_ml/reinforcement-learning/isaac_lab.py |
mjlab_motion_imitation | Teach a humanoid to imitate motion with mjlab | training | A10 | modal run 06_gpu_and_ml/reinforcement-learning/mjlab_motion_imitation.py |
segment_anything | Run Facebook's Segment Anything Model 2 (SAM 2) on Modal | vision | A100 | modal run 06_gpu_and_ml/sam/segment_anything.py |
batched_whisper | Fast Whisper inference using dynamic batching | speech, batch | a10g | modal run 06_gpu_and_ml/speech-to-text/batched_whisper.py |
parakeet_multitalker | Parakeet Multi-talker Speech-to-Text | speech | modal run 06_gpu_and_ml/speech-to-text/parakeet_multitalker.py | |
sortformer2_1_speaker_diarization | Streaming Speaker Diarization with Sortformer2.1 | speech | L4 | modal run 06_gpu_and_ml/speech-to-text/sortformer2_1_speaker_diarization.py |
streaming_kyutai_stt | Stream transcriptions with Kyutai STT | speech | a10g | modal deploy 06_gpu_and_ml/speech-to-text/streaming_kyutai_stt.py |
streaming_parakeet | Streaming audio transcription using Parakeet | speech | a10g | modal run 06_gpu_and_ml/speech-to-text/streaming_parakeet.py |
flux | Run Flux fast on H100s with `torch.compile` | vision | H100 | modal run 06_gpu_and_ml/stable_diffusion/flux.py |
image_to_image | Edit images with Flux Kontext | vision, getting_started | B200 | modal run 06_gpu_and_ml/stable_diffusion/image_to_image.py |
text_to_image | Run Stable Diffusion 3.5 Large Turbo as a CLI, API, and web UI | vision, web, batch | H100 | modal run 06_gpu_and_ml/stable_diffusion/text_to_image.py |
swe_gym | Train coding agents | agents, sandboxes, training, web | modal run 06_gpu_and_ml/swe_gym/swe_gym.py | |
tensorflow_tutorial | TensorFlow tutorial | vision | T4 | modal run 06_gpu_and_ml/tensorflow/tensorflow_tutorial.py |
chatterbox_tts | Create a Chatterbox TTS API on Modal | speech, llm, web | a10g | modal run 06_gpu_and_ml/text-to-audio/chatterbox_tts.py |
generate_music | Make music with ACE-Step 1.5 | llm, vision | l40s | modal run 06_gpu_and_ml/text-to-audio/generate_music.py |
ltx | Generate videos from prompts with Lightricks LTX-Video | vision | H100 | modal run 06_gpu_and_ml/text-to-video/ltx.py |
ltx2_two_stage | High-quality text-to-video with LTX-2 | vision, training | H200 | modal run 06_gpu_and_ml/text-to-video/ltx2_two_stage.py |
mochi | Text-to-video generation with Mochi | vision | H100 | modal run 06_gpu_and_ml/text-to-video/mochi.py |
torch_profiling | Tracing and profiling GPU-accelerated PyTorch programs on Modal | modal run 06_gpu_and_ml/torch_profiling.py | ||
text_to_world | Generate 3D worlds from text with LTX-2.3 and InSpatio-World | vision, training | H200 | modal run 06_gpu_and_ml/world-models/text_to_world.py |
finetune_yolo | Fine-tune open source YOLO models for object detection | vision, training, batch | TRAIN | modal run 06_gpu_and_ml/yolo/finetune_yolo.py |
badges | Serve a dynamic SVG badge | vision, getting_started | modal run 07_web/badges.py | |
basic_web | Hello world wide web! | getting_started | h100 | modal run 07_web/basic_web.py |
count_faces | Run OpenCV face detection on an image | vision | modal run 07_web/count_faces.py | |
fastapi_app | Deploy FastAPI app with Modal | web | modal run 07_web/fastapi_app.py | |
fastrtc_flip_webcam | Run a FastRTC app on Modal | modal deploy 07_web/fastrtc_flip_webcam.py | ||
flask_app | Deploy Flask app with Modal | web | modal run 07_web/flask_app.py | |
flask_streaming | Deploy Flask app with streaming results with Modal | modal run 07_web/flask_streaming.py | ||
server | Deploy HTTP Servers with ultra low latency on Modal | llm | modal run 07_web/server.py | |
server_affinity | Affinity routing for Modal Servers | llm, getting_started | modal run 07_web/server_affinity.py | |
sessioned_chatroom | Build a sessioned chat room | llm | modal run 07_web/sessioned_chatroom.py | |
streaming | Deploy a FastAPI app with streaming responses | web | modal run 07_web/streaming.py | |
webrtc_yolo | Real-time object detection with WebRTC and YOLO | web, vision | A100-40GB | modal run 07_web/webrtc/webrtc_yolo.py |
generators_async | Run async generator function on Modal | modal run 08_advanced/generators_async.py | ||
hello_world_async | Async functions | getting_started | modal run 08_advanced/hello_world_async.py | |
parallel_execution | Parallel execution on Modal with `spawn` and `gather` | batch | modal run 08_advanced/parallel_execution.py | |
poll_delayed_result | Polling for a delayed result on Modal | modal run 08_advanced/poll_delayed_result.py | ||
dicts_and_queues | Use Modal Dicts and Queues together | modal run 09_job_queues/dicts_and_queues.py | ||
doc_ocr_jobs | Run a job queue that turns documents into structured data with Datalab Marker | vision | l40s | modal run 09_job_queues/doc_ocr_jobs.py |
doc_ocr_webapp | Serve a receipt parsing web app | web, vision | modal run 09_job_queues/doc_ocr_webapp.py | |
pipeline_orchestration | Orchestrate a multi-step pipeline with Modal Functions | modal deploy 09_job_queues/pipeline_orchestration.py | ||
web_job_queue_wrapper | Create a web wrapper for job queue, submission, polling, & results | llm, vision, web, getting_started | modal run 09_job_queues/web_job_queue_wrapper.py | |
algolia_indexer | Algolia docsearch crawler | rag | modal deploy 10_integrations/algolia_indexer.py | |
cron_datasette | Publish interactive datasets with Datasette | batch | modal deploy 10_integrations/cron_datasette.py | |
dbt_duckdb | Build your own data warehouse with DuckDB, DBT, and Modal | rag | modal deploy 10_integrations/dbt/dbt_duckdb.py | |
mcp_server_stateless | Deploy a remote, stateless MCP server on Modal with FastMCP | agents | modal run 10_integrations/mcp_server_stateless.py | |
multion_news_agent | MultiOn: Twitter News Agent | agents, web, vision | modal run 10_integrations/multion_news_agent.py | |
pushgateway | Publish custom metrics with Prometheus Pushgateway | web | modal deploy 10_integrations/pushgateway.py | |
s3_bucket_mount | Analyze NYC yellow taxi data with DuckDB on Parquet files from S3 | modal run 10_integrations/s3_bucket_mount.py | ||
serve_streamlit | Run and share Streamlit apps | web | modal deploy 10_integrations/streamlit/serve_streamlit.py | |
modal_tailscale | Add Modal Apps to Tailscale | modal run 10_integrations/tailscale/modal_tailscale.py | ||
webscraper | A simple web scraper | modal deploy 10_integrations/webscraper.py | ||
webscraper_old | Web Scraping on Modal | web | modal run 10_integrations/webscraper_old.py | |
agent | Build a coding agent with Modal Sandboxes and LangGraph | agents, llm, sandboxes | T4 | modal run 13_sandboxes/codelangchain/agent.py |
langserve | Deploy LangChain and LangGraph applications with LangServe | agents, web, sandboxes, llm | modal run 13_sandboxes/codelangchain/langserve.py | |
computer_use_vnc | Watch a Browser Use agent drive Chromium over VNC | agents, llm, sandboxes, web | modal run 13_sandboxes/cua/computer_use_vnc.py | |
harbor_evals | Run massively parallel evals on Modal Sandboxes | sandboxes, batch, llm, agents | modal run 13_sandboxes/harbor_evals.py | |
jupyter_sandbox | Run a Jupyter notebook in a Modal Sandbox | sandboxes, vision | None | modal run 13_sandboxes/jupyter_sandbox.py |
safe_code_execution | Run arbitrary code in a sandboxed environment | sandboxes, vision | modal run 13_sandboxes/safe_code_execution.py | |
sandbox_agent | Run Claude Code in a Modal Sandbox | sandboxes, agents, vision, getting_started | modal run 13_sandboxes/sandbox_agent.py | |
sandbox_pool | Maintain a pool of warm Sandboxes that are healthy and ready to serve requests | sandboxes | modal run 13_sandboxes/sandbox_pool.py | |
sandbox_secret_injection | Inject secrets into Sandbox HTTPS requests with an Outbound Policy | sandboxes, web, agents | modal run 13_sandboxes/sandbox_secret_injection.py | |
sidecar_agent | Separate an agent from its execution environment with Sidecars | agents, sandboxes | modal run 13_sandboxes/sidecar_agent.py | |
sidecar_redis | Test a web app with Redis in a Sidecar | sandboxes, vision | modal run 13_sandboxes/sidecar_redis.py | |
sidecar_secrets_injection | Inject Secrets into a Sandbox with a proxy Sidecar | sandboxes, web | modal run 13_sandboxes/sidecar_secrets_injection.py | |
sidecar_traffic_routing | Filter Sandbox HTTPS traffic with a proxy Sidecar | sandboxes, web | modal run 13_sandboxes/sidecar_traffic_routing.py | |
simple_code_interpreter | Build a stateful, sandboxed code interpreter | sandboxes | modal run 13_sandboxes/simple_code_interpreter.py | |
miles_grpo | Make LLMs better at math | training, llm, cluster | f | modal run 14_clusters/miles_grpo.py |
simple_torch_cluster | Simple PyTorch cluster | cluster, getting_started, training | GPU | modal run 14_clusters/simple_torch_cluster.py |