Module: Aidp::Setup::ProviderRegistry
- Defined in:
- lib/aidp/setup/provider_registry.rb
Overview
Centralized registry for provider metadata including billing types and model families. This module provides a single source of truth for provider configuration options.
Constant Summary collapse
- BILLING_TYPES =
Billing type options for providers
[ { label: "Subscription / flat-rate", value: "subscription", description: "Monthly or annual subscription with unlimited usage" }, { label: "Usage-based / metered (API)", value: "usage_based", description: "Pay per API call or token usage" }, { label: "Passthrough / local (no billing)", value: "passthrough", description: "Local execution or proxy without direct billing" } ].freeze
- MODEL_FAMILIES =
Model family options for providers
[ { label: "Auto (let provider decide)", value: "auto", description: "Use provider's default model selection" }, { label: "OpenAI o-series (reasoning models)", value: "openai_o", description: "Advanced reasoning capabilities, slower but more thorough" }, { label: "Anthropic Claude (balanced)", value: "claude", description: "Balanced performance for general-purpose tasks" }, { label: "Google Gemini (multimodal)", value: "gemini", description: "Google's multimodal AI with strong reasoning and vision capabilities" }, { label: "Meta Llama (open-source)", value: "llama", description: "Meta's open-source model family, suitable for self-hosting" }, { label: "DeepSeek (efficient reasoning)", value: "deepseek", description: "Cost-efficient reasoning models with strong performance" }, { label: "Mistral (European/open)", value: "mistral", description: "European provider with open-source focus" }, { label: "Local LLM (self-hosted)", value: "local", description: "Self-hosted or local model execution" } ].freeze
Class Method Summary collapse
-
.billing_type_choices ⇒ Object
Returns array of [label, value] pairs for billing types.
-
.billing_type_description(value) ⇒ Object
Finds description for a given billing type value.
-
.billing_type_label(value) ⇒ Object
Finds label for a given billing type value.
-
.billing_type_values ⇒ Object
Returns all valid billing type values.
-
.model_family_choices ⇒ Object
Returns array of [label, value] pairs for model families.
-
.model_family_description(value) ⇒ Object
Finds description for a given model family value.
-
.model_family_label(value) ⇒ Object
Finds label for a given model family value.
-
.model_family_values ⇒ Object
Returns all valid model family values.
-
.valid_billing_type?(value) ⇒ Boolean
Validates if a billing type value is valid.
-
.valid_model_family?(value) ⇒ Boolean
Validates if a model family value is valid.
Class Method Details
.billing_type_choices ⇒ Object
Returns array of [label, value] pairs for billing types
72 73 74 |
# File 'lib/aidp/setup/provider_registry.rb', line 72 def self.billing_type_choices BILLING_TYPES.map { |bt| [bt[:label], bt[:value]] } end |
.billing_type_description(value) ⇒ Object
Finds description for a given billing type value
92 93 94 |
# File 'lib/aidp/setup/provider_registry.rb', line 92 def self.billing_type_description(value) BILLING_TYPES.find { |bt| bt[:value] == value }&.dig(:description) end |
.billing_type_label(value) ⇒ Object
Finds label for a given billing type value
82 83 84 |
# File 'lib/aidp/setup/provider_registry.rb', line 82 def self.billing_type_label(value) BILLING_TYPES.find { |bt| bt[:value] == value }&.dig(:label) || value end |
.billing_type_values ⇒ Object
Returns all valid billing type values
112 113 114 |
# File 'lib/aidp/setup/provider_registry.rb', line 112 def self.billing_type_values BILLING_TYPES.map { |bt| bt[:value] } end |
.model_family_choices ⇒ Object
Returns array of [label, value] pairs for model families
77 78 79 |
# File 'lib/aidp/setup/provider_registry.rb', line 77 def self.model_family_choices MODEL_FAMILIES.map { |mf| [mf[:label], mf[:value]] } end |
.model_family_description(value) ⇒ Object
Finds description for a given model family value
97 98 99 |
# File 'lib/aidp/setup/provider_registry.rb', line 97 def self.model_family_description(value) MODEL_FAMILIES.find { |mf| mf[:value] == value }&.dig(:description) end |
.model_family_label(value) ⇒ Object
Finds label for a given model family value
87 88 89 |
# File 'lib/aidp/setup/provider_registry.rb', line 87 def self.model_family_label(value) MODEL_FAMILIES.find { |mf| mf[:value] == value }&.dig(:label) || value end |
.model_family_values ⇒ Object
Returns all valid model family values
117 118 119 |
# File 'lib/aidp/setup/provider_registry.rb', line 117 def self.model_family_values MODEL_FAMILIES.map { |mf| mf[:value] } end |
.valid_billing_type?(value) ⇒ Boolean
Validates if a billing type value is valid
102 103 104 |
# File 'lib/aidp/setup/provider_registry.rb', line 102 def self.valid_billing_type?(value) BILLING_TYPES.any? { |bt| bt[:value] == value } end |
.valid_model_family?(value) ⇒ Boolean
Validates if a model family value is valid
107 108 109 |
# File 'lib/aidp/setup/provider_registry.rb', line 107 def self.valid_model_family?(value) MODEL_FAMILIES.any? { |mf| mf[:value] == value } end |