Repository navigation
fix(catalog): reclassify PublicAI from keyless to one-time-initial (requires API key) (#3558) #3568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import test from "node:test"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import assert from "node:assert/strict"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { FREE_MODEL_BUDGETS } from "../../open-sse/config/freeModelCatalog.data.ts"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Regression for #3558: PublicAI was catalogued with freeType:"keyless" (in the RECURRING set, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // so it surfaced as keyless-free and could be picked into the no-auth pool with no Authorization | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // header). But the provider registry requires a key (authType:"apikey"), and freeTierCatalog.ts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // already excludes publicai from recurring free budgets — an internal inconsistency. PublicAI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // grants a one-time signup credit then bills, so it must NOT be "keyless". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("#3558 PublicAI has no freeType:keyless catalog entries", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const keyless = FREE_MODEL_BUDGETS.filter( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (b) => b.provider === "publicai" && b.freeType === "keyless" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert.equal(keyless.length, 0, `publicai must not be keyless; found ${keyless.length}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("#3558 PublicAI catalog entries are classified one-time-initial", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const entries = FREE_MODEL_BUDGETS.filter((b) => b.provider === "publicai"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert.ok(entries.length > 0, "publicai still has catalog entries"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (const e of entries) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert.equal(e.freeType, "one-time-initial", `${e.modelId} should be one-time-initial`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the project uses Vitest (as indicated by If you decide to remove the
Suggested change
References
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
publicaiis now marked ashasFree: falseinproviders.tsand has bothmonthlyTokens: 0andcreditTokens: 0, these models are no longer part of any active free tier or budget. Keeping them inFREE_MODEL_BUDGETS(which is specifically for free model budgets) is inconsistent and could lead to dead entries or unexpected behavior in the UI/routing logic.Consider removing these three
publicaientries fromFREE_MODEL_BUDGETSentirely instead of reclassifying them toone-time-initialwith zero tokens.