# LLM Assisted Labeling

**Supported Labeling Types**: `Span labeling`**,** `Row labeling`

Datasaur **ML-assisted labeling** with large language models supports users to integrate the labeling process to be assisted labeled with recents top notch model from OpenAI, Azure OpenAI, Anthropic, Gemini and Cohere. This will make labeling easier and general for all use cases!

## Providers and Model Support

| Provider Name | Model                                                                                                                       |
| ------------- | --------------------------------------------------------------------------------------------------------------------------- |
| OpenAI        | gpt-3.5-turbo, gpt-4, gpt-4-turbo, gpt-4o, gpt-4o-mini                                                                      |
| Azure Open AI |                                                                                                                             |
| Anthropic     | claude-2, claude-2.1, claude-3-haiku-20240307, claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-5-sonnet-20240620 |
| Gemini        | gemini-pro, gemini-1.5-flash, gemini-1.5-pro                                                                                |
| Cohere        | command-light, command-r, command-r-plus                                                                                    |
| Custom        | Support for any LLM Provider without requiring additional coding for Row Labeling.                                          |

## Quick Guide

After successfully creating the project, you need to activate the **ML-assisted labeling** extension and select **LLM Assisted Labeling** as the provider. Once you have chosen **LLM Assisted Labeling**, you can access several fields under the extension. These fields include:

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-4030768b0027e6ecf0b812f23b47d24adb5cae0a%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20LLM%20Assisted%20Labeling%20-%20highlight.png?alt=media" alt="Image of Empty Row Based Project"><figcaption><p>Empty Row Based Project</p></figcaption></figure>

{% hint style="info" %}
For LLM Assisted Labeling with Custom Providers you can take a look [this page](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/llm-assisted-labeling/custom-provider).
{% endhint %}

1. **LLM provider**: You can choose from the variety of LLM that Datasaur support.
2. **Target text**: Define your text column(s) that is going to be treated as input and prompt context.
3. **Target question**: Select your question to be answered.
4. **System prompt**: Sets the behavior and context for the language model.
5. **User prompt**: User definition of a task to be completed in a specific labeling workflow.
6. **API key**: The LLM Provider secret key
7. **API version:** The API Version from your Azure OpenAI.
8. **API base URL**: The base URL for your Azure OpenAI API model.
9. **Model deployment:** The deployment model name from Azure OpenAI.
10. **Advanced Settings**
    1. **Top P**: Limits predictions to the smallest set with a cumulative probability of P.
    2. **Temperature**: Controls randomness; lower values make responses more predictable.
    3. **Maximum tokens**: Limits the length of the generated response.
    4. **Model name**: The specific version of the language model.

{% hint style="info" %}
For guidance, you can refer to our prompt examples: [Row-Based](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/prompt-examples#row-labeling) and [Span-Based](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/prompt-examples#span-labeling).
{% endhint %}

Once all fields have been filled, you can predict the label by clicking **Predict labels** then you will see the assisted labeling recommendation from your prompts and settings.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-e53a2063e32cbd260324173cf106286cbb50082d%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20LLM%20Assisted%20Labeling%20-%20project.png?alt=media" alt="Image of Prediction Result"><figcaption><p>Prediction Done</p></figcaption></figure>

{% hint style="info" %}
If you are experiencing the 429 error, the limitation came from the LLM Provider package. Please take a look at your current usage of LLM Provider API.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/llm-assisted-labeling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
