Skip to main content
A model declares a graph of nodes. A request takes one or more paths through that graph, called walks. A deployment config places the nodes on GPU ranks. BAGEL can answer a question about an image or generate an image from text using the same model and different walks.

Follow a request

  1. Receive. The Rust frontend accepts HTTP and WebSocket requests. A data-worker thread in the Python API server loads media and calls the model’s process_prompt. The API process holds the tokenizer and configuration. GPU workers load the model weights. Frontend · Data worker
  2. Dispatch. The conductor chooses a replica, admits the request for dispatch, and starts the next walk in its plan. Control messages name the inputs. The workers read the tensor bytes from their producer over SHM, TCP, or RDMA. Bulk tensors bypass the conductor. Conductor · Transport choices
  3. Execute. Each GPU worker’s graph runtime identifies which nodes have their inputs. Its scheduler groups compatible rows. The engine executes the selected submodule and its declared resources. Nodes can pass results to another worker, loop back locally, or emit to the client. Worker · Engine
  4. Return. The data worker applies the model’s postprocess. The frontend sends the result as a response or a stream. The conductor advances to the next walk until the request’s partitions finish.

Walks and partitions

A text decoder usually runs prefill once and decode in a loop. A diffusion model knows the denoising step count at intake and can cap its loop then. Orpheus has two independent partitions. Its LLM generates tokens while the audio decoder consumes windows over a streaming edge. A chunk policy controls when a window is ready. Graph primitives · Orpheus walk plan

State belongs to nodes

An LLM can declare a paged KV array and a sampler. A codec decoder may need no persistent state. The engine builds resources and binds their handles only to the nodes that requested them. Each step declares what it will read, append, update, or sample. This lets the engine check capacity before the forward and release or offload resources when needed. State contract

Batching and replay

A worker admits the rows, plans their resources, runs the forward, and commits the step. The same declarations serve eager execution and accelerator graph replay. For replay, the engine pads to a captured shape and uses the planned state for the real rows. During async scheduling, it can prepare the next step before the current one finishes. Synchronizing on a device tensor in a model’s preparation code stalls that overlap. Batching and capture

Placement and memory pressure

A deployment’s node_groups can colocate an encoder and decoder, put them on separate ranks, or distribute one node over several ranks. Ranks collaborating on a node execute the same collective operations, in the same order. Scheduling or eviction decisions that can vary by rank must be agreed or replayed across the group. When paged KV is full, a worker can offload a request to configured host pages or rebuild eligible state from saved inputs. Prefix caching can reuse completed pages when a later request identifies the same prefix. These decisions depend on the resource declarations and deployment. Place nodes on ranks · Prefix reuse

Startup and process failures

The conductor validates the deployment before starting workers. Workers load weights, compile, and capture. The API server runs configured warmups before the frontend binds. A refused connection during this interval can be normal. Use the cold-start guide to distinguish progress from a startup failure.