> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 实验配置

LangSmith 支持多种实验配置选项：

* [重复次数](#重复次数)
* [并发控制](#并发控制)
* [缓存机制](#缓存机制)

### 重复次数

*重复次数* 通过多次运行实验来考量 LLM 输出的变异性。由于 LLM 输出具有非确定性，多次重复能提供更准确的性能评估。

通过向 `evaluate` / `aevaluate` 传递 `num_repetitions` 参数来配置重复次数（[Python](https://docs.smith.langchain.com/reference/python/evaluation/langsmith.evaluation._runner.evaluate), [TypeScript](https://docs.smith.langchain.com/reference/js/interfaces/evaluation.EvaluateOptions#numrepetitions)）。每次重复都会重新运行目标函数和所有评估器。

了解更多信息，请参阅[重复次数操作指南](/langsmith/repetition)。

### 并发控制

*并发控制* 用于管理实验期间同时运行的示例数量。通过向 `evaluate` / `aevaluate` 传递 `max_concurrency` 参数进行配置。这两个函数的语义有所不同：

#### `evaluate`

`max_concurrency` 参数指定运行目标函数和评估器时的最大并发线程数。

#### `aevaluate`

`max_concurrency` 参数使用信号量来限制并发任务数。`aevaluate` 为每个示例创建一个任务，每个任务会运行该示例的目标函数和所有评估器。`max_concurrency` 参数指定了同时处理的示例最大数量。

### 缓存机制

*缓存机制* 将 API 调用结果存储到磁盘，以加速未来的实验。将环境变量 `LANGSMITH_TEST_CACHE` 设置为具有写入权限的有效文件夹路径。未来进行相同 API 调用的实验将复用缓存结果，而无需发起新的请求。

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\langsmith\experiment-configuration.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
