公司指南

Modal Labs

Modal Labs 是一家成立于 2021 年的纽约公司,运营着一个用于 AI 工作负载的无服务器云平台:开发者编写普通的 Python 代码,用装饰器标记函数,Modal 就会在按需启动并按秒计费的容器和 GPU 上运行这些函数。

听听这个指南AI叙述 · ~8 min

在本页阅读时间 9 分钟
  1. 概述
  2. 主要要点
  3. 深入探讨
  4. 在 Modal 上部署小型 GPU 函数
  5. 现实世界的实施
  6. 模态实验室的未来
  7. 付诸实践
  8. 资料来源与延伸阅读
  9. 不断探索
  10. 常见问题

概述

它被用于模型推理、批处理作业、训练以及为 AI 智能体提供安全的沙盒环境,并于 2026 年 10 月报告称其年度运行率已超过 10 亿美元。

主要要点

  1. Modal Labs 运营着一个无服务器云平台,开发者可以在 Python 代码中定义容器、GPU 和扩展策略,并按计算秒数付费。
  2. Erik Bernhardsson 和 Akshat Bubna 于 2021 年创立了 Modal,并于 2023 年 10 月通过 1600 万美元的 A 轮融资正式发布。
  3. Modal 在 2026 年 10 月宣布以 157.5 亿美元的估值完成 7.5 亿美元的 D 轮融资,并表示其年度运行率已超过 10 亿美元。
  4. 其产品涵盖推理、批处理作业、多节点训练以及 AI 智能体可以安全执行生成代码的隔离沙盒。
  5. 冷启动(即启动容器和加载模型权重所需的时间)是 Modal 无服务器 GPU 模型主要的延迟权衡点。

深入探讨

Modal Labs, usually called Modal, sells cloud computing for AI software without requiring customers to manage servers. Its pitch is that running a model on a GPU should feel like calling a Python function. A developer writes a normal Python file, adds a decorator such as @app.function with arguments that name the container image and GPU type, and runs a command. Modal packages the code into a container, finds a machine with the right hardware, runs the function, and shuts the container down when it is no longer needed. Its documentation states that configuration lives entirely in code, with no YAML files, and that users do not need their own Kubernetes cluster, Docker setup or AWS account.

Under the hood the workflow has several stages. First, the developer defines an image, a description of the container environment such as a base Python version and the packages to install. Second, Modal builds that image once and caches it. Third, when the function is called, from a laptop, a web endpoint, a schedule or another function, Modal's scheduler places a container on a worker machine with the requested CPU, memory and GPU. Fourth, the container runs any setup code, such as loading model weights, and then processes inputs. If requests pile up, the autoscaler adds containers; when they stop, idle containers shut down, by default after 60 seconds. This pattern is called serverless because the user never provisions or keeps a server running. Modal says it pools capacity across multiple clouds, more than 20 according to its October 2026 post, and chooses where to run each workload based on availability and cost.

The company was founded in 2021 by Erik Bernhardsson, its CEO, and Akshat Bubna, its CTO, according to TechCrunch. Bernhardsson spent more than 15 years building data teams, including at Spotify and as CTO of the mortgage lender Better.com; Bubna studied math and computer science at MIT and was an early engineer at Scale AI. Modal left beta and announced general availability on October 10, 2023, alongside a $16 million Series A led by Redpoint Ventures, bringing total funding to $23 million. Early customers named then included Ramp and Substack.

Growth accelerated with demand for AI inference. On September 29, 2025, Modal announced an $87 million Series B led by Lux Capital at a $1.1 billion post-money valuation, saying it served thousands of customers and ran inference on thousands of GPUs. TechCrunch reported a $355 million round at a $4.65 billion valuation in May 2026, and that Modal had told Reuters its annualized revenue had passed $300 million. On October 14, 2026, Modal announced a $750 million Series D led by Accel at a $15.75 billion post-money valuation, stating that it had crossed $1 billion in annualized run rate, that usage had tripled since its previous round, and that it employed more than 200 people across New York, San Francisco and Stockholm.

