跳到正文
Vercel Blog(vercel.com)· Tom Lienard·· 13 天前精選AI 評分60

Vercel Drives 正式推出通用可用性版本

Vercel Drives is now generally available

AI 導讀

Vercel 宣佈 Vercel Drives 現已於 Hobby、Pro 與 Enterprise 方案的 Vercel Sandbox 中正式推出通用可用性版本,提供持久化儲存功能。

推薦理由

原文說明 Vercel Drives 的通用可用性與持久化儲存功能,讀者可藉此評估如何跨沙盒保留工作區與資料集。

正文 · 原文

Vercel Drives is now generally available for Vercel Sandbox on Hobby, Pro, and Enterprise.

A Drive is persistent storage that you mount as a directory in a Vercel Sandbox. Its files remain available after the sandbox stops, so later runs and other sandboxes can access them by mounting the same Drive.

Use Drives to preserve an agent’s workspace or file-based memory across runs, or to make datasets, models, dependencies, and build artifacts available across sandboxes.

You can also fork a Drive into independent writable Drives. Forks inherit the source Drive's data, region, and maximum size, then store their own changes. Parallel workers can start with the same files and make changes without affecting the original or one another.

import { Sandbox, Drive } from '@vercel/sandbox';

const drive = await Drive.get({ name: 'base-drive' })

for (let i = 0; i < 2; i++) {

const fork = await drive.fork({ name: `worker-${i}` })

const sandbox = await Sandbox.create({

mounts: {

'/data': fork,

}

})

// Run the session, then delete the fork

await fork.delete()

}

Start parallel workers from the same saved workspace while keeping their changes isolated.

Learn more in the Drives documentation.

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