SuperAPI AI 工具集

modal-compute-knowledge

部署与运维

查看项目

更新于 10-15 23:41

技能介绍

用途:提供 Modal.com 无服务器云平台的综合知识,面向运行 Python 代码、尤其是 AI/ML 工作负载的场景。当用户询问 Modal 平台功能、GPU 加速函数、无服务器容器配置、定价计费、CLI 命令、Web 端点与 API、定时任务、卷与密钥存储、并行处理、部署与 CI/CD 时激活。

主要能力:Modal 以 Python 代码定义一切,容器启动约 1 秒,支持自动扩缩容(缩到零、扩到数千),按秒计费,运行于 AWS、GCP、Oracle Cloud Infrastructure。核心组件包括 App 与 Function 装饰器(可配置 image、gpu、cpu、memory、timeout、retries、secrets、volumes、schedule、concurrency_limit、container_idle_timeout 等)、镜像构建(debian_slim、from_dockerfile、from_registry,pip_install、uv_pip_install、apt_install、run_commands、add_local_file/dir/python_source、env、run_function)、存储(Volume、Secret、Dict、Queue)、Web 端点(fastapi_endpoint、asgi_app、wsgi_app、web_server、自定义域名)、调度(Cron、Period)、并行处理(map、starmap、spawn)、容器生命周期类(@app.cls 配合 @modal.enter/@modal.method/@modal.exit)与并发控制。

使用方式:通过 modal run、modal serve、modal shell 开发调试,modal deploy 部署,modal app list/logs/stop 管理应用,modal volume 与 modal secret 管理资源,modal environment 管理环境。定时函数仅在 modal deploy 时运行,modal run 不触发。

适用场景:LLM 推理、批处理、定时 ETL 等。

限制:资料未提供官方文档链接与完整错误处理细节;定价与 GPU 成本为 2025 年数据,可能变动,请以官方为准。