> ## Documentation Index
> Fetch the complete documentation index at: https://ppio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 自定义 CPU 和 RAM 规格

export const SandboxCliConfigHint = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    return <Note>在运行本文档中命令行相关的示例代码前，请参考 <Link href="/sandbox/cli">教程</Link> 来进行安装 PPIO 沙箱命令行工具，并完成  <Link href="/sandbox/cli-auth">认证</Link>。</Note>;
  }
};

您可以通过 PPIO 沙箱命令行工具来自定义沙箱模板的 CPU 和 RAM 规格。

<SandboxCliConfigHint />

您需要先创建一个 <Link href="/sandbox/sandbox-template">沙箱模板</Link>。

在构建步骤中，您可以指定沙箱模板的 vCPU 和 RAM 规格。

以下命令将创建一个具有 2 vCPU、2GB RAM 的沙箱模板。

```bash Bash icon="terminal" theme={null}
ppio-sandbox-cli template build -c "/root/.jupyter/start-up.sh" --cpu-count 2 --memory-mb 2048
```

## 通过配置文件

您也可以在运行 `ppio-sandbox-cli template build` 命令的同一目录下的 `ppio.toml` 文件内指定沙箱模板的 vCPU 和 RAM 规格。

```toml Toml icon="gear" theme={null}
template_id = "0r0efkbfwzfp9p7qpc1c"
dockerfile = "ppio.Dockerfile"
template_name = "my-agent-sandbox"
ready_cmd = "<your-ready-command>"
# 指定沙箱模板 vCPU 和 RAM 规格为 2 vCPU、2GB RAM
cpu_count = 2
memory_mb = 2_048
```
