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

# 获取包含检查点与指标的训练任务完整详情

> 获取单个训练任务的完整详情，包括检查点、MLflow 链接、最新进度与超参数。

使用此接口获取训练任务的完整状态。响应包含 LoRA 配置、超参数、最新进度快照、MLflow 运行链接以及任何错误消息。

## 方法与路径

```http theme={null}
GET /v1/jobs/:id
```

## 认证

在 `Authorization` 头中以 Bearer 令牌的形式携带你的 PIN API 令牌或 JWT。

```http theme={null}
Authorization: Bearer <token>
```

## 路径参数

<ParamField path="id" type="string" required>
  任务标识符（例如 `jb_abc123def456`）。
</ParamField>

## 请求示例

<CodeGroup>
  ```bash curl theme={null}
  curl -s "https://api.ariacompute.com/v1/jobs/jb_abc123def456" \
    -H "Authorization: Bearer $PIN_API_TOKEN"
  ```
</CodeGroup>

## 响应

返回标准的 PIN 成功信封，任务对象位于 `data` 下。

<ResponseField name="code" type="integer" required>
  成功为 `0`，出错为非零值。
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable title="任务对象">
    <ResponseField name="job_id" type="string">
      唯一任务标识符。
    </ResponseField>

    <ResponseField name="type" type="string">
      训练类型：`sft`、`opd`、`pretrain`、`distill`、`qat`、`grpo`、`dpo`、`kto`、`orpo`、`simpo`、`ppo`。
    </ResponseField>

    <ResponseField name="base_model" type="string">
      来自目录的基座模型。
    </ResponseField>

    <ResponseField name="teacher_model" type="string">
      用于 OPD/蒸馏的冻结教师模型。
    </ResponseField>

    <ResponseField name="lora" type="object">
      LoRA/QLoRA/DoRA 配置。

      <Expandable title="属性">
        <ResponseField name="method" type="string">
          `lora`、`qlora`、`dora` 或 `none`。
        </ResponseField>

        <ResponseField name="rank" type="integer">
          LoRA 秩（1 到 64）。
        </ResponseField>

        <ResponseField name="alpha" type="integer">
          LoRA alpha（1 到 128）。
        </ResponseField>

        <ResponseField name="lora_dropout" type="number">
          Dropout 比率（0 到 0.5）。
        </ResponseField>

        <ResponseField name="target_modules" type="array">
          目标模块名称。
        </ResponseField>

        <ResponseField name="quantization" type="string">
          QLoRA 时为 `4bit_nf4`。
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="hyperparams" type="object">
      训练超参数。
    </ResponseField>

    <ResponseField name="auto_intervention" type="object">
      若已启用，则为自动干预配置。
    </ResponseField>

    <ResponseField name="dataset_id" type="string">
      关联的数据集 ID。
    </ResponseField>

    <ResponseField name="dataset_path" type="string">
      解析后的存储路径或 HF 仓库。
    </ResponseField>

    <ResponseField name="dataset_hf_repo" type="string">
      Hugging Face 数据集仓库。
    </ResponseField>

    <ResponseField name="dataset_access" type="string">
      数据集访问模式。
    </ResponseField>

    <ResponseField name="status" type="string">
      当前状态。
    </ResponseField>

    <ResponseField name="dispatch_status" type="string">
      控制器调度状态。
    </ResponseField>

    <ResponseField name="agent_id" type="string">
      执行该任务的智能体。
    </ResponseField>

    <ResponseField name="gpu_index" type="integer">
      分配的 GPU 索引。
    </ResponseField>

    <ResponseField name="mlflow_run_id" type="string">
      MLflow 运行 ID。
    </ResponseField>

    <ResponseField name="mlflow_url" type="string">
      MLflow 直接 URL。
    </ResponseField>

    <ResponseField name="error" type="string">
      最近记录的错误。
    </ResponseField>

    <ResponseField name="progress" type="object">
      最新的步进指标。

      <Expandable title="属性">
        <ResponseField name="step" type="integer">
          训练步数。
        </ResponseField>

        <ResponseField name="loss" type="number">
          最新 loss。
        </ResponseField>

        <ResponseField name="reward" type="number">
          最新 reward（RL 任务）。
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 创建时间戳。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message" type="string">
  可读消息（成功时为空）。
</ResponseField>

### 响应示例

```json theme={null}
{
  "code": 0,
  "data": {
    "job_id": "jb_abc123def456",
    "type": "grpo",
    "base_model": "meta-llama/Llama-3-8B",
    "lora": {
      "method": "lora",
      "rank": 16,
      "alpha": 32,
      "lora_dropout": 0.05,
      "target_modules": ["q_proj", "v_proj"],
      "quantization": "4bit_nf4"
    },
    "hyperparams": {
      "epochs": 3,
      "lr": 0.00002,
      "max_length": 2048,
      "group_size": 4,
      "kl_coef": 0.1
    },
    "dataset_id": "ds_xyz789",
    "status": "running",
    "dispatch_status": "running",
    "agent_id": "ag_node01_001",
    "gpu_index": 0,
    "mlflow_run_id": "run_20250115_001",
    "mlflow_url": "http://mlflow:5000/#/experiments/0/runs/run_20250115_001",
    "progress": {
      "step": 2150,
      "loss": 0.6123,
      "reward": 0.8741
    },
    "created_at": "2025-01-15T09:23:17Z"
  },
  "message": ""
}
```

## 错误

| Code | HTTP | 含义                |
| ---- | ---- | ----------------- |
| 401  | 401  | 缺失或无效的 Bearer 令牌。 |
| 404  | 404  | 任务不存在或不属于你。       |
| 500  | 500  | 内部服务器错误。          |
