Synthetic Product Data Generator

Today, I’m sharing a new project: a Jupyter Notebook for synthetic product data generation using Large Language Models (LLMs) through the LangChain framework. This tool is designed to aid in the creation of synthetic yet realistic product listings for e-commerce and other domains.

What It Does

The notebook facilitates the generation of synthetic data, including vendor names, product categories, and detailed product information such as titles, descriptions, and prices. It is built with flexibility in mind, allowing for the integration of different LLMs and customization of data generation parameters to suit various needs.


  • Integration with multiple LLMs, including examples for Ollama and OpenAI.
  • Customizable data generation to adjust shop type, categories, vendors, and product details.
  • Interactive environment for real-time monitoring and adjustments.

Why I Started This Project

I started working on this project because I’m really interested in a few key areas:

Exploration of LangChain

The main reason I began this project was to gain more hands-on experience with the LangChain framework. I was curious to see not only how it operates but what possibilities it unlocks when integrated with various LLMs.

Prompt Engineering

Another important part of this project is learning how to make good prompts. Figuring out the right way to ask questions or give commands to LLMs can really change the results you get. This project is like a testing ground where I try out different kinds of prompts to see how small changes can make a big difference in what kind of information or data we can generate.

I quickly found out the trickiest part was getting the prompts just right. It’s amazing how a single word change can totally switch up the results, especially with the smaller LLMs. This part of the project was where I spent most of my time, going through many iterations to get it perfect

Creating Synthetic Data

A big part of why I’m doing this is to have a tool that lets me easily create customized synthetic data for some others of machine learning and retrieval-augmented generation (RAG) projects I’m working on. Having the ability to produce realistic yet artificial data means I can test, develop, and analyze different projects more effectively.

Crafting My Own Tools

So, why didn’t I just use some tool that’s already out there? Because building my own is more fun and a great way to practice. Plus, I wanted something that fit exactly what I needed, which I couldn’t really find with the available tools.

This notebook is a practical tool that embodies these motivations. It demonstrates the power of combining custom prompts with different LLMs to produce synthetic data that is not only diverse but also closely tailored to specific project requirements.

Getting Started

For those interested in using or contributing to this project, the notebook is available on my GitHub repository. Installation instructions and details on how to customize and run the notebook are provided in the README. The project also supports running in Google Colab for ease of access and use.

Dependencies can be installed via pip, and the project is ready to run in a local environment or in Google Colab with minimal setup.

Open In Colab

Join the Effort

I welcome contributions and ideas to enhance this tool. Whether you have suggestions for new features or improvements, feel free to reach out through GitHub.

A Jupyter Notebook for synthetic product data generation using Large Language Models (LLMs) through the LangChain framework.

Antonio Sánchez

Python LLM AI LangChain

552 Words

Mar 24, 2024