Modal's products fall into four groups. Inference covers serving large language models, image and video generators and custom models behind web endpoints, with support for open-source serving engines such as vLLM and SGLang. Sandboxes are isolated, short-lived environments where AI agents can execute code they wrote; Modal said in October 2026 that Sandboxes alone was a $300 million run-rate product and that close to 3 billion had been created. Batch runs large parallel jobs such as transcription. Training provides multi-node GPU clusters connected with RDMA networking, a high-speed link that lets GPUs on different machines exchange data directly, without a long-term capacity commitment.

Compared with alternatives, Modal sits between raw infrastructure and fully managed model APIs. Renting GPU virtual machines by the hour gives full control but leaves the customer to install drivers, manage scaling and pay for idle time. Running Kubernetes gives flexibility but demands an operations team. Model API providers serve popular models through a fixed interface but offer less control over custom code. Modal's approach suits teams that want to run their own code and models with little infrastructure work. TechCrunch's 2026 coverage places it in a crowded inference market alongside Baseten, Fireworks and Fal, and notes that margins across the sector are thin because GPU compute is expensive to acquire or lease.

The trade-offs are concrete. Cold starts, the delay when a new container has to boot and load a model before serving, remain the main latency cost of serverless GPUs. Modal's documentation says containers boot in about a second, but loading tens of gigabytes of model weights can take much longer unless weights are baked into the image or stored on a Modal Volume, and keeping containers warm with settings like min_containers means paying for idle GPUs. Code is written against Modal's Python SDK, so moving to another platform requires changes. Per-second pricing is convenient for bursty workloads, but for a GPU that is busy around the clock, reserved capacity elsewhere can cost less. Capacity for the newest GPUs depends on Modal's supply across its cloud partners.

Pricing is published per second. As listed on Modal's pricing page in October 2026, an Nvidia H100 costs $0.001097 per second, about $3.95 per hour, an A100 80 GB costs $0.000694 per second, an L4 costs $0.000222 per second and a T4 costs $0.000164 per second, with CPU billed at $0.0000131 per physical core per second and memory at $0.00000222 per GiB per second. The free Starter plan includes $30 of compute credit per month for up to three seats, and the Team plan costs $250 per month with $100 of included credit.

04工作示例

在 Modal 上部署小型 GPU 函数

  1. 使用 pip install modal 安装客户端,并运行 modal setup 将命令行链接到免费 Starter 计划上的账户。

  2. 编写一个创建 modal.App 的文件,使用 pip_install 为 torch 和 transformers 定义一个镜像,并通过 @app.function(gpu='T4') 声明一个函数。

  3. 在函数内部,加载一个小型情感模型并返回其对输入文本的预测。

  4. 添加一个本地入口点,使用 .remote() 在一个句子上调用该函数,然后在该文件上运行 modal run。

  5. 将入口点更改为对 100 条句子调用 .map() 并再次运行,以观察 Modal 并行添加容器。

  6. 打开 Modal 仪表板以查看每个函数的运行时和计费的 GPU 秒数。

它显示了什么

该命令打印在云 T4 GPU 上计算的预测,无需任何服务器设置。通过将计费的 GPU 秒数乘以列出的 T4 费率 $0.000164 每秒来检查成本;第一次调用会显示冷启动,后续调用在容器保持热状态时会避免冷启动。

现实世界的实施

Meta 使用 Modal 运行数千个并发沙箱环境,以进行代码世界模型的强化学习工作,依据 Modal 2025 年 9 月的 B 轮融资公告。

Lovable,AI 应用构建器,使用 Modal 沙箱在隔离环境中运行其代理生成的代码,正如同一 2025 年公告所述。

Suno,这款 AI 音乐生成器,以及 Runway,这家 AI 视频公司,被 Modal 列为在其平台上运行生成工作负载的客户,见其 2026 年 10 月的 D 轮融资公告。

包括 Physical Intelligence 和 1X 在内的机器人公司,以及如 Chai Discovery 等药物发现公司,根据公司 2026 年的公告,在 Modal 上训练或运行模型。

研究人员可以通过对输入列表调用装饰过的 Python 函数,在许多 GPU 上并行运行转录或蛋白质折叠批处理作业,然后仅为实际使用的秒数付费。

模态实验室的未来

Modal's October 2026 announcement says it plans more products for reinforcement learning and post-training, the stages where AI models are refined after initial pretraining, and that its multi-node training clusters require no capacity commitment. Sandboxes for AI agents are its fastest-described growth area, reported at a $300 million run rate, and its July 2026 engineering post described a new scheduler, then in opt-in beta, intended eventually to handle all sandbox scheduling. The broader context is a fast-growing and competitive inference market. TechCrunch reported in September 2026 that several inference providers were raising at sharply higher valuations, while noting that thin margins from expensive GPU supply are a structural challenge. Open questions for Modal include whether it can keep securing scarce GPU capacity across its cloud partners, whether per-second serverless pricing stays competitive for steady, high-utilization workloads, and how agent sandboxes evolve as more AI products run generated code. The company's financial figures, including run rate, are self-reported by a private company and have not been independently audited in public filings.

付诸实践

为什么这很重要

  • 供应商策略. 供应商路线图会影响您的团队接下来可以构建的功能。
  • 成本与预算. 商业条款和部署选项会影响长期成本和风险。
  • 风险与安全. 公司激励措施塑造了产品默认、安全态势和开放性。

留意

  • 发布公告可能会超过实际生产工作流程的稳定性。
  • API 定价或政策转变可能会在一夜之间打破假设。
  • 单一供应商依赖性增加了锁定和迁移成本。

后续步骤

  1. 使用您自己的任务和数据集评估提供商。
  2. 在集成之前查看隐私、安全和法律条款。
  3. 维护跨模型或供应商的后备计划。
  4. 监控发行说明,以便路线图的更改不会让团队感到意外。

资料来源与延伸阅读

  1. Modal新闻稿:Modal Labs 宣布 A 轮融资
  2. Modal宣布我们的 8700 万美元 B 轮融资
  3. ModalD 轮:年化运行率 10 亿美元,新融资,以及 Modal 的下一步计划
  4. TechCrunch来源:推理提供商 Modal Labs 接近 7.5 亿美元融资,估值 157.5 亿美元
  5. ModalModal 定价
  6. ModalModal 文档指南
  7. Modal冷启动性能
  8. Modal在秒级内扩展至 100 万并发沙箱

不断探索

免费通讯

获取每日AI简报

每个工作日早晨提供三条经过验证的AI故事,使用简明英文撰写。永久免费,无广告。

每个工作日发送一封邮件。一键退订。我们永不出售或分享您的地址。

测试一下自己

参加 Modal Labs 测验

每个答案即时反馈,课程通过后可获得可验证ID的可分享证书。

开始测验

支持免费AI教育。AI Understanding是一家501(c)(3)非营利组织——无广告,无付费墙,永不收费。 捐款

常见问题

什么是模态实验室?

Modal Labs 是一家成立于 2021 年的纽约公司,运营用于 AI 工作负载的无服务器云:开发者编写普通 Python,使用装饰器标记函数,Modal 在按需启动的容器和 GPU 上运行它们,并按秒计费。它用于模型推理、批处理作业、训练和 AI 代理的安全代码沙箱,并在 2026 年 10 月报告年化运行率突破 10 亿美元。

开发人员通常如何在 Modal 上运行代码?

Modal 允许您通过装饰普通 Python 函数来定义和运行云函数,包括在 GPU 上。

Modal 专门为解决哪些著名的无服务器问题而设计?

Modal 构建了自定义容器运行时和延迟加载文件系统,以实现亚秒级冷启动,这是一个典型的无服务器痛点。

Modal 如何计算计算费用?

对实际消耗的计算按每秒模态收费,并且可以在空闲时将容器扩展到零。

谁是 Modal 的联合创始人,并以 Luigi 和 Annoy 等早期开源工具而闻名?

Modal 由 Erik Bernhardsson 共同创立,他之前因开发 Spotify 的 Annoy 和 Luigi 工作流程工具而闻名。

Modal 上的“缩放至零”是什么意思?

当没有请求时,Modal 会缩减至零个正在运行的容器,因此在流量恢复之前您不会产生任何计算成本。