BoundaryML/baml · error

Execution Node out of bounds (raw curl)

Error message

Execution Node out of bounds (raw curl): {} >= {} for client {}

What it means

Thrown by render_raw_curl_impl when the requested orchestrator execution node index is beyond the number of nodes the orchestrator actually selected for the client. Raw-curl rendering can target a specific execution node; here node_index (defaulting to 0) is compared against selected.len() and rejected with both bounds and the client spec. It guards against indexing out of the orchestrator's candidate list.

Solutions

  1. Pass a node_index less than the number of orchestrator nodes (or omit it to use node 0)
  2. Inspect the client's retry/fallback strategy in .baml to know how many execution nodes exist
  3. If selected.len() is 0, fix the client configuration so the orchestrator produces at least one node
  4. Handle the error in tooling by clamping node_index or enumerating nodes before rendering

Example fix

// before
let curl = runtime.render_raw_curl("MyFunc", &ctx, &prompt, settings, Some(3)).await?;
// after
let idx = 3.min(node_count.saturating_sub(1)); // or None for the first node
let curl = runtime.render_raw_curl("MyFunc", &ctx, &prompt, settings, Some(idx)).await?;
Defensive patterns

Strategy: validation

Validate before calling

// Clamp node_index before calling raw curl rendering
let idx = match node_index {
    Some(i) if i < selected_len => i,
    _ => 0,
};

Prevention

When it happens

Trigger: Calling render_raw_curl with node_index = Some(n) where n >= number of orchestrator nodes selected for the resolved LLM client (selected.len() == 0 also fails for any index, including the default 0).

Common situations: Requesting an alternate fallback/shard node that does not exist because no retry/fallback strategy is configured; the client resolved to a single node but a higher node_index was passed; client configuration changed so fewer orchestrator nodes are produced than the tooling assumes.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/d805e21009df3a39. Report an issue: GitHub.

Appendix: source

Thrown at engine/baml-runtime/src/lib.rs:938

        &self,
        function_name: &str,
        ctx: &RuntimeContext,
        prompt: &[internal_baml_jinja::RenderedChatMessage],
        render_settings: RenderCurlSettings,
        node_index: Option<usize>,
    ) -> Result<String> {
        let func = self.get_function(function_name)?;
        let renderer = PromptRenderer::from_function(&func, self.ir(), ctx)?;

        let client_spec = renderer.client_spec();
        let client = self.get_llm_provider_impl(client_spec, ctx)?;
        let mut selected =
            client.iter_orchestrator(&mut Default::default(), Default::default(), ctx, self)?;

        let node_index = node_index.unwrap_or(0);

        if node_index >= selected.len() {
            return Err(anyhow::anyhow!(
                "Execution Node out of bounds (raw curl): {} >= {} for client {}",
                node_index,
                selected.len(),
                client_spec,
            ));
        }

        let node = selected.swap_remove(node_index);
        node.provider
            .render_raw_curl(ctx, prompt, render_settings)
            .await
    }

    pub async fn run_test_with_expr_events<F, G>(
        &self,
        function_name: &str,
        test_name: &str,
        ctx: &RuntimeContextManager,

View on GitHub (pinned to bd85ce9dee)