Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

dream-engine — Python SDK for Dream Engine

dream-engine is the official Python SDK for Dream Engine, the inference engine for video world models from Dream Engines. Run frontier world models (DreamDojo · GR-1, more on the way) over HTTP with a small, typed client.

Status: v0.4.0 — stable release. Rollout, AsyncClient, typed errors, retries, predict_batch, and bundled examples are all available. See sdk/python/CHANGELOG.md for the full version history.

Install

pip install dream-engine

For mp4 → numpy frame decoding:

pip install "dream-engine[decode]"

Quickstart

import dream
import numpy as np
from PIL import Image

client = dream.Client()                              # reads DREAM_API_KEY + DREAM_BASE_URL
model  = client.models.get("dreamdojo-2b-gr1")       # ModelHandle (typed; checks the catalog)
print(model.action_dim, model.resolution)            # 384, (480, 640) — flat accessors

img  = Image.open("start.png")
acts = np.load("actions.npy")                        # (48, 384) float32

rollout = model.predict(start_frame=img, actions=acts)
print("frames:", rollout.frames, "cost:", rollout.cost_usd)
rollout.save("rollout.mp4")

# Access decoded frames as a numpy array (requires [decode] extra):
print(rollout.video().shape)  # (T, H, W, 3) uint8

You can also pass file paths or raw bytes:

# Paths (str or Path) — SDK reads the file and encodes for the wire
rollout = model.predict(start_frame="start.png", actions="actions.npy")

Set DREAM_API_KEY in your environment, or pass api_key=... to the Client(...) constructor. Mint keys at https://dreamengines.run/dashboard.

List the catalog

for handle in client.models.list():
    print(handle.slug, handle.spec.name, "active" if handle.active else "")

Visual MPC — K candidates in one server roundtrip

import numpy as np

candidates = np.random.randn(8, 48, 384).astype(np.float32)  # (K, T, action_dim)

batch = model.predict_batch(start_frame=img, actions=candidates)
print(batch.batch_size, batch.engine_wall_ms)
for r in batch.rollouts:
    print(r.cost_usd)

Wire-level access (advanced)

If you want to skip the ModelHandle layer and call the endpoint with pre-encoded bytes:

# Low-level: bypasses active-spec check and input coercion
response = client.predict(frame_bytes=frame_bytes, actions_bytes=actions_bytes)

Prefer model.predict(start_frame=…, actions=…) for most use cases. The wire-level path is for scripts that already have wire-ready bytes and don't need the typed Rollout result.

License

Apache-2.0. See LICENSE.

Metadata

Release files for dream-engine 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for dream-engine 0.5.0
File Size Uploaded Provenance
dream_engine-0.5.0.tar.gz 577.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dream-engine 0.5.0
File Interpreter ABI Platform
dream_engine-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / dream_engine-0.5.0.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL dream_engine-0.5.0.tar.gz
Size 577.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9451bd53efc8f1098b6a4dfeb7a5f50650640bbac2a50dfb9a51c7d39134960c
BLAKE2b-256 checksum
How to use checksums
1eaa5381728eccc72ed764589649e7e604c7031f5a602488aa596062ba572489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / dream_engine-0.5.0-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL dream_engine-0.5.0-py3-none-any.whl
Size 582.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56e246bc4a2474fd071f6dbb117eac1dc22a8cdbb79701f5a8d1d7d87ca1b169
BLAKE2b-256 checksum
How to use checksums
868bb5f8a6896331239f99272f90e882f29447008c2b2696413c47f592be0d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for dream-engine 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.2.1 2 files With provenance
  • Added 0.5.0 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page