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

# Model API Setup

> 配置 run-local model endpoint、protocol 和 generation 参数。

AgentCompass 在每次 run 中传入模型连接配置。Direct runtime 不要求全局 model registry 或 LLM gateway。

## 环境变量

使用带下划线的 shell 变量名：

```bash theme={null}
export MODEL_BASE_URL="http://localhost:8000/v1"
export MODEL_API_KEY="EMPTY"
```

不要使用 `model-base-url` 这类带 hyphen 的名字，它不是合法 shell 变量。如果本地 GLM-5.2 endpoint 启用了鉴权，请把 `EMPTY` 换成真实 key。

## OpenAI-Compatible Chat Endpoint

```bash theme={null}
agentcompass run \
  swebench_verified \
  mini_swe_agent \
  glm-5.2 \
  --env docker \
  --benchmark-params '{"sample_ids":["astropy__astropy-12907"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY" \
  --model-api-protocol openai-chat \
  --model-params '{"temperature":0}' \
  --task-concurrency 1
```

## 支持的 Protocol

用 live list 查看当前支持情况：

```bash theme={null}
agentcompass list dump
```

当前 protocol id 也记录在 [Supported Components](/zh/reference/supported_components)。Harness 会从 model spec 中选择兼容协议。

## Judge Model

LLM-as-judge benchmark 通过 `--benchmark-params` 接收 judge model。

```bash theme={null}
agentcompass run \
  browsecomp \
  researchharness \
  your-model \
  --env host_process \
  --benchmark-params '{
    "judge_model": {
      "id": "judge-model",
      "base_url": "https://judge-endpoint/v1",
      "api_key": "sk-...",
      "api_protocol": "openai-chat",
      "params": {"temperature": 0}
    }
  }' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY"
```

## 常见错误

| 现象                   | 检查                                              |
| -------------------- | ----------------------------------------------- |
| Provider not found   | 显式设置 `--model-api-protocol`。                    |
| 401 或鉴权失败            | 确认当前 shell 中已导出 `MODEL_API_KEY`。                |
| Model not found      | 确认 model id 和 `MODEL_BASE_URL` 匹配。              |
| Unsupported protocol | 查看 Supported Components 中的 harness/protocol 组合。 |
