v0.2.3 Core tier 10/5/5 split + dynamic health version

This commit is contained in:
local
2026-05-11 21:53:50 -05:00
parent 07fe14010c
commit 6797aae404
8 changed files with 138 additions and 15 deletions
+17 -4
View File
@@ -24,7 +24,12 @@ function defaultConfig() {
relay_admin_password_salt: "",
relay_admin_session_secret: "",
relay_tier_quotas_json: JSON.stringify({
core: { lifetime: 5, monthly: null, geminiCapMonthly: null },
core: {
lifetime: 10,
geminiCapLifetime: 5,
monthly: null,
geminiCapMonthly: null,
},
pro: { lifetime: null, monthly: 50, geminiCapMonthly: 25 },
max: { lifetime: null, monthly: null, geminiCapMonthly: 50 },
}),
@@ -68,14 +73,17 @@ export async function getConfigSnapshot() {
}
// Parsed view of relay_tier_quotas_json, with safe fallbacks if the
// blob is missing or malformed.
// blob is missing or malformed. geminiCapLifetime is the new field
// added in relay 0.2.3 — splits a Core install's lifetime budget into
// Gemini-served vs hardware-served credits.
export async function getTierQuotas() {
const cfg = await getConfigSnapshot();
try {
const parsed = JSON.parse(cfg.relay_tier_quotas_json);
return {
core: {
lifetime: parsed?.core?.lifetime ?? 5,
lifetime: parsed?.core?.lifetime ?? 10,
geminiCapLifetime: parsed?.core?.geminiCapLifetime ?? 5,
monthly: parsed?.core?.monthly ?? null,
geminiCapMonthly: parsed?.core?.geminiCapMonthly ?? null,
},
@@ -92,7 +100,12 @@ export async function getTierQuotas() {
};
} catch {
return {
core: { lifetime: 5, monthly: null, geminiCapMonthly: null },
core: {
lifetime: 10,
geminiCapLifetime: 5,
monthly: null,
geminiCapMonthly: null,
},
pro: { lifetime: null, monthly: 50, geminiCapMonthly: 25 },
max: { lifetime: null, monthly: null, geminiCapMonthly: 50 },
};