> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # Vercel서버리스샌드박스 다음과 같이 명령을 실행합니다.[Vercel](https://vercel.com)서버리스 기능. 자동 확장을 통해 전역적으로 분산된 제로 인프라 실행을 제공합니다. 인터페이스에 대한 자세한 내용은 다음을 참조하세요.[WorkspaceSandbox 인터페이스](https://mastra.zisheng.pro/ko/reference/workspace/sandbox). > **경고:** VercelServerlessSandbox는 상태를 유지하지 않습니다. 영구 파일 시스템, 대화형 셸 또는 장기 실행 백그라운드 프로세스를 제공하지 않습니다. `/tmp`에만 쓸 수 있으며 호출 간에는 유지되지 않습니다. > **노트:** 영구 파일 시스템, `sudo` 액세스, 노출된 포트 및 백그라운드 프로세스를 갖춘 전체 Linux MicroVM이 필요하면 [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) 제품을 기반으로 하는 [`VercelSandbox`](https://mastra.zisheng.pro/ko/reference/workspace/vercel-sandbox)를 사용하세요. ## 설치 **npm**: ```bash npm install @mastra/vercel ``` **pnpm**: ```bash pnpm add @mastra/vercel ``` **Yarn**: ```bash yarn add @mastra/vercel ``` **Bun**: ```bash bun add @mastra/vercel ``` ## 용법 Workspace에 `VercelServerlessSandbox`를 추가하고 Agent에 할당합니다. ```typescript import { Agent } from '@mastra/core/agent' import { Workspace } from '@mastra/core/workspace' import { VercelServerlessSandbox } from '@mastra/vercel' const workspace = new Workspace({ sandbox: new VercelServerlessSandbox({ token: process.env.VERCEL_TOKEN, }), }) const agent = new Agent({ id: 'dev-agent', name: 'dev-agent', instructions: 'You are a coding assistant working in this workspace.', model: 'anthropic/claude-sonnet-4-6', workspace, }) ``` ### 커스텀 리소스를 사용한 팀 범위 배포 ```typescript const workspace = new Workspace({ sandbox: new VercelServerlessSandbox({ token: process.env.VERCEL_TOKEN, teamId: 'team_abc123', regions: ['iad1', 'sfo1'], maxDuration: 120, memory: 3008, env: { NODE_ENV: 'production', }, }), }) ``` ## 생성자 매개변수 **token** (`string`): Vercel API 토큰입니다. 지정하지 않으면 VERCEL\_TOKEN 환경 변수를 사용합니다. **teamId** (`string`): 팀 범위 배포에 사용할 Vercel 팀 ID입니다. **projectName** (`string`): 기존 Vercel 프로젝트 이름입니다. 생략하면 자동 생성됩니다. **regions** (`string[]`): 배포 리전입니다. (Default: `['iad1']`) **maxDuration** (`number`): Function의 최대 실행 시간(초)입니다. (Default: `60`) **memory** (`number`): Function 메모리(MB)입니다. (Default: `1024`) **env** (`Record`): 배포된 Function 소스에 포함되는 환경 변수입니다. 동적으로 설정되지 않고 배포 시점에 포함됩니다. **commandTimeout** (`number`): 호출별 명령 제한 시간(밀리초)입니다. (Default: `55000`) **instructions** (`string | ((opts) => string)`): getInstructions()가 반환하는 기본 지침을 재정의하는 사용자 지정 지침입니다. 문자열을 전달해 완전히 대체하거나 함수를 전달해 기본값을 확장합니다. **onStart** (`SandboxLifecycleHook`): Sandbox가 running 상태에 도달한 후 호출되는 수명 주기 훅입니다. **onStop** (`SandboxLifecycleHook`): Sandbox가 중지되기 전에 호출되는 수명 주기 훅입니다. **onDestroy** (`SandboxLifecycleHook`): Sandbox가 폐기되기 전에 호출되는 수명 주기 훅입니다. ## 속성 **id** (`string`): 이 Sandbox 인스턴스의 고유 식별자입니다. **name** (`'VercelServerlessSandbox'`): 사람이 읽을 수 있는 이름입니다. **provider** (`'vercel-serverless'`): Provider 유형 식별자입니다. **status** (`ProviderStatus`): 현재 수명 주기 상태입니다: 'pending', 'starting', 'running', 'stopping', 'stopped', 'destroying', 'destroyed' 또는 'error'. ## 제한사항 VercelServerlessSandbox는 내부적으로 서버리스 기능을 사용합니다. 이는 다음을 의미합니다. - **영구 파일 시스템 없음**: `/tmp`에 작성된 파일은 일시적이며 호출 사이에 삭제됩니다. - **대화형 셸 없음**: 명령은 stdin 스트리밍 없이 `/bin/sh -c`를 통해 실행됩니다. - **백그라운드 프로세스 없음**: 프로세스 관리자, PID 또는 장기 실행 작업을 지원하지 않습니다. - **마운트 없음**: 클라우드 스토리지 마운트(S3, GCS)는 지원되지 않습니다. - **시간 초과 제한**: 최대 실행 시간은 `maxDuration`으로 제한됩니다(기본값 60초). ## 관련된 - [WorkspaceSandbox 인터페이스](https://mastra.zisheng.pro/ko/reference/workspace/sandbox) - [작업실 수업](https://mastra.zisheng.pro/ko/reference/workspace/workspace-class) - [E2B샌드박스](https://mastra.zisheng.pro/ko/reference/workspace/e2b-sandbox): 지속적인 파일 시스템 및 프로세스 관리 기능을 갖춘 모든 기능을 갖춘 클라우드 샌드박스