Per request configuration / Multi Tenants with multiple api_keys #37
Unanswered
gamecreature
asked this question in
Q&A
Replies: 1 comment
-
For the moment I've implemented a monkey patch for the Rails project. (place this in the config/initializers) require 'ruby_llm'
module RubyLLM
class Current < ActiveSupport::CurrentAttributes
attribute :config
end
@@config_mutex = Mutex.new
def self.config
@@config_mutex.synchronize {
Current.config ||= Configuration.new
}
end
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a multi-tenant rails application (running in a threaded Puma server).
We would love to have the possibility to use a different api-key per client.
This doesn't seem possible with the current global RubyLLM.config. What's the recommended way to way achieve this (if possible)?
(So basically I'm looking for a per-request configuration option).
Btw thanks for this nice gem! 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions