> For the complete documentation index, see [llms.txt](https://docs.segments.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.segments.ai/how-to-integrate/upload-model-predictions.md).

# Upload model predictions

## Uploading as pre-labels

Once you've trained an initial machine learning model on your labeled data, you can upload the model predictions as *pre-labels* to further speed up your labeling workflow.

To add a label to a sample programmatically, use the [`client.add_label()`](https://sdkdocs.segments.ai/en/latest/client.html#create-a-label) function in the Python SDK. Note that the format of the `attributes` field depends on the [label type](/reference/label-types.md).

```json
sample_uuid = "602a3eec-a61c-4a77-9fcc-3037ce5e9123"
labelset = "ground-truth"
attributes = {
    "format_version": "0.1",
    "annotations": [
        {
          "id": 1,
          "category_id": 1,
          "type": "bbox",
          "points": [
            [12.34, 56.78],
            [90.12, 34.56]
          ]
        }
    ]
}

client.add_label(sample_uuid, labelset, attributes)
```

The sample will now have a label status of *prelabeled*, and will appear in the label queue along with any unlabeled samples. Instead of having to label the sample from scratch, the labelers can now focus on verifying and correcting the pre-label though.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.segments.ai/how-to-integrate/upload-model-predictions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
