Skip to main content

Dreamlake

A simple and flexible SDK for ML experiment tracking and data storage.

Features

  • Three Usage Styles: Decorator, context manager, or direct instantiation
  • Dual Operation Modes: Remote (API server) or local (filesystem)
  • Auto-creation: Automatically creates namespace, workspace, and folder hierarchy
  • Upsert Behavior: Updates existing episodes or creates new ones
  • Simple API: Minimal configuration, maximum flexibility
  • Time-Based Queries: MCAP-like API for querying track data by timestamp ranges
  • Multi-Modal Sync: Timestamp inheritance for synchronizing pose, images, and sensor data

Installation

Using uv (recommended) Using pip
uv add dreamlake@0.4.2
pip install dreamlake==0.7.1

CLI (deprecated — use the standalone DreamLake CLI)

The Python CLI bundled in this package is deprecated, and this package no longer installs a dreamlake console script. Install the standalone DreamLake CLI instead — same commands, flags, and env vars, plus environment switching (dreamlake env use):

curl -fsSL https://dl.dreamlake.ai/install.sh | bash

upload, download, list, create, delete, update and vectorize have been removed from this package; they live in the standalone CLI. What is still here, reachable through python -m dreamlake.cli:

Command Status
artifact append-local, workflow append-local not deprecated — see below
artifact push|list|delete|restore deprecated; the standalone CLI has these
workflow push|list deprecated; the standalone CLI has these
source create|collection create|push kept — no standalone-CLI equivalent yet
video upload|download|list deprecated; the standalone CLI has these
login, logout, profile kept — login is the only writer of the token store artifact push / workflow push read

The append-local writers are not deprecated

artifact append-local and workflow append-local are the canonical DreamDB writers, and dreamlake-server spawns them as a subprocessroutes/workflows.ts for workflow apply, routes/artifacts.ts for artifact apply. Their stdout is a machine contract: exactly one JSON line, which the server parses as the last non-empty line of stdout. Errors go to stdout too, as JSON. Do not reformat either.

workflow append-local  →  {"version": N, "meta": {description, stageCount, nodeCount, edgeCount}}
artifact append-local  →  {"version": N}            # no "meta" key — the two are not symmetric
error (either)         →  {"error": "...", "message": "..."}   # exit 1

The wrapper bin

The server spawns ${WORKFLOWS_APPLY_BIN:-dreamlake} workflow append-local … and ${ARTIFACTS_APPLY_BIN:-…} artifact append-local …. The dreamlake on PATH is the standalone TS CLI, which has no DreamDB writer, and pip install dreamlake deliberately installs no bin of its own. So point both env vars at the wrapper shipped in this repo:

export WORKFLOWS_APPLY_BIN=/path/to/dreamlake-py/bin/dreamlake-append-local
export ARTIFACTS_APPLY_BIN=/path/to/dreamlake-py/bin/dreamlake-append-local

It is a one-line exec python3 -m dreamlake.cli "$@" and must stay one — anything the wrapper prints would corrupt the JSON contract above. It is not registered in [project.scripts], on purpose: the dreamlake name on PATH belongs to the standalone CLI.

Quick Start

Remote Mode (with API Server)

from dreamlake import Episode

with Episode(
    name="my-experiment",
    workspace="my-workspace",
    remote="https://cu3thurmv3.us-east-1.awsapprunner.com",
    api_key="your-jwt-token"
) as episode:
    print(f"Episode ID: {episode.id}")

Local Mode (Filesystem)

from dreamlake import Episode

with Episode(
    name="my-experiment",
    workspace="my-workspace",
    local_path=".dreamlake"
) as episode:
    pass  # Your code here

See examples/ for more complete examples.

Development Setup

Installing Dev Dependencies

To contribute to Dreamlake or run tests, install the development dependencies:

Using uv (recommended) Using pip
uv sync --extra dev
pip install -e ".[dev]"

This installs:

  • pytest>=8.0.0 - Testing framework
  • pytest-asyncio>=0.23.0 - Async test support
  • sphinx>=7.2.0 - Documentation builder
  • sphinx-rtd-theme>=2.0.0 - Read the Docs theme
  • sphinx-autobuild>=2024.0.0 - Live preview for documentation
  • myst-parser>=2.0.0 - Markdown support for Sphinx
  • ruff>=0.3.0 - Linter and formatter
  • mypy>=1.9.0 - Type checker

Running Tests

Using uv Using pytest directly
uv run pytest
pytest

Building Documentation

Documentation is built using Sphinx with Read the Docs theme.

Build docs Live preview Clean build
uv run python -m sphinx -b html docs docs/_build/html
uv run sphinx-autobuild docs docs/_build/html
rm -rf docs/_build

The live preview command starts a local server and automatically rebuilds when files change.

Alternatively, you can use the Makefile from within the docs directory:

cd docs
make html          # Build HTML documentation
make clean         # Clean build files

For maintainers, to build and publish a new release: uv build && uv publish

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dreamlake-0.7.3.tar.gz (148.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dreamlake-0.7.3-py3-none-any.whl (175.8 kB view details)

Uploaded Python 3

File details

Details for the file dreamlake-0.7.3.tar.gz.

File metadata

  • Download URL: dreamlake-0.7.3.tar.gz
  • Upload date:
  • Size: 148.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for dreamlake-0.7.3.tar.gz
Algorithm Hash digest
SHA256 d2c7bc954901542bcfd64924caf2f987b41fd2a89df8e834ced1b28b72afd665
MD5 4a473f7ee8b5587591015ce55af72d58
BLAKE2b-256 a969544c8aef0937eec3fce61871daad37fa05ecf0aded69f59f339576756e9a

See more details on using hashes here.

File details

Details for the file dreamlake-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: dreamlake-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 175.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for dreamlake-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6677907b77c1f53ecc1ff01be5fd8aa1dc4ad1caf2d49527951f72ff74790156
MD5 bfba6739b8fe06849834bfee45a52d1f
BLAKE2b-256 9ede4b8b425d5bf03b6ffb63d55e59c9c0c736dd7c35410c31fadabafffcf26c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page