Share and AI

Live view in the browser#

The whole tool in your default web browser as a full page: canvas, navigator, version history, impact analysis, load order, settings, sample data and search. Everything you do is saved to the same files as in VS Code, and it opens at the same level, zoom and selection.

  • In VS Code: wrench (Tools) → Open live view in browser, or Strata SQL: Open Live View in Browser.
  • Terminal: strata-sql live opens the project in the current folder, or strata-sql live path/to/model.model.json a given model. --dir names a project folder, --port 8787 chooses a port, --no-open only prints the link.

The server listens on your machine only and prints a link that ends in an access token; the page is refused without it. Set STRATA_TOKEN (16 or more letters, digits, - or _) to keep the same link between runs.

Try the demo#

The demo opens the sample models (Northwind, FpML and a small dimensional star) for anyone to explore: every level, governance, impact analysis, version history and sample data. No project and no account are needed.

strata-sql live --demo
docker run --rm -p 127.0.0.1:8787:8787 -e STRATA_DEMO=1 <image>
  • Nothing is saved to disk and the server keeps nothing. Your changes, their versions and edited sample data stay in this browser tab and are discarded when you close the tab or leave the page; a reload keeps them.
  • The Demo bar at the bottom left switches the sample, and Reset throws away the open sample's changes.
  • Not available in the demo: vector embeddings, Export interactive HTML and creating a project. To work on your own model, use strata-sql live.

Run it in Docker#

The Docker image installs the @stratasql/strata-sql npm package, so it is the same code as the extension and the command line. It serves the live view over HTTP, with your project folder mounted at /data. Its entry point is the strata-sql command, so the image can also create projects.

docker run --rm -v "$PWD":/data <image> init --template northwind
docker run --rm -v "$PWD":/data -p 127.0.0.1:8787:8787 -e STRATA_TOKEN=pick-a-long-token-1234 <image>
# then open http://localhost:8787/?t=pick-a-long-token-1234
  • <image> is the image name given in the Install section of the home page once the image is published.
  • Without STRATA_TOKEN, the link with a random token is in docker logs.
  • The container exits with a message if /data holds no model: run init first.
  • On Linux, add --user "$(id -u):$(id -g)" if the folder belongs to you and not to user 1000.

Security: inside the container the server listens on every address, over plain HTTP, and the access token is its only protection. Publish the port to 127.0.0.1 only, as above, or put your own TLS and login in front. It is a single-user editor: there are no accounts and no live co-editing.

Export as interactive HTML#

Wrench (Tools) → Export interactive HTML, or Strata SQL: Export Interactive HTML. You get one self-contained .html file that anyone can open offline with nothing to install. It is interactive and read-only: pan, zoom, switch level, search, impact analysis, load order and browse any version. Safe to share.

Export ETL / ELT code#

Tools → Export ETL / ELT code turns the load order into boilerplate for Apache Airflow (<model>_dag.py), Dagster (<model>_dagster.py) or a Jupyter notebook (<model>_load.ipynb).

  • Load mode: Append (INSERT ... SELECT) or Replace (DELETE, then INSERT ... SELECT). Staging schema defaults to staging.
  • One task per table and view, ordered by the load order. The SQL follows your database's quoting and naming.
  • Schedule and SLAs: the cron schedule follows the fastest SLA cadence, and each task carries its SLA.
  • Circular dependencies are noted in the file.

It is a starting point, not a finished pipeline: set your connection (CONN_ID for Airflow, WAREHOUSE_URL for Dagster) and review the SQL.

Ready for AI assistants#

The model file is compact and readable. For a large model, turn it into vector embeddings so an assistant can look up only the few chunks a question needs instead of reading everything.

Tools → Generate / refresh embeddings creates <model>.model.embeddings.json next to the model. The Tools menu shows Up to date, Out of date or Not generated yet. Refreshing is incremental.

ModelRunsNeeds
Gemma (EmbeddingGemma 300M)On your computerNothing; about 200 MB downloaded once
MiniLM (all-MiniLM-L6-v2)On your computerNothing; about 25 MB downloaded once
OpenAI (text-embedding-3-small)OpenAI's serversOPENAI_API_KEY or a key in Settings
Google Gemini (gemini-embedding-001)Google's serversGEMINI_API_KEY or a key in Settings
Claude via Voyage AI (voyage-3.5)Voyage AI's serversVOYAGE_API_KEY or a key in Settings

What is sent#

Only model metadata is embedded: names, descriptions, view definitions, column lists, relationships, tags, governance values and metric calculations. Sample data is never included, and e-mail addresses are removed.

  • Local models send nothing anywhere. The first use downloads the model files once from Hugging Face; after that it works offline.
  • Hosted models are used only when you added a key for them, after a confirmation that names exactly which providers receive the metadata.
  • Generating is always a deliberate click.

The strata-model skill#

The strata-model skill gives an AI assistant command-line helpers to read, explain, review and extend a model, and to generate SQL from it, for example strata.js summary model.json --brief or strata.js codegen model.json --target airflow. In the measured Northwind example, answering from a short summary used about 118 times fewer tokens than reading the whole file (15,942 against 135), measured with the Gemma tokenizer on one machine.