class RubyLLM::Configuration

A Configuration holds every RubyLLM setting: provider credentials, default models, timeouts, retries, logging, and the model registry. The global instance is yielded by RubyLLM.configure and available as RubyLLM.config.

RubyLLM.configure do |config|
  config.openai_api_key = ENV['OPENAI_API_KEY']
  config.anthropic_api_key = ENV['ANTHROPIC_API_KEY']
end

RubyLLM.context yields an isolated copy for per-request or per-tenant overrides.

Provider credentials such as openai_api_key are declared by each provider. See the configuration guides for the full list.

Assigning an empty or whitespace-only string to any option stores nil, so unset environment variables behave as if the option was never set.