Argilla is an open-source data annotation platform that fits into your Python workflow. You define datasets, fields, and labeling questions in code, push records to the server, then annotate through the web UI. When you’re done, you pull the labeled data back into Python for training.
Here’s the fastest way to get a working annotation pipeline running.
Install Argilla and Start the Server
Install the Python SDK first:
| |
For the server, Docker is the simplest path. Download the compose file and start everything:
| |
This spins up the Argilla server at http://localhost:6900. The default login credentials are:
- Username:
argilla - Password:
12345678
Three users ship with the quickstart image: owner, admin, and argilla. For a real project, change these passwords immediately.
Create a Dataset with Fields and Questions
Connect to your server and define what annotators will see. A dataset needs at least one field (the data to display) and one question (what you’re asking annotators to label).
This example sets up a sentiment annotation task for customer reviews:
| |
The guidelines field is important. Clear instructions reduce disagreement between annotators and produce more consistent labels. Write them like you’re onboarding a new teammate.
Add Records to the Dataset
Now push your data into Argilla. Each record is a dictionary matching the field names you defined in settings.
| |
You can also use the mapping parameter if your source data has different column names. For example, if your CSV has a "text" column instead of "review":
| |
This maps text from your data to the review field in Argilla, and item to product.
Export Annotated Data for Training
After your team finishes labeling, pull the annotated records back into Python. Argilla exports directly to Hugging Face datasets format, which plugs straight into most training pipelines.
| |
The to_datasets() method returns a standard Hugging Face Dataset object. From there you can filter, shuffle, split into train/test, or feed it into transformers.Trainer.
You can also save the full dataset (settings + records) to disk for backup or migration:
| |
Common Errors and Fixes
RecordsIngestionError: field names don't match
This happens when the keys in your record dictionaries don’t match the name values in your TextField definitions. Double-check spelling and casing. If your settings define name="review", your records must use "review" as the key, not "text" or "Review".
Dataset already exists
You’ll see this when calling dataset.create() on a name that’s already taken in that workspace. Either delete the existing dataset first through the UI, or retrieve it instead:
| |
Connection refused on localhost:6900
The Argilla server isn’t running. Check your Docker containers:
| |
If the container is restarting, it’s usually an Elasticsearch memory issue. Increase the Docker memory limit to at least 4GB.
BadRequestApiError: A workspace must be provided
You forgot the workspace parameter when creating or retrieving a dataset. Always specify which workspace to use:
| |
ArgillaCredentialsError or 401 Unauthorized
Your API key is wrong. The default key for the quickstart image is argilla.apikey. If you changed it or are connecting to a hosted instance, check your server configuration for the correct key.
Related Guides
- How to Build a Data Contamination Detection Pipeline for LLM Training
- How to Build a Dataset Changelog and Diff Pipeline with Python
- How to Build a Data Labeling Pipeline with Label Studio
- How to Build a Data Schema Evolution Pipeline for ML Datasets
- How to Build a Data Validation Pipeline with Pydantic and Pandera
- How to Build a Data Outlier Detection Pipeline with PyOD
- How to Build a Data Freshness Monitoring Pipeline with Python
- How to Build a Dataset Bias Detection Pipeline with Python
- How to Build a Data Versioning Pipeline with Delta Lake for ML
- How to Label Training Data with LLM-Assisted Annotation