AI Dataset Generator – Create realistic datasets for demos, learning, and dashboards
See the codeGenerate realistic datasets for demos, learning, and dashboards. Instantly preview data, export as CSV or SQL, and explore with Metabase.
Want to try it without setup? We've hosted this tool at metabase.com/ai-data-generator
Features:
Local vs Web: When running locally, you can spin up Metabase in Docker and use LiteLLM for multi-provider LLM support. On the web, the app defaults to OpenAI and redirects to Metabase Cloud for data exploration.
Clone the repo:
git clone <your-repo-url>
cd dataset-generator
Create your .env file:
Create a .env file in the project root with your OpenAI API key:
OPENAI_API_KEY=sk-your-openai-key-here
Optionally, you can also set:
# Change the OpenAI model (defaults to gpt-4o)
LLM_MODEL=gpt-4o
Start the Next.js app:
npm install
npm run dev
Generate a dataset:
Export or Explore:
By default, the app uses OpenAI directly. If you want to use other LLM providers (Anthropic, Google, etc.), you can optionally run the LiteLLM service:
Add provider keys to your .env file:
# Keep your OpenAI key as fallback
OPENAI_API_KEY=sk-your-openai-key-here
# Add other provider keys
ANTHROPIC_API_KEY=your-anthropic-key-here
GOOGLE_GENAI_API_KEY=your-google-key-here
# LiteLLM configuration
LITELLM_MASTER_KEY=sk-1234
LITELLM_SALT_KEY=sk-1234
# Set model for your preferred provider
LLM_MODEL=claude-3-sonnet-20240229
Start LiteLLM service:
docker compose up litellm db_litellm
When LiteLLM is running, the app automatically detects it and routes requests through the multi-provider gateway instead of directly to OpenAI.
The dataset generator uses a two-stage process to create realistic business data. First, it leverages large language models to generate detailed data specifications based on your business type and parameters. Then, it uses these specifications to create unlimited amounts of realistic data locally.
| Action | Calls LLM? | Cost? | Uses LLM? | Uses Faker? | Row Count |
|---|---|---|---|---|---|
| Preview | Yes | ~$0.05 | Yes | Yes | 10 |
| Download CSV | No | $0 | No | Yes | 100+ |
| Download SQL | No | $0 | No | Yes | 100+ |
The above costs and behavior are based on testing with the OpenAI GPT-4o model. Costs and token usage may vary with other providers/models.
Caching: After your first preview, the app remembers your data structure. If you preview the same business type and settings again, it reuses that structure (free) instead of generating a new one. This saves money and time. You'll see "Using cached spec" in the terminal when this happens. Check cache stats: curl http://localhost:3000/api/cache/stats or clear: curl -X DELETE http://localhost:3000/api/cache/clear.
/app/page.tsx – Main UI and prompt builder/app/api/generate/route.ts – Synthetic data generator (OpenAI direct or via LiteLLM)/app/api/metabase/start|stop|status/route.ts – Docker orchestration for Metabase/lib/export/ – CSV/SQL export logic/docker-compose.yml – Used for Metabase and LiteLLM servicesTo add new business types, you need to update several files:
Edit lib/spec-prompts.ts - Add entries to the businessTypeInstructions object with:
Edit lib/constants/business-constants.ts - Add realistic numeric ranges:
// Add to NUMERIC_FIELD_RANGES array
{ field: "your_field", min: 100, max: 1000 },
// Add to DEFAULT_VALUES object
your_field: ["option1", "option2", "option3"],
// Add to REQUIRED_FIELDS_BY_BUSINESS_TYPE
"Your Business Type": ["required_field1", "required_field2", "event_type"],
Edit lib/enforcers/data-enforcer.ts - Add business-specific validation rules:
public enforceYourBusinessRules(record: DataRecord): void {
// Add validation logic for your business type
// e.g., ensure realistic pricing, date relationships, etc.
}
Update lib/data-factory.ts - Call your new enforcer method:
// In the generate() method, add your enforcer
this.dataEnforcer.enforceYourBusinessRules(record);
Test your changes - Generate a preview to ensure realistic data ranges and proper field validation
4,415 followers · starred Jun 2025
328 followers · starred Jun 2025
872 followers · starred Jun 2025
189 followers · starred Jun 2025
AI Dataset Generator – Create realistic datasets for demos, learning, and dashboards
See the codeGenerate realistic datasets for demos, learning, and dashboards. Instantly preview data, export as CSV or SQL, and explore with Metabase.
Want to try it without setup? We've hosted this tool at metabase.com/ai-data-generator
Features:
Local vs Web: When running locally, you can spin up Metabase in Docker and use LiteLLM for multi-provider LLM support. On the web, the app defaults to OpenAI and redirects to Metabase Cloud for data exploration.
Clone the repo:
git clone <your-repo-url>
cd dataset-generator
Create your .env file:
Create a .env file in the project root with your OpenAI API key:
OPENAI_API_KEY=sk-your-openai-key-here
Optionally, you can also set:
# Change the OpenAI model (defaults to gpt-4o)
LLM_MODEL=gpt-4o
Start the Next.js app:
npm install
npm run dev
Generate a dataset:
Export or Explore:
By default, the app uses OpenAI directly. If you want to use other LLM providers (Anthropic, Google, etc.), you can optionally run the LiteLLM service:
Add provider keys to your .env file:
# Keep your OpenAI key as fallback
OPENAI_API_KEY=sk-your-openai-key-here
# Add other provider keys
ANTHROPIC_API_KEY=your-anthropic-key-here
GOOGLE_GENAI_API_KEY=your-google-key-here
# LiteLLM configuration
LITELLM_MASTER_KEY=sk-1234
LITELLM_SALT_KEY=sk-1234
# Set model for your preferred provider
LLM_MODEL=claude-3-sonnet-20240229
Start LiteLLM service:
docker compose up litellm db_litellm
When LiteLLM is running, the app automatically detects it and routes requests through the multi-provider gateway instead of directly to OpenAI.
The dataset generator uses a two-stage process to create realistic business data. First, it leverages large language models to generate detailed data specifications based on your business type and parameters. Then, it uses these specifications to create unlimited amounts of realistic data locally.
| Action | Calls LLM? | Cost? | Uses LLM? | Uses Faker? | Row Count |
|---|---|---|---|---|---|
| Preview | Yes | ~$0.05 | Yes | Yes | 10 |
| Download CSV | No | $0 | No | Yes | 100+ |
| Download SQL | No | $0 | No | Yes | 100+ |
The above costs and behavior are based on testing with the OpenAI GPT-4o model. Costs and token usage may vary with other providers/models.
Caching: After your first preview, the app remembers your data structure. If you preview the same business type and settings again, it reuses that structure (free) instead of generating a new one. This saves money and time. You'll see "Using cached spec" in the terminal when this happens. Check cache stats: curl http://localhost:3000/api/cache/stats or clear: curl -X DELETE http://localhost:3000/api/cache/clear.
/app/page.tsx – Main UI and prompt builder/app/api/generate/route.ts – Synthetic data generator (OpenAI direct or via LiteLLM)/app/api/metabase/start|stop|status/route.ts – Docker orchestration for Metabase/lib/export/ – CSV/SQL export logic/docker-compose.yml – Used for Metabase and LiteLLM servicesTo add new business types, you need to update several files:
Edit lib/spec-prompts.ts - Add entries to the businessTypeInstructions object with:
Edit lib/constants/business-constants.ts - Add realistic numeric ranges:
// Add to NUMERIC_FIELD_RANGES array
{ field: "your_field", min: 100, max: 1000 },
// Add to DEFAULT_VALUES object
your_field: ["option1", "option2", "option3"],
// Add to REQUIRED_FIELDS_BY_BUSINESS_TYPE
"Your Business Type": ["required_field1", "required_field2", "event_type"],
Edit lib/enforcers/data-enforcer.ts - Add business-specific validation rules:
public enforceYourBusinessRules(record: DataRecord): void {
// Add validation logic for your business type
// e.g., ensure realistic pricing, date relationships, etc.
}
Update lib/data-factory.ts - Call your new enforcer method:
// In the generate() method, add your enforcer
this.dataEnforcer.enforceYourBusinessRules(record);
Test your changes - Generate a preview to ensure realistic data ranges and proper field validation
4,415 followers · starred Jun 2025
328 followers · starred Jun 2025
872 followers · starred Jun 2025
189 followers · starred Jun 2025