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

# Metrics

> Track system, grader, and user metrics across completions

Metrics unify three categories of measurement into a single system:

* **System metrics** — auto-computed per completion (TTFT, latency, token counts). No setup required.
* **Grader metrics** — produced by [Graders](/v0.14/core/graders) (AI judges, pre-built, custom, external). Scores are written automatically when graders run.
* **User metrics** — custom ratings you define and log via SDK. Use these for human evaluation, application-specific scores, or any signal not covered by system or grader metrics.

This page covers **inference-time** metrics — measurements collected on completions returned by deployed models. For **training-time** signals (loss curves, reward, gradient norms, validation metrics emitted during a run), see [Monitoring](/v0.14/core/monitoring). The two systems are separate: training metrics live with the run record, inference metrics live with the completion record.

<Tabs>
  <Tab title="SDK" icon="code">
    ## Register a user metric

    Before logging values, register a metric key:

    ```python theme={null}
    adaptive.feedback.register_key(
        project="my-project",
        key="quality",
        kind="scalar",  # or "bool"
        scoring_type="higher_is_better",
    )
    ```

    | Parameter      | Type | Required | Description                                           |
    | -------------- | ---- | -------- | ----------------------------------------------------- |
    | `project`      | str  | Yes      | Project to register the metric in                     |
    | `key`          | str  | Yes      | Unique identifier                                     |
    | `kind`         | str  | No       | `"scalar"` (default) or `"bool"`                      |
    | `scoring_type` | str  | No       | `"higher_is_better"` (default) or `"lower_is_better"` |

    <Note>
      The SDK resource is `adaptive.feedback` — the entity is called "metrics" in the UI but the SDK interface retains the `feedback` name.
    </Note>

    ## Log metric feedback

    Log a rating for a completion using its `completion_id` from the inference response:

    ```python theme={null}
    response = adaptive.chat.create(
        messages=[{"role": "user", "content": "Hello"}]
    )
    completion_id = response.choices[0].completion_id

    adaptive.feedback.log_metric(
        value=5,
        completion_id=completion_id,
        feedback_key="quality",
    )
    ```

    Feedback is associated with the completion's [Interaction](/v0.14/core/interactions) record.

    ## Log preference feedback

    Log a pairwise comparison between two completions:

    ```python theme={null}
    adaptive.feedback.log_preference(
        feedback_key="quality",
        preferred_completion=completion_id_a,
        other_completion=completion_id_b,
    )
    ```

    Use preferences for RLHF/DPO training when you can judge which completion is better but can't assign absolute scores.

    ## List and get metrics

    ```python theme={null}
    keys = adaptive.feedback.list_keys(project="my-project")

    key = adaptive.feedback.get_key(
        project="my-project",
        key="quality",
    )
    ```

    See [SDK Reference](/v0.14/reference/sdk) for all feedback methods.
  </Tab>

  <Tab title="UI" icon="mouse-pointer">
    ## View metrics

    Navigate to your project and open the **Metrics** page to see all metrics and their values over time.

    <Frame caption="Track metrics across time">
      <img src="https://mintcdn.com/adaptiveml/nxrXfjE5HXjTB4Su/static/metric-plots.png?fit=max&auto=format&n=nxrXfjE5HXjTB4Su&q=85&s=d4b9bea3540f8d8a487ee1062f3ecd00" width="2450" height="1050" data-path="static/metric-plots.png" />
    </Frame>

    Filter by category — **System**, **Grader**, or **User** — to narrow the view.

    ## Manage user metrics

    Create, edit, and delete user metrics from the Metrics page. System and grader metrics are protected and cannot be modified.
  </Tab>
</Tabs>
