Skip to main content
BAGEL can answer questions about an image, generate an image from text, or edit an existing image. All three tasks use the same checkpoint.

Install and start

Start with the single-GPU default. To place the three guidance branches on separate GPUs, use bagel_cfg_parallel with --gpus 0,1,2. The vision encoder falls back to PyTorch SDPA when FlashAttention is unavailable.

bagel

Text, image → text, image. The default bagel_single_gpu.yaml uses 1 GPU. The weights use Apache-2.0.
Send the request.

bagel_cfg_parallel

Text, image → text, image. The default bagel_cfg_parallel.yaml uses 3 GPUs. The weights use Apache-2.0.
Send the request.

Send a request

Run either client example in a second terminal after /health returns 200.

Generate an image

Save the returned PNG. Python SDK
curl

Deployment configs

A custom config that places the LLM per walk lists image_gen_head, image_gen, image_gen_guided2 and image_gen_guided3 on the GPU that generates images, as configs/bagel_pd_disaggregated.yaml does. To use an alternative, pass --config configs/<file> after the launcher name. From a wheel installation, copy the shipped YAML and pass its local path.

Settings and defaults

Request knobs go in model_kwargs on /generate and in extra_body on the OpenAI routes. Deployment: model_kwargs.accelerator_graph: false serves without graph capture (default true). With capture on, MSTAR_VIT_ACCELERATOR_GRAPH=1 also captures the ViT encoder.

Limits

  • Generated images are at most 1024 pixels a side.
  • A min_p above 0 is refused.
  • The chat route refuses tool calls, n above 1, stop sequences and OpenAI logprobs.