> ## Documentation Index
> Fetch the complete documentation index at: https://opencompass-docs-preview-pr-335-0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Modal

通过 Modal SDK 或 host 环境变量 `MODAL_TOKEN_ID` 与 `MODAL_TOKEN_SECRET` 配置认证；显式设置时需要同时提供两者。

## 配置

```bash theme={"system"}
export MODAL_TOKEN_ID="<your-token-id>"
export MODAL_TOKEN_SECRET="<your-token-secret>"
```

```bash theme={"system"}
agentcompass run <benchmark> <harness> "$MODEL_NAME" \
  --env modal \
  --env-params '{"setup":{"image":"python:3.13-slim"}}'
```

## Provider 参数

所有 provider 接受 [Environment 公共 schema](/zh/user_guide/modules/environments/configuration/overview) 以及各自声明的专属配置。通过下面的命令查看完整字段列表；专属配置与公共字段一起放在 `--env-params` 或 YAML 对应 provider 的扁平配置块中。镜像、资源、出站网络策略和环境变量仍使用统一入口，原生别名及未声明的键会报错。

```bash theme={"system"}
agentcompass config docs env modal
```

<a id="资源" />

使用 `resources`、`run_resources` 和 `evaluation_resources` 声明资源需求。不同 provider 的能力仍有差异：不支持的需求会明确报错，存储限制按已记录的 provider 支持策略处理。参见[资源限制](/zh/user_guide/modules/environments/configuration/resource_limits)。

## Provider 行为

适配器从仓库加载 `setup.image`。支持 public、no-network、allowlist 策略；公共网络基线需要在后续阶段切换时，适配器会初始化原生允许列表。当前不支持自定义启动命令。

使用 `setup.workdir` 设置默认命令目录，使用 `setup.build_timeout_seconds` 设置环境创建超时。Benchmark 通过准备后的输入独立选择任务 workspace；这两个设置都不会替代该 workspace 或单次命令超时。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.