pave_ai 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +195 -0
- data/app/assets/stylesheets/pave_ai/application.css +15 -0
- data/app/controllers/pave_ai/application_controller.rb +4 -0
- data/app/helpers/pave_ai/application_helper.rb +4 -0
- data/app/jobs/pave_ai/application_job.rb +4 -0
- data/app/mailers/pave_ai/application_mailer.rb +6 -0
- data/app/models/pave_ai/application_record.rb +5 -0
- data/app/models/pave_ai/chat.rb +49 -0
- data/app/models/pave_ai/chat_message.rb +28 -0
- data/app/models/pave_ai/intent.rb +34 -0
- data/app/models/pave_ai/persona.rb +34 -0
- data/app/models/pave_ai/persona_document.rb +35 -0
- data/app/models/pave_ai/quota.rb +77 -0
- data/app/models/pave_ai/spend_log.rb +47 -0
- data/app/services/pave_ai/client/provider.rb +50 -0
- data/app/services/pave_ai/client/providers/anthropic.rb +15 -0
- data/app/services/pave_ai/client/providers/gemini.rb +15 -0
- data/app/services/pave_ai/client/providers/ollama.rb +16 -0
- data/app/services/pave_ai/client/providers/openai.rb +14 -0
- data/app/services/pave_ai/client/providers/openai_compatible.rb +18 -0
- data/app/services/pave_ai/client/providers/xai.rb +14 -0
- data/app/services/pave_ai/client/providers/zai.rb +13 -0
- data/app/services/pave_ai/client/providers/zen.rb +12 -0
- data/app/services/pave_ai/client.rb +683 -0
- data/app/services/pave_ai/credential.rb +66 -0
- data/app/services/pave_ai/governance.rb +70 -0
- data/app/services/pave_ai/rates.rb +101 -0
- data/app/services/pave_ai/spend.rb +539 -0
- data/app/views/layouts/pave_ai/application.html.erb +17 -0
- data/config/ai_governance/ETHICS.md +20 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20260404000001_create_pave_ai_tables.rb +102 -0
- data/db/migrate/20260820000002_add_billable_to_pave_ai_spend_logs.rb +5 -0
- data/db/migrate/20260827000001_add_model_to_pave_ai_spend_logs.rb +8 -0
- data/db/migrate/20260828000001_add_intent_credit_cost_and_log_credits.rb +10 -0
- data/db/migrate/20261123000001_remove_quota_limit_defaults.rb +9 -0
- data/lib/generators/pave_ai/install/install_generator.rb +61 -0
- data/lib/pave_ai/engine.rb +23 -0
- data/lib/pave_ai/middleware/request_cleanup.rb +17 -0
- data/lib/pave_ai/version.rb +3 -0
- data/lib/pave_ai.rb +247 -0
- data/lib/tasks/pave_ai_tasks.rake +4 -0
- metadata +127 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
class AddModelToPaveAiSpendLogs < ActiveRecord::Migration[8.0]
|
|
2
|
+
def change
|
|
3
|
+
# Which model was actually invoked. Without it a bill cannot be
|
|
4
|
+
# reconstructed — the question the metering contract promises to answer.
|
|
5
|
+
add_column :pave_ai_spend_logs, :model, :string
|
|
6
|
+
add_index :pave_ai_spend_logs, :model
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
class AddIntentCreditCostAndLogCredits < ActiveRecord::Migration[8.0]
|
|
2
|
+
def change
|
|
3
|
+
# What a feature costs the customer, in credits. Price belongs to the
|
|
4
|
+
# intent (the modality/feature), never to the provider.
|
|
5
|
+
add_column :pave_ai_intents, :credit_cost, :integer, null: false, default: 1
|
|
6
|
+
|
|
7
|
+
# What we actually charged, alongside what it cost us.
|
|
8
|
+
add_column :pave_ai_spend_logs, :credits_charged, :integer, null: false, default: 0
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
class RemoveQuotaLimitDefaults < ActiveRecord::Migration[8.0]
|
|
2
|
+
def change
|
|
3
|
+
# Allowances are the host's plan (config.quota_tiers), so the schema
|
|
4
|
+
# carries no default of its own. Existing rows keep their limits.
|
|
5
|
+
change_column_default :pave_ai_quotas, :generations_limit, from: 50, to: nil
|
|
6
|
+
change_column_default :pave_ai_quotas, :exports_limit, from: 20, to: nil
|
|
7
|
+
change_column_default :pave_ai_quotas, :credits_limit, from: 20, to: nil
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
module PaveAi
|
|
2
|
+
module Generators
|
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
|
4
|
+
source_root File.expand_path("templates", __dir__)
|
|
5
|
+
|
|
6
|
+
desc "Install PaveAI engine — creates the initializer (engine migrations append automatically)"
|
|
7
|
+
|
|
8
|
+
def create_initializer
|
|
9
|
+
create_file "config/initializers/pave_ai.rb", <<~RUBY
|
|
10
|
+
PaveAi.configure do |config|
|
|
11
|
+
# Provider settings
|
|
12
|
+
config.default_provider = "openai"
|
|
13
|
+
config.openai_api_key = Rails.application.credentials.dig(:openai, :api_key)
|
|
14
|
+
# config.zen_api_key = Rails.application.credentials.dig(:zen, :api_key)
|
|
15
|
+
# config.xai_api_key = Rails.application.credentials.dig(:xai, :api_key)
|
|
16
|
+
# config.zai_api_key = Rails.application.credentials.dig(:zai, :api_key)
|
|
17
|
+
# config.ollama_url = "http://localhost:11434"
|
|
18
|
+
|
|
19
|
+
# User class (must respond to :id)
|
|
20
|
+
config.user_class = "User"
|
|
21
|
+
|
|
22
|
+
# Your plans and prices — the engine ships none and refuses to
|
|
23
|
+
# meter until these are set.
|
|
24
|
+
# config.quota_tiers = {
|
|
25
|
+
# user: { generations: ..., exports: ..., credits: ... },
|
|
26
|
+
# free: { generations: ..., exports: ..., credits: ... },
|
|
27
|
+
# admin: { generations: ..., exports: ..., credits: ... }
|
|
28
|
+
# }
|
|
29
|
+
# config.quota_tier_proc = ->(user) { user.plan.to_sym } # default: admin/free/user flags
|
|
30
|
+
# config.monthly_budget_cents = ... # or ai_budget_remaining_proc
|
|
31
|
+
# config.credits_for_cost_proc = ->(cost_cents) { ... } # for intents without a credit_cost
|
|
32
|
+
# config.denial_messages = { credits_exhausted: "...", budget_reached: "..." }
|
|
33
|
+
|
|
34
|
+
# Optional: override budget/cost procs for your app
|
|
35
|
+
# config.ai_budget_remaining_proc = -> { Setting.ai_budget_remaining }
|
|
36
|
+
# config.estimate_text_cost_proc = ->(provider, tokens) { ... }
|
|
37
|
+
# config.record_usage_proc = ->(cost, provider:) { ... }
|
|
38
|
+
# config.request_policy_proc = ->(provider:, intent:, kind:, user:, context:) { true }
|
|
39
|
+
|
|
40
|
+
# Persona system
|
|
41
|
+
config.persona_enabled = true
|
|
42
|
+
|
|
43
|
+
# Optional: custom ethics file
|
|
44
|
+
# config.ethics_file_path = Rails.root.join("config/ai_governance/ETHICS.md")
|
|
45
|
+
end
|
|
46
|
+
RUBY
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def show_readme
|
|
50
|
+
say ""
|
|
51
|
+
say "PaveAI installed successfully!", :green
|
|
52
|
+
say ""
|
|
53
|
+
say "Next steps:"
|
|
54
|
+
say " 1. Edit config/initializers/pave_ai.rb: API keys, plans and prices"
|
|
55
|
+
say " 2. Run: rails db:migrate"
|
|
56
|
+
say " 3. Mount in config/routes.rb: mount PaveAi::Engine, at: '/ai'"
|
|
57
|
+
say ""
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require "pave_ai/middleware/request_cleanup"
|
|
2
|
+
|
|
3
|
+
module PaveAi
|
|
4
|
+
class Engine < ::Rails::Engine
|
|
5
|
+
isolate_namespace PaveAi
|
|
6
|
+
|
|
7
|
+
initializer "pave_ai.setup" do
|
|
8
|
+
PaveAi.setup!
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
initializer "pave_ai.middleware" do |app|
|
|
12
|
+
app.middleware.use PaveAi::Middleware::RequestCleanup
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
initializer "pave_ai.append_migrations" do |app|
|
|
16
|
+
unless app.root.to_s.match?(root.to_s)
|
|
17
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
|
18
|
+
app.config.paths["db/migrate"] << expanded_path
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PaveAi
|
|
4
|
+
module Middleware
|
|
5
|
+
class RequestCleanup
|
|
6
|
+
def initialize(app)
|
|
7
|
+
@app = app
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def call(env)
|
|
11
|
+
@app.call(env)
|
|
12
|
+
ensure
|
|
13
|
+
PaveAi::PersonaDocument.clear_request_cache! if defined?(PaveAi::PersonaDocument)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/pave_ai.rb
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
require "ruby_llm"
|
|
2
|
+
require "pave_ai/version"
|
|
3
|
+
require "pave_ai/engine"
|
|
4
|
+
|
|
5
|
+
module PaveAi
|
|
6
|
+
mattr_accessor :config
|
|
7
|
+
|
|
8
|
+
class << self
|
|
9
|
+
def configure
|
|
10
|
+
self.config ||= Configuration.new
|
|
11
|
+
yield(config) if block_given?
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def setup!
|
|
15
|
+
self.config ||= Configuration.new
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class Configuration
|
|
20
|
+
DEFAULT_DENIAL_MESSAGES = {
|
|
21
|
+
credits_exhausted: "AI credit limit reached.",
|
|
22
|
+
budget_reached: "AI is temporarily unavailable. Please try again later."
|
|
23
|
+
}.freeze
|
|
24
|
+
|
|
25
|
+
# Provider settings
|
|
26
|
+
attr_accessor :default_provider # "openai", "zen", "ollama", etc.
|
|
27
|
+
attr_accessor :openai_api_key, :xai_api_key, :zai_api_key, :zen_api_key
|
|
28
|
+
attr_accessor :anthropic_api_key, :gemini_api_key
|
|
29
|
+
attr_accessor :ollama_url, :ollama_model, :zen_model, :zai_model
|
|
30
|
+
attr_accessor :ai_image_provider
|
|
31
|
+
|
|
32
|
+
# Plans and prices belong to the host, never to the engine. Each of these
|
|
33
|
+
# is nil until the host sets it, and the engine refuses to meter rather
|
|
34
|
+
# than charge by someone else's price list.
|
|
35
|
+
#
|
|
36
|
+
# quota_tiers: { tier => { generations:, exports:, credits: } } — the
|
|
37
|
+
# host's monthly allowances. quota_tier_proc picks a user's tier.
|
|
38
|
+
attr_accessor :quota_tiers, :quota_tier_proc
|
|
39
|
+
# The platform's paid-provider budget, in cents (or override the proc).
|
|
40
|
+
attr_accessor :monthly_budget_cents, :ai_budget_remaining_proc
|
|
41
|
+
# Credits deducted for an operation costing N cents, when its intent
|
|
42
|
+
# carries no credit_cost of its own.
|
|
43
|
+
attr_accessor :credits_for_cost_proc
|
|
44
|
+
# true refuses any intent without its own credit_cost instead of falling
|
|
45
|
+
# back to credits_for_cost_proc — catches a typo'd intent name.
|
|
46
|
+
attr_accessor :require_priced_intents
|
|
47
|
+
# What the customer is told when a request is refused:
|
|
48
|
+
# { credits_exhausted:, budget_reached: } (budget_reached may use %{provider}).
|
|
49
|
+
attr_accessor :denial_messages
|
|
50
|
+
|
|
51
|
+
# What an operation costs US — estimates, not prices.
|
|
52
|
+
attr_accessor :estimate_text_cost_proc, :estimate_image_cost_proc
|
|
53
|
+
attr_accessor :record_usage_proc
|
|
54
|
+
|
|
55
|
+
# Rates as data: "model-id" => { input:, output:, cached:, verified_on: }
|
|
56
|
+
# (USD per million tokens). Pin explicit model IDs, never aliases.
|
|
57
|
+
# Consulted by PaveAi::Rates before the RubyLLM registry.
|
|
58
|
+
attr_accessor :model_rates
|
|
59
|
+
attr_accessor :rates_max_age_days
|
|
60
|
+
|
|
61
|
+
# Providers the global budget gate does not block (cheap/flat-rate
|
|
62
|
+
# vendors we hold keys for), and where to downgrade when the paid
|
|
63
|
+
# budget is exhausted: { provider:, model: } or nil.
|
|
64
|
+
attr_accessor :budget_exempt_providers
|
|
65
|
+
attr_accessor :budget_fallback
|
|
66
|
+
|
|
67
|
+
# User class (string, e.g. "User")
|
|
68
|
+
attr_accessor :user_class
|
|
69
|
+
|
|
70
|
+
# Ethics file path (override in host app)
|
|
71
|
+
attr_accessor :ethics_file_path
|
|
72
|
+
|
|
73
|
+
# Persona enabled flag
|
|
74
|
+
attr_accessor :persona_enabled
|
|
75
|
+
|
|
76
|
+
# Feature purpose routing (procs that take purpose symbol, return provider/model strings)
|
|
77
|
+
attr_accessor :provider_for_purpose_proc
|
|
78
|
+
attr_accessor :model_for_purpose_proc
|
|
79
|
+
# Optional host-side request policy hook
|
|
80
|
+
attr_accessor :request_policy_proc
|
|
81
|
+
|
|
82
|
+
def initialize
|
|
83
|
+
@default_provider = "openai"
|
|
84
|
+
@ollama_url = "http://localhost:11434"
|
|
85
|
+
@ollama_model = "llama3.1:8b"
|
|
86
|
+
@zen_model = "kimi-k2.5"
|
|
87
|
+
@zai_model = "glm-4.7-flash"
|
|
88
|
+
@user_class = "User"
|
|
89
|
+
@require_priced_intents = false
|
|
90
|
+
@persona_enabled = true
|
|
91
|
+
@ai_image_provider = "openai"
|
|
92
|
+
@model_rates = {}
|
|
93
|
+
@rates_max_age_days = 30
|
|
94
|
+
@budget_exempt_providers = [ "ollama" ]
|
|
95
|
+
@budget_fallback = nil
|
|
96
|
+
|
|
97
|
+
@denial_messages = DEFAULT_DENIAL_MESSAGES.dup
|
|
98
|
+
# Tier selection by the user's duck-typed flags; the tiers' numbers
|
|
99
|
+
# come only from quota_tiers.
|
|
100
|
+
@quota_tier_proc = lambda do |user|
|
|
101
|
+
if user.respond_to?(:pave_ai_admin?) && user.pave_ai_admin?
|
|
102
|
+
:admin
|
|
103
|
+
elsif user.respond_to?(:pave_ai_free?) && user.pave_ai_free?
|
|
104
|
+
:free
|
|
105
|
+
else
|
|
106
|
+
:user
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Default procs — host app overrides these
|
|
111
|
+
@ai_budget_remaining_proc = -> { required!(:monthly_budget_cents, monthly_budget_cents) }
|
|
112
|
+
# Real cents from the rates data when the provider's default model is
|
|
113
|
+
# rated; the historical flat 1 only when it is not. Estimated tokens
|
|
114
|
+
# are priced as output tokens (the expensive side) — an estimate
|
|
115
|
+
# should err against us, not the customer.
|
|
116
|
+
@estimate_text_cost_proc = lambda do |provider, tokens|
|
|
117
|
+
if provider.to_s == "ollama"
|
|
118
|
+
0
|
|
119
|
+
else
|
|
120
|
+
adapter = begin
|
|
121
|
+
PaveAi::Client::Provider.for(provider)
|
|
122
|
+
rescue StandardError
|
|
123
|
+
nil
|
|
124
|
+
end
|
|
125
|
+
rated = adapter && PaveAi::Rates.text_cost_cents(
|
|
126
|
+
model: adapter.default_model, provider: provider, output_tokens: tokens || 500
|
|
127
|
+
)
|
|
128
|
+
rated || 1
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
@estimate_image_cost_proc = ->(provider) { 5 }
|
|
132
|
+
@record_usage_proc = ->(cost, provider:) { }
|
|
133
|
+
@provider_for_purpose_proc = ->(purpose) { @default_provider }
|
|
134
|
+
@model_for_purpose_proc = ->(purpose) { nil }
|
|
135
|
+
@request_policy_proc = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def user_model
|
|
139
|
+
@user_class.constantize
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def ai_budget_remaining
|
|
143
|
+
ai_budget_remaining_proc.call
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def estimate_text_cost(provider, tokens)
|
|
147
|
+
estimate_text_cost_proc.call(provider, tokens)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def estimate_image_cost(provider)
|
|
151
|
+
estimate_image_cost_proc.call(provider)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def credits_for_cost(cost_cents)
|
|
155
|
+
required!(:credits_for_cost_proc, credits_for_cost_proc).call(cost_cents.to_i)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# The host's allowances for this user's tier. Tier names and allowance
|
|
159
|
+
# keys may be symbols or strings; every allowance must be a whole number.
|
|
160
|
+
def quota_limits_for(user)
|
|
161
|
+
tiers = required!(:quota_tiers, quota_tiers).to_h.transform_keys(&:to_sym)
|
|
162
|
+
tier = quota_tier_proc.call(user).to_s.to_sym
|
|
163
|
+
limits = tiers.fetch(tier) { missing!("quota_tiers has no #{tier.inspect} tier") }.to_h.transform_keys(&:to_sym)
|
|
164
|
+
%i[generations exports credits].to_h do |key|
|
|
165
|
+
value = limits.fetch(key) { missing!("quota tier #{tier.inspect} is missing #{key}") }
|
|
166
|
+
missing!("quota tier #{tier.inspect} #{key} must be a whole number >= 0") unless value.is_a?(Integer) && value >= 0
|
|
167
|
+
[ key, value ]
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# The host's words for a refusal, falling back per key to the neutral
|
|
172
|
+
# default. Only %{provider} is substituted, so a literal % is safe.
|
|
173
|
+
def denial_message(key, provider: nil)
|
|
174
|
+
message = denial_messages.to_h.transform_keys(&:to_sym)[key] || DEFAULT_DENIAL_MESSAGES.fetch(key)
|
|
175
|
+
message.to_s.gsub("%{provider}", provider.to_s)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def record_ai_usage(cost, provider:)
|
|
179
|
+
record_usage_proc.call(cost, provider: provider)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
def provider_for(purpose)
|
|
183
|
+
provider_for_purpose_proc.call(purpose)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
def model_for(purpose)
|
|
187
|
+
model_for_purpose_proc&.call(purpose)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def request_policy(provider:, intent:, kind:, user:, context:)
|
|
191
|
+
return true unless request_policy_proc
|
|
192
|
+
|
|
193
|
+
request_policy_proc.call(
|
|
194
|
+
provider: provider,
|
|
195
|
+
intent: intent,
|
|
196
|
+
kind: kind,
|
|
197
|
+
user: user,
|
|
198
|
+
context: context
|
|
199
|
+
)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def openai_configured?
|
|
203
|
+
openai_api_key.present?
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def xai_configured?
|
|
207
|
+
xai_api_key.present?
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def zai_configured?
|
|
211
|
+
zai_api_key.present?
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
def zen_configured?
|
|
215
|
+
zen_api_key.present?
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def anthropic_configured?
|
|
219
|
+
anthropic_api_key.present?
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def gemini_configured?
|
|
223
|
+
gemini_api_key.present?
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
def ollama_configured?
|
|
227
|
+
ollama_url.present?
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
def ai_configured?
|
|
231
|
+
openai_configured? || zen_configured? || zai_configured? || xai_configured? ||
|
|
232
|
+
anthropic_configured? || gemini_configured? || ollama_configured?
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
private
|
|
236
|
+
|
|
237
|
+
def required!(name, value)
|
|
238
|
+
return value unless value.nil?
|
|
239
|
+
|
|
240
|
+
missing!("#{name} is not set. Plans and prices belong to the host: set it in config/initializers/pave_ai.rb")
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
def missing!(detail)
|
|
244
|
+
raise PaveAi::Client::HostSettingMissing, "PaveAi #{detail}"
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: pave_ai
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Nauman Tariq
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rails
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '8.0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '8.0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: pg
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1.5'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '1.5'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: ruby_llm
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '2.1'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '2.1'
|
|
54
|
+
description: PaveAI is a mountable Rails engine that provides AI chat orchestration,
|
|
55
|
+
multi-provider LLM client, three-gate governance, credit management, persona system,
|
|
56
|
+
and vector search.
|
|
57
|
+
executables: []
|
|
58
|
+
extensions: []
|
|
59
|
+
extra_rdoc_files: []
|
|
60
|
+
files:
|
|
61
|
+
- MIT-LICENSE
|
|
62
|
+
- README.md
|
|
63
|
+
- app/assets/stylesheets/pave_ai/application.css
|
|
64
|
+
- app/controllers/pave_ai/application_controller.rb
|
|
65
|
+
- app/helpers/pave_ai/application_helper.rb
|
|
66
|
+
- app/jobs/pave_ai/application_job.rb
|
|
67
|
+
- app/mailers/pave_ai/application_mailer.rb
|
|
68
|
+
- app/models/pave_ai/application_record.rb
|
|
69
|
+
- app/models/pave_ai/chat.rb
|
|
70
|
+
- app/models/pave_ai/chat_message.rb
|
|
71
|
+
- app/models/pave_ai/intent.rb
|
|
72
|
+
- app/models/pave_ai/persona.rb
|
|
73
|
+
- app/models/pave_ai/persona_document.rb
|
|
74
|
+
- app/models/pave_ai/quota.rb
|
|
75
|
+
- app/models/pave_ai/spend_log.rb
|
|
76
|
+
- app/services/pave_ai/client.rb
|
|
77
|
+
- app/services/pave_ai/client/provider.rb
|
|
78
|
+
- app/services/pave_ai/client/providers/anthropic.rb
|
|
79
|
+
- app/services/pave_ai/client/providers/gemini.rb
|
|
80
|
+
- app/services/pave_ai/client/providers/ollama.rb
|
|
81
|
+
- app/services/pave_ai/client/providers/openai.rb
|
|
82
|
+
- app/services/pave_ai/client/providers/openai_compatible.rb
|
|
83
|
+
- app/services/pave_ai/client/providers/xai.rb
|
|
84
|
+
- app/services/pave_ai/client/providers/zai.rb
|
|
85
|
+
- app/services/pave_ai/client/providers/zen.rb
|
|
86
|
+
- app/services/pave_ai/credential.rb
|
|
87
|
+
- app/services/pave_ai/governance.rb
|
|
88
|
+
- app/services/pave_ai/rates.rb
|
|
89
|
+
- app/services/pave_ai/spend.rb
|
|
90
|
+
- app/views/layouts/pave_ai/application.html.erb
|
|
91
|
+
- config/ai_governance/ETHICS.md
|
|
92
|
+
- config/routes.rb
|
|
93
|
+
- db/migrate/20260404000001_create_pave_ai_tables.rb
|
|
94
|
+
- db/migrate/20260820000002_add_billable_to_pave_ai_spend_logs.rb
|
|
95
|
+
- db/migrate/20260827000001_add_model_to_pave_ai_spend_logs.rb
|
|
96
|
+
- db/migrate/20260828000001_add_intent_credit_cost_and_log_credits.rb
|
|
97
|
+
- db/migrate/20261123000001_remove_quota_limit_defaults.rb
|
|
98
|
+
- lib/generators/pave_ai/install/install_generator.rb
|
|
99
|
+
- lib/pave_ai.rb
|
|
100
|
+
- lib/pave_ai/engine.rb
|
|
101
|
+
- lib/pave_ai/middleware/request_cleanup.rb
|
|
102
|
+
- lib/pave_ai/version.rb
|
|
103
|
+
- lib/tasks/pave_ai_tasks.rake
|
|
104
|
+
homepage: https://rubygems.org/gems/pave_ai
|
|
105
|
+
licenses:
|
|
106
|
+
- MIT
|
|
107
|
+
metadata:
|
|
108
|
+
homepage_uri: https://rubygems.org/gems/pave_ai
|
|
109
|
+
rdoc_options: []
|
|
110
|
+
require_paths:
|
|
111
|
+
- lib
|
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0'
|
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
|
+
requirements:
|
|
119
|
+
- - ">="
|
|
120
|
+
- !ruby/object:Gem::Version
|
|
121
|
+
version: '0'
|
|
122
|
+
requirements: []
|
|
123
|
+
rubygems_version: 4.0.20
|
|
124
|
+
specification_version: 4
|
|
125
|
+
summary: Shared AI engine for Rails apps — chat, governance, credits, and multi-provider
|
|
126
|
+
LLM client.
|
|
127
|
+
test_files: []
|