BoundaryML/baml · error · RuntimeError

No LLM response: {}

Error message

No LLM response: {}

What it means

The Ruby FFI's FunctionResult#raw calls into the Rust core's content(); if the LLM produced no content (e.g. the request failed or was not completed), it raises a Ruby RuntimeError 'No LLM response: <result>'.

Source

Thrown at engine/language_client_ruby/ext/ruby_ffi/src/function_result.rs:26

pub struct FunctionResult {
    inner: baml_runtime::FunctionResult,
}

impl FunctionResult {
    pub fn new(inner: baml_runtime::FunctionResult) -> Self {
        Self { inner }
    }

    #[allow(dead_code)]
    fn to_s(&self) -> String {
        format!("{}", self.inner)
    }

    #[allow(dead_code)]
    fn raw(&self) -> Result<String> {
        match self.inner.content() {
            Ok(content) => Ok(content.to_string()),
            Err(_) => Err(Error::new(
                runtime_error(),
                format!("No LLM response: {}", self.inner),
            )),
        }
    }

    pub fn parsed_using_types(
        ruby: &Ruby,
        rb_self: &FunctionResult,
        types: RModule,
        partial_types: RModule,
        allow_partials: bool,
    ) -> Result<Value> {
        let res = match rb_self.inner.result_with_constraints_content() {
            Ok(parsed) => ruby_to_json::RubyToJson::serialize_baml(
                ruby,
                types,
                partial_types,

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Check result success/status before calling raw
  2. Inspect the underlying error via the raised exception message or result error accessor
  3. Add retry/fallback logic in your BAML function config (retry policies, fallback providers)
  4. Verify API key and network connectivity

Example fix

// before
puts result.raw
// after
begin
  puts result.raw
rescue RuntimeError => e
  warn "LLM call failed: #{e.message}"
end
Defensive patterns

Strategy: try-catch

Validate before calling

# check the result carries content before calling raw
raise 'no content' if result.nil? || !result.respond_to?(:raw)

Try / catch

begin
  raw = result.raw
rescue RuntimeError => e
  logger.warn(e.message)
  raw = nil
end

Prevention

When it happens

Trigger: Calling .raw on a FunctionResult whose underlying content is Err — i.e. the LLM call failed before producing a response body.

Common situations: Provider outages, invalid API keys, or timeouts causing a failed result whose object is then inspected with raw instead of checking success first.

Related errors


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