mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-10-19 05:20:05 +00:00
* test(catalog): pin the 2026-09-02 free-tier re-audit facts for gemini, ollama-cloud, groq, nara and mistral * fix(catalog): re-audit gemini, ollama-cloud, groq, nara and mistral against official pages * fix(catalog): restore the console-verified Mistral 1B pool and harden its regression test * docs(free-tiers): move headline to the re-audited ~1.50B and refresh pool counts * chore(free-tiers): retire stale Groq free-tier text and preset model; fix catalog header * docs(free-tiers): state the evidence-comment rule honestly and retire the last "14.4K RPD" Groq texts * docs(free-tiers): retire the stale Gemini onboarding quota text * docs(free-tier): refresh catalog-entry counts to 442 after base sync * docs(free-tiers): restore README spacing lost in the merge and re-sync the guide counts * docs(free-tiers): re-sync numbers after merging release/v3.8.51 (Cerebras reclassified upstream) * fix(docs): keep the NaraRouter plans endpoint out of the API-path checker; rebaseline gateways.ts (+3) --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
49 lines
2.3 KiB
TypeScript
49 lines
2.3 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import {
|
|
FREE_TIER_BUDGETS,
|
|
FREE_TIER_TOS,
|
|
computeFreeTierTotals,
|
|
} from "../../open-sse/config/freeTierCatalog.ts";
|
|
|
|
test("FREE_TIER_BUDGETS holds positive integer monthly-token budgets", () => {
|
|
// 2026-09-02 re-audit: gemini + ollama-cloud left (no published cap), nara joined;
|
|
// #12591 then dropped cerebras (one-time credit) → 17 legacy keys.
|
|
assert.ok(Object.keys(FREE_TIER_BUDGETS).length >= 17);
|
|
for (const [id, tokens] of Object.entries(FREE_TIER_BUDGETS)) {
|
|
assert.ok(Number.isInteger(tokens) && tokens > 0, `${id} must be a positive integer`);
|
|
}
|
|
assert.equal(FREE_TIER_BUDGETS.mistral, 1_000_000_000);
|
|
assert.equal(FREE_TIER_BUDGETS["cloudflare-ai"], 122_000_000);
|
|
// #11773: Cerebras is a one-time $5 signup credit, not a recurring monthly grant.
|
|
assert.equal(FREE_TIER_BUDGETS.cerebras, undefined);
|
|
// LongCat is excluded from this recurring-monthly catalog: its free tier is a
|
|
// one-time 10M-token signup grant (not recurring), so it must not appear here.
|
|
assert.equal(FREE_TIER_BUDGETS.longcat, undefined);
|
|
});
|
|
|
|
test("FREE_TIER_TOS marks proxy-prohibited providers as avoid", () => {
|
|
for (const id of ["kiro", "amazon-q", "blackbox", "fireworks"]) {
|
|
assert.equal(FREE_TIER_TOS[id], "avoid", `${id} must be flagged avoid`);
|
|
}
|
|
});
|
|
|
|
test("computeFreeTierTotals sums the documented budgets", () => {
|
|
const t = computeFreeTierTotals();
|
|
// 2026-09-02 re-audit: gemini + ollama-cloud left the legacy map (no published cap),
|
|
// nara joined, groq → 30M; #12591 dropped cerebras → 17 providers, legacy sum 1,475,025,000.
|
|
assert.equal(t.providerCount, 17);
|
|
assert.ok(t.documentedMonthlyTokens >= 1_425_000_000);
|
|
assert.ok(t.documentedMonthlyTokens <= 1_525_000_000);
|
|
assert.equal(typeof t.headline, "string");
|
|
// 2026-09-02 re-audit + #12591 (cerebras dropped): headline reads "over 1.48B …".
|
|
assert.match(t.headline, /1\.4/);
|
|
});
|
|
|
|
test("computeFreeTierTotals can exclude ToS-avoid providers", () => {
|
|
const all = computeFreeTierTotals();
|
|
const clean = computeFreeTierTotals({ excludeTosAvoid: true });
|
|
assert.equal(all.documentedMonthlyTokens - clean.documentedMonthlyTokens, 25_000);
|
|
// 2026-09-02 re-audit + #12591: 17 legacy providers, minus kiro (ToS avoid) → 16.
|
|
assert.equal(clean.providerCount, 16);
|
|
});
|