# Visual Ray builder

The Ray DAG Builder is a canvas in EugoLab that writes Ray code into your notebook: how a graph becomes code, the two code styles, the Serve target, Compiled Graphs (beta) and how the builder protects your edits.

Source: https://docs.eugo.io/docs/platform/ray-builder/

---

The **Ray DAG Builder** is a visual canvas in [EugoLab](/docs/platform/eugolab.md) that writes Ray code into your notebook. You place Ray nodes on the canvas, edit their properties and wire them together, and the builder writes the Python into a notebook cell, rewriting it as you edit. You can then run that cell on your Eugo cluster from the builder itself.

> **Applies to:** the EugoLab image, November 2026.

To build and run your first graph, see the [Ray builder quickstart](/docs/platform/ray-builder-quickstart.md).

## How a graph becomes Ray code

The builder works in one direction, from the graph to the code:

- **The graph is the source.** Edits you make by hand to the generated code do not flow back into the graph. Change the graph, and the builder writes the cell again.
- **The graph lives in the notebook.** It is saved in the notebook cell's metadata, so it travels with the notebook file.
- **Nodes can use your own code.** A node can refer to functions and classes you defined in other cells of the same notebook.
- **Generated cells are marked.** Each generated cell starts with a comment line saying that the cell is generated from the visual graph and that edits made by hand may be overwritten.
- **The code reuses your connection.** Every generated program checks `if not ray.is_initialized():` before its `ray.init(...)`, so in a notebook that is already connected to a cluster, the program runs on that cluster.
- **Your hand edits are guarded.** If you emit onto a cell you have edited by hand, the builder first shows **Overwrite cell?**, with the current cell and the new code side by side ("Overwriting the target cell — current (left) vs new (right):"). Click **Overwrite** to replace the cell.
- **A broken graph does not emit.** While the graph has errors, such as a cycle or a duplicate or invalid name, the builder lists them in its sidebar and will not emit; the **Emit** button's tooltip reads "Fix the problems listed in the sidebar before emitting".

## What you can build

The builder covers five areas of Ray. Its tour names them "Ray Core, Data, Serve, Train, or Tune". The node palette on the left groups the nodes under the headings **Inputs**, **Ray Core**, **Ray Data**, **Ray Serve**, **Ray Train** (which also holds the Tune nodes) and **Experimental**. Every node is listed in the [Ray builder reference](/docs/platform/ray-builder-reference.md).

Each node's properties panel shows a one-line description of every field and a link to Ray's documentation.

## Choosing the code style

The **Mode:** selector in the builder's header chooses how the code calls Ray:

- **Imperative (.remote)**, the default for new graphs: the code calls `.remote()` on each task and actor directly.
- **ray.dag .bind()**: the code builds a Ray DAG with `.bind()` and then runs it.

In bind mode, actors live only as long as the DAG. With an actor in the graph, the header warns "⚠ .bind() actors are not persistent"; its tooltip explains: "Actors created with .bind() are torn down when the DAG finishes; use imperative mode for persistent actors."

The sidebar may also warn, in bind mode, that the graph emits a call Ray has deprecated: "This graph emits DAGNode.execute(), which Ray has deprecated — it warns at runtime and will stop working when Ray removes it. Compiled Graph (Accelerate) avoids it where the DAG is eligible; otherwise the imperative backend emits no deprecated call." Switch to **Imperative (.remote)**, or use a Compiled Graph (below) if your graph qualifies.

## Choosing the target: Ray Core or Ray Serve

The **Target:** selector chooses what kind of program the graph is: **Ray Core / Data** or **Ray Serve**. Its tooltip reads: "The graph target: Ray Core/Data (.remote / .bind / fluent chain) or Ray Serve (a .bind() deployment graph + serve.run)".

With **Ray Serve**, the **Mode:** selector is turned off: "Emit mode applies to Ray Core graphs only; a Serve graph always emits a .bind() deployment graph." A Serve graph is not run from the builder's **▶ Run** button: emitting it tells you "Emitted. Run the cell to serve.run(app) — in-app Run is disabled for Serve graphs."

## Compiled Graphs (beta)

In **ray.dag .bind()** mode, on a graph that is not a Serve graph, the header has an **accelerate ⚠** checkbox. It compiles the graph into a Ray Compiled Graph. Its tooltip: "Compile the bind DAG (experimental_compile, ⚠ beta) — applies only to an all-actor-method DAG with an input node; otherwise the plain bind shape is emitted and a warning explains why".

Compiled Graphs are a beta feature of Ray. With the checkbox on and an eligible graph, the generated code calls `experimental_compile()` and runs the compiled graph. When the graph is not eligible, the builder emits the plain bind graph instead, and the sidebar says: "Accelerate (Compiled Graph) was ignored — it requires the bind backend and an all-actor-method DAG with an input node and no plain tasks / fan-out / streaming."

So a graph qualifies when it is in bind mode, targets Ray Core, and is made only of actor methods fed by an input node, with no plain tasks, fan-out or streaming. Ray's own rules for Compiled Graphs then apply, as Ray's documentation on Compiled Graphs describes them.

## Graphs from other people

- **Graphs saved by a newer builder open read-only.** The header reads "🔒 Read-only — newer version (schema v&lt;n&gt;)", and editing is turned off, so the graph cannot be saved back in an older format.
- **Graphs from shared notebooks ask before they run code you cannot see.** When the target cell holds code the builder did not generate, such as a cell that came with someone else's notebook, every action that runs the graph's code without first writing it into a visible cell asks you to confirm: **Run with parameters**, **Preview data**, **Dataset stats**, **Submit Job**, and, for a Serve graph, the experimental **⚗ Deploy & Watch**. The **Run code from another notebook?** dialog says "This graph came from another notebook. Running it executes its code in your kernel. Continue only if you trust the source." Click **Run anyway** to go on. You are asked once for each target cell. **▶ Run** does not ask, because it writes the code into the cell before running it; writing onto a cell you did not generate shows the **Overwrite cell?** dialog described above (unless you set the overwrite guard to silent-on-foreign).

## How the builder fits into JupyterLab

The builder follows JupyterLab's theme, its settings are in JupyterLab's Settings Editor, every builder command is in the command palette (most of them start with "Ray DAG:"), and every mouse action has a keyboard equivalent. The [Ray builder reference](/docs/platform/ray-builder-reference.md) lists the settings and shortcuts.

## Related

- [Ray builder quickstart](/docs/platform/ray-builder-quickstart.md): open the builder, insert a starter, emit and run it on your cluster.
- [Starters and presets](/docs/platform/ray-builder-starters.md): the built-in example graphs, and saving your own.
- [Exporting a graph](/docs/platform/ray-builder-exports.md): take a graph out of the canvas as a module, a job script, a notebook or a Serve config.
- [Ray builder troubleshooting](/docs/platform/ray-builder-troubleshooting.md): the messages you may see, and what to do.
