Skip to main content
Besides the offical OpenAI SDK for Ruby, there are two popular community Ruby libraries for working with OpenAI-compatible APIs: RubyLLM and ruby-openai. Both work seamlessly with Lumenfall.

RubyLLM

RubyLLM is currently the most popular Ruby gem for AI interactions according to GitHub stars. It provides a clean, Ruby-idiomatic interface with a beautiful DSL.

Installation

Add to your Gemfile:
Then run:

Configuration

When using RubyLLM with Lumenfall, you must include two parameters in every image generation call (see below for how to include them):
  • provider: "openai" - Tells RubyLLM to always route to Lumenfall’s OpenAI-compatible API
  • assume_model_exists: true - Bypasses RubyLLM’s model registry check to allow models that they don’t officially support
Without these parameters, RubyLLM may attempt to route requests to other providers and the call will fail.

Global configuration

Configure the API credentials globally:

Per-call configuration

You can also configure RubyLLM per-call without global setup, using RubyLLM.context:
This is useful when you need to make multiple calls with the same configuration or when you need to use different API credentials in different parts of your application.

Generate images

Use the paint method with the required Lumenfall parameters:

Image editing

RubyLLM does not support image editing. This is a known limitation tracked in GitHub issue #512. To edit images with Lumenfall, use an alternative SDK or make a HTTP call.

ruby-openai

ruby-openai is a featureful community-maintained Ruby client that closely follows the OpenAI API structure. It is not the official OpenAI Ruby SDK.

Installation

Add to your Gemfile:
Then run:

Configuration

Or configure globally:

Generate images

Generate multiple images

Get base64 response

Edit images

List models

Retrieve a specific model

Next steps

API Reference

Explore the full API documentation.

Available Models

See all available image generation models.