Project

fino-solid

0.01
No release in over 3 years
ActiveRecord adapter for Fino settings engine
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0.5
>= 1.0
>= 1.4

Runtime

~> 1.4.0
 Project Readme

Fino

⚠️ Fino in active development phase at wasn't properly battle tested in production just yet. Give us a star and stay tuned for Production test results and new features

Fino is a dynamic settings engine for Ruby and Rails

Usage

Define settings via DSL

require "fino-redis"

Fino.configure do
  adapter do
    Fino::Redis::Adapter.new(
      Redis.new(**Rails.application.config_for(:redis))
    )
  end

  cache { Fino::Cache::Memory.new(expires_in: 3.seconds) }

  settings do
    setting :maintenance_mode, :boolean, default: false

    setting :api_rate_limit,
            :integer,
            default: 1000,
            description: "Maximum API requests per minute per user to prevent abuse"

    section :openai, label: "OpenAI" do
      setting :model,
              :string,
              default: "gpt-5",
              description: "OpenAI model"

      setting :temperature,
              :float,
              default: 0.7,
              description: "Model temperature"
    end

    section :feature_toggles, label: "Feature Toggles" do
      setting :new_ui, :boolean, default: true
      setting :beta_functionality, :boolean, default: false
    end

    section :my_micro_service, label: "My Micro Service" do
      setting :http_read_timeout, :integer, default: 200 # in ms
      setting :http_open_timeout, :integer, default: 100 # in ms
    end
  end
end

Work with settings

Fino.value(:model, at: :openai) #=> "gpt-5"
Fino.value(:temperature, at: :openai) #=> 0.7

Fino.values(:model, :temperature, at: :openai) #=> ["gpt-4", 0.7]

Fino.set(model: "gpt-5", at: :openai)
Fino.value(:model, at: :openai) #=> "gpt-5"

Overrides

Fino.value(:model, at: :openai) #=> "gpt-5"

Fino.set(model: "gpt-5", at: :openai, overrides: { "qa" => "our_local_model_not_to_pay_to_sam_altman" })

Fino.value(:model, at: :openai) #=> "gpt-5"
Fino.value(:model, at: :openai, for: "qa") #=> "our_local_model_not_to_pay_to_sam_altman"

A/B testing

Fino.value(:model, at: :openai) #=> "gpt-5"

# "gpt-5" becomes the control variant value and a 20.0% variant is created with value "gpt-6"
Fino.set(model: "gpt-5", at: :openai, variants: { 20.0 => "gpt-6" })

Fino.setting(:model, at: :openai).experiment.variant(for: "user_1") #=> #<Fino::AbTesting::Variant percentage: 20.0, value: "gpt-6">

# Picked variant is sticked to the user
Fino.value(:model, at: :openai, for: "user_1") #=> "gpt-6"
Fino.value(:model, at: :openai, for: "user_1") #=> "gpt-6"

Fino.value(:model, at: :openai, for: "user_2") #=> "gpt-5"

Rails integration

Fino easily integrates with Rails. Just add the gem to your Gemfile:

gem "fino-rails", require: false

to get built-in UI engine for your settings!

UI engine

Mount Fino Rails engine in your config/routes.rb:

Rails.application.routes.draw do
  mount Fino::Rails::Engine, at: "/fino"
end

Configuration

Rails.application.configure do
  config.fino.instrument = true
  config.fino.log = true
  config.fino.cache_within_request = false
  config.fino.preload_before_request = true
end
Screenshot 2025-09-19 at 13 09 06 Screenshot 2025-09-19 at 13 09 33

Performance tweaks

  1. In Memory cache

    Fino provides in-memory settings caching functionality which will store settings received from adaper in memory for a very quick access. As this kind of cache is not distributed between machines, but belongs to each process separately, it's impossible to invalidate all at once, so be aware that setting update application time will depend on cache TTL you configure

    Fino.configure do
      # ...
      cache { Fino::Cache::Memory.new(expires_in: 3.seconds) }
      # ...
    end
  2. Request scoped cache

    When using Fino in Rails context it's possible to cache settings within request, in current thread storage. This is safe way to cache settings as it's lifetime is limited, thus it is enabled by default

    Rails.application.configure do
      config.fino.cache_within_request = true
    end
  3. Preloading

    In Rails context it is possible to tell Fino to preload multiple settings before processing request in a single adapter call. Preloading is recommended for requests that use multiple different settings in their logic

    # Preload all settings
    Rails.application.configure do
      config.fino.preload_before_request = true
    end
    
    # Preload specific subset of settings depending on request
    Rails.application.configure do
      config.fino.preload_before_request = ->(request) {
        case request.path
        when "request/using/all/settings"
          true
        when "request/not/using/settings"
          false
        when "request/using/specific/settings"
          [
            :api_rate_limit,
            openai: [:model, :temperature]
          ]
        end
      }
    end

Releasing

rake release

Contributing

  1. Fork it
  2. Do contribution
  3. Create Pull Request into this repo