Skip to main content
The lmnr datasets command is used to manage datasets in Laminar. For full CLI documentation visit here.

Usage

Creating a new dataset and iterating on it

1

Prepare input files

Prepare input files for the dataset. Supported formats are: .json, .jsonl, .csv. Every datapoint must at least have a data field. Save this file as data.json (or data.jsonl or data.csv).For JSON, the file must contain one array of datapoints.For JSONL, the file must contain one datapoint per line.For CSV, the file must contain a header row and one datapoint per row.Examples:
2

Set the project API key

Alternatively, you can set it in the .env file in the same directory where you run the CLI.
Or, you can also pass the --project-api-key flag to the global datasets command, e.g.
3

Create a new dataset

Create a new dataset from the input file. This command will create a new dataset with the name my-cli-dataset and save the datapoints to the file my-cli-dataset.json.The datapoints are saved to a new file in order to:
  • Store datasets in the Laminar format. In particular, datapoint id is crucial for versioning (Learn more).
  • Not overwrite existing files.
4

Work on the dataset locally

Make any changes required to the dataset by editing the file my-cli-dataset.json.Make sure to not edit the id field of the datapoints.
If you delete a datapoint, this will not affect the dataset in Laminar. This is because the push operation only pushes new datapoint (versions) to the dataset.
5

Push the changes to Laminar

Push the changes to Laminar.
This will push the changes to the dataset in Laminar.
6

Pull the changes from Laminar

If you need to update the local dataset with the latest changes from Laminar, you can pull the changes.
This will pull the changes from the dataset in Laminar to the local file my-cli-dataset.json.
This will overwrite the contents of the current file my-cli-dataset.json.

Working on an existing dataset

1

Set the project API key

Alternatively, you can set it in the .env file in the same directory where you run the CLI.
Or, you can also pass the --project-api-key flag to the global datasets command, e.g.
2

Select the dataset to work on

List all datasets and select the one you want to work on.
3

Pull the data from Laminar

Pull the data from Laminar to a local file.
This will pull the changes from the dataset in Laminar to the local file my-dataset.json.
If my-dataset.json already exists, this will overwrite the contents of the file.
4

Work on the dataset locally

Make any changes required to the dataset by editing the file my-dataset.json.Make sure to not edit the id field of the datapoints.
If you delete a datapoint, this will not affect the dataset in Laminar. This is because the push operation only pushes new datapoint (versions) to the dataset.
5

Push the changes to Laminar

Push the changes to Laminar.
This will push the changes to the dataset in Laminar.

Setting the CLI to call a local Laminar instance

Global datasets command has optional arguments:
  • --base-url: The base URL of the Laminar instance. Do NOT include port here. Default is https://api.lmnr.ai.
  • --port: The HTTP port of the Laminar instance. Default is 443. For local self-hosted Laminar, use 8000.
  • --project-api-key: The API key of the project. If not provided, reads from LMNR_PROJECT_API_KEY environment variable.

Reference

General options

These are useful if you want to call a local Laminar instance.

Commands

List all datasets

List all datasets.

Create a new dataset

Create a dataset from input files.

Push datapoints to a dataset

Push datapoints to an existing dataset from a file or files.

Pull datapoints from a dataset

Pull datapoints from a dataset to a file or print them to the console.