> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cube.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic Data Models

> Generate data models programmatically using Jinja with Python or JavaScript for dynamic schema creation.

Cube supports authoring data models dynamically — useful for de-duplicating
common patterns across cubes, generating models from a remote source, or
adapting the schema per tenant at runtime.

Pick the approach that matches the language your data models are written in:

> [card] [Jinja & Python](https://docs.cube.dev/docs/data-modeling/dynamic/jinja.md)
>
> Template YAML data models with Jinja, and use Python for loops, includes,
> and runtime generation.

> [card] [JavaScript](https://docs.cube.dev/docs/data-modeling/dynamic/javascript.md)
>
> Generate cubes and views on-the-fly from JavaScript data models using
> `asyncModule()`.

## How it fits together

The diagrams below show how YAML and JavaScript data models are parsed and
compiled before they're served by Cube.

![](https://ucarecdn.com/44e17cc4-60cb-40c4-889b-aba17def7136/)

YAML data models compiled with COMPILE\_CONTEXT

![](https://ucarecdn.com/7379561c-418e-49e2-9b94-be7c13b0f2de/)

JavaScript data models compiled with COMPILE\_CONTEXT


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.