跳到正文
Vercel Blog(vercel.com)· Yury Selivanov·· 22 小時前精選AI 評分72

Vercel 現已正式支援 Python,全面開放使用

Python on Vercel is now generally available

AI 導讀

Vercel 現已正式支援 Python,提供全功能的後端與前端一體化部署環境。

  • 框架自動識別:FastAPI、Flask、Django 皆可即時配置,靜態資源透過 Vercel CDN 服務。
推薦理由

Vercel 讓 Python 開發者可在同一平臺部署前後端,簡化全棧開發流程;同時提供原生 SDK、AI 工具包與工作流程管理,降低部署成本與運維複雜度。

正文 · 原文

Python is now a first-class language and runtime on Vercel. Build APIs, full-stack applications, and AI agents with native Python SDKs and a shared development and deployment workflow for your Python backend and JavaScript frontend.

Python framework and runtime support

Vercel handles the infrastructure so you can focus on your application:

  • Automatic framework support: FastAPI, Flask, and Django applications are automatically recognized and configured, with framework-specific support for serving static assets through the Vercel CDN.

  • Native Python runtime and tooling: Vercel runs CPython on Linux and supports uv and pyproject.toml for dependency management.

  • Compute for APIs and workers: Scale request-driven applications with Fluid compute and run long-running pull-based workloads with Vercel Daemons.

Native Python SDKs

Within your application, Python SDKs let you build agents, run untrusted code, and orchestrate durable workflows.

  • Sandbox: Give your application or agent an isolated Linux VM on demand.

  • AI SDK for Python (Beta): Generate or stream model responses and call tools. Get started with uv add ai.

  • Workflow SDK for Python (Beta): Persist execution state and retry failed workflow steps.

  • Queues (Beta): Send and receive messages for background work.

  • Connect: Obtain credentials for calling external APIs.

  • Blob: Upload and retrieve files in object storage.

Use the SDKs individually or combine them in the same Python application.

Your frontend and backend, together

For full-stack applications, Vercel Services allows you to deploy your frontend and backends together in one project, with shared previews and atomic deployments and rollbacks. Within that project, you can view logs by service and connect backends privately through service bindings.

For a frontend in frontend/ and a FastAPI app defined in backend/main.py, add this vercel.toml at the repository root.

Requests under /api/ reach matching FastAPI routes with the path unchanged, while other requests reach the frontend. Run both services locally with vercel dev, then deploy them together from the same repository.

Read the Python documentation to get started.

Read more

來源: Vercel Blog (vercel.com)
開啟原文