01 · Hello, local Python
The leaf node. If the SDK is not importable or the decorator is broken, nothing above this can be green. Two minutes, no infrastructure.
Exercises
- The Python SDK install path (uv / pip / editable).
@dls.udfsemantics — a bare@udf(noqueue=) runs the decorated function in-process on a direct call.- The always-local escape hatch:
train.local(...)bypasses any queue binding, so test code stays stable when the decorator later gains one.
Requires
- A Python ≥ 3.11 environment with
dreamlake-lakeshoreimportable. - That is it. No control plane, no daemon, no network — the local tier does not even import httpx or msgpack.
Verifies
The SDK as a leaf node. It imports cleanly, the decorator wraps without error, and the function executes and returns its value verbatim.
Run
train.py carries inline script metadata whose [tool.uv.sources] block
pins dreamlake-lakeshore to the ../../lakeshore-py checkout as an
editable install — so this runs the local source tree, not PyPI. To
exercise the published package instead, delete that block from the
script header; the sibling pyproject.toml declares
dreamlake-lakeshore>=0.3.7.
Plain pip works too:
Expected output
Three dicts, deterministic across runs because the example seeds
random. The third line comes from train.local(seed=1).
If it fails
| Symptom | Likely cause |
|---|---|
ModuleNotFoundError: No module named 'dreamlake' | The SDK is not in the active environment. Use uv run --with-editable lakeshore-py ... or pip install -e lakeshore-py. Note the install name is dreamlake-lakeshore, the import path dreamlake.lakeshore. |
TypeError on the decorator | An SDK version mismatch — the example declares dreamlake-lakeshore>=0.3.7. Bump or pin. |
Different loss values | Check that the example still seeds random before each call. The shape is what matters. |
Status
loading…Runs in the example smoke set; refresh /test-results.json via
uv run lakeshore-examples/test_runner.py.