Semantic & metrics layers · dbt Labs
MetricFlow
Open-source engine that compiles YAML metric definitions into SQL, and powers the dbt Semantic Layer.
MetricFlow is the query-construction engine behind the dbt Semantic Layer: metrics, dimensions and entities are defined once in YAML alongside dbt models, and MetricFlow compiles requests for them into the correct SQL against the warehouse, handling joins and aggregation so every consumer gets the same number. It originated at Transform, a company dbt Labs acquired in 2023, and is distributed on its own as an Apache-2.0 Python package that can be run and queried locally. Used standalone it is a free command-line and Python tool; querying the same metric definitions in production from BI tools, notebooks or AI agents at scale requires the hosted dbt Semantic Layer, part of the paid dbt platform (see the separate dbt record). It does not replace dbt's transformation layer, only the last step of turning modeled tables into governed metrics.
At a glance
| Vendor | dbt Labs |
|---|---|
| Pricing model | Open source + paid options |
| Free tier | Yes |
| Deployment | Cloud, Self-hosted |
| Open source | Yes (Apache-2.0) |
| Best for | Analytics engineers already on dbt who want one governed metric definition queried consistently everywhere. |
Pricing
MetricFlow itself is free, open-source Python; serving its metrics in production through the hosted dbt Semantic Layer requires a paid dbt platform plan.
Pricing has not been verified yet — see the vendor's site.
Features
- Metrics, dimensions and entities defined as YAML alongside dbt models
- Compiles metric requests into warehouse SQL automatically
- Handles joins, aggregation and time-granularity conversion
- Command-line interface for local querying and validation
- Python API for embedding in other tools
- Powers the dbt Semantic Layer's API and BI integrations
- Consistent metric definitions across dashboards, notebooks and agents
Integrations
Profile last reviewed September 21, 2026