Choose Lightdash if your team already uses dbt and wants AI-powered natural language queries with minimal infrastructure overhead. Choose Preset if you need custom ML model integration, Python-native visualizations, or work with data sources outside dbt. This comparison covers architecture, AI features, and code examples for both platforms.
Architecture Overview
Lightdash transforms your dbt project into a full BI platform. It reads your dbt models directly and generates explorable dashboards without separate configuration. The architecture relies heavily on dbt for data transformation, meaning your semantic layer lives in your dbt project.
Preset provides a more flexible, standalone BI platform built on Apache Superset. It offers native support for Python-based components, extensive plugin capabilities, and a chart-builder-first approach that doesn’t require code-defined metrics.
Both platforms have introduced AI features, but their implementations reflect their underlying architectural choices.
AI Features Comparison
Lightdash AI
Lightdash AI focuses on natural language queries and automated insights. The system analyzes your dbt metrics and dimensions to generate query suggestions and explain results in plain language.
# lightdash-ai-config.yml
version: 2
ai:
natural_language_queries:
enabled: true
semantic_model: dbt
automated_insights:
enabled: true
anomaly_detection:
sensitivity: medium
lookback_days: 30
To enable AI features in Lightdash, your dbt models need proper documentation with descriptions and meta tags:
# dbt model example
models:
- name: user_activity
description: "Daily user activity metrics"
meta:
ai_enabled: true
columns:
- name: user_id
description: "Unique user identifier"
- name: activity_score
description: "Calculated engagement score from ML model"
meta:
ai_priority: high
Lightdash AI works best when your dbt project follows best practices with well-documented metrics. The AI generates SQL behind the scenes, which means you need to understand the generated queries to validate results.
Preset AI
Preset uses its Python foundation to offer more flexible AI integration. You can embed Jupyter-style notebooks directly in your dashboards, run custom ML models, and create interactive AI-powered components.
# preset_custom_viz.py - Custom AI visualization component
import pandas as pd
import numpy as np
from sklearn.ensemble import IsolationForest
def render_anomaly_dashboard(df):
"""
Render an interactive anomaly detection dashboard
"""
# Pre-process data
features = df[['metric_value', 'velocity', 'recency']].fillna(0)
# Run anomaly detection
model = IsolationForest(contamination=0.1, random_state=42)
df['anomaly_score'] = model.fit_predict(features)
df['anomaly_prob'] = model.score_samples(features)
# Return visualization data
return {
'scatter': df.to_dict(orient='records'),
'anomaly_count': (df['anomaly_score'] == -1).sum(),
'avg_score': df['anomaly_prob'].mean()
}
Preset also offers native AI assistants that can help build queries and generate visualizations through natural language.
Data Integration Patterns
Connecting to Your Data Warehouse
Both platforms connect to similar data sources, but the setup process differs:
-- Both platforms support these common sources:
-- BigQuery, Snowflake, Redshift, PostgreSQL, Databricks, AWS Athena
-- Connection configuration happens in platform UI
Lightdash requires dbt to manage transformations. Your data flow looks like: Source DB → dbt → Lightdash. This means Lightdash works only with dbt-managed projects.
Preset connects directly to your warehouse without dbt dependency. You can use dbt if you want, but it’s not required. This makes Preset more flexible for varied data architectures.
Building AI Dashboards: Code Examples
Lightdash Approach
Lightdash uses YML-based configurations for dashboards:
# dashboards/ai_metrics.yml
version: 2
dashboards:
ai_performance:
rows:
- tiles:
- type: chart
x: 0
y: 0
width: 6
height: 4
properties:
chart_name: "AI Prediction Accuracy"
saved_chart_name: "prediction_accuracy_trend"
- type: chart
x: 6
y: 0
width: 6
height: 4
properties:
chart_name: "Anomaly Alerts"
saved_chart_name: "detected_anomalies"
filter:
- id: date_range
name: "Date Range"
config:
type: date_range
targets:
- field: timestamp
Preset Approach
Preset allows programmatic dashboard creation through its API:
# preset_dashboard_api.py
import requests
def create_ai_dashboard(preset_token, workspace_id):
"""
Create an AI-powered dashboard programmatically
"""
dashboard_config = {
"dashboard_title": "AI Metrics Monitoring",
"position": {
"gridSize": [12, 12],
"charts": [
{
"id": "ai_accuracy_chart",
"type": "line",
"datasource": "ml_predictions",
"viz_config": {
"x_axis": "timestamp",
"y_axis": "accuracy_score",
"aggregation": "avg",
"annotation_layer": {
"enabled": True,
"source": "model_version"
}
},
"position": {"x": 0, "y": 0, "width": 6, "height": 4}
},
{
"id": "prediction_distribution",
"type": "dist_bar",
"datasource": "prediction_results",
"viz_config": {
"groupby": ["prediction_class"],
"metrics": ["count"],
"filter": "confidence > 0.8"
},
"position": {"x": 6, "y": 0, "width": 6, "height": 4}
}
]
}
}
response = requests.post(
f"https://api.preset.io/v1/workspaces/{workspace_id}/dashboards",
headers={"Authorization": f"Bearer {preset_token}"},
json=dashboard_config
)
return response.json()
Performance Considerations
For AI workloads, query performance matters significantly:
| Aspect | Lightdash | Preset |
|---|---|---|
| Query caching | Automatic with dbt | Configurable per-chart |
| Async queries | Limited | Full async support |
| Large result sets | Best with dbt optimizations | Handles via pagination |
| Custom Python | Not supported | Native execution |
When to Choose Each Platform
Choose Lightdash if your team already uses dbt for data transformation, you want minimal infrastructure overhead, natural language queries are a priority, or you prefer configuration over code.
Choose Preset if you need custom ML model integration, your data doesn’t use dbt, you want full programmatic control, or Python-based visualizations are essential.
Recommendation
For developers building AI dashboards, the choice depends on your existing infrastructure. Teams with established dbt workflows will find Lightdash’s integrated approach streamlined. Organizations needing custom ML pipelines or working without dbt will benefit from Preset’s flexibility.
Start by mapping your current data architecture. If dbt is central to your operations, Lightdash AI integration requires minimal additional setup. If you need custom model serving or diverse data sources, Preset’s Python-native approach provides more flexibility.
Related Reading
Built by theluckystrike — More at zovo.one