fix: correct model lineup (live), remove legacy supported_models catalog, persist platform pricing#259
fix: correct model lineup (live), remove legacy supported_models catalog, persist platform pricing#259Gajesh2007 wants to merge 2 commits into
Conversation
…n restart Addresses the stale model lineup (#257) and its backend root cause, plus a critical billing bug found along the way. Pricing (critical): the model_prices startup cleanup deleted the synthetic "platform" account rows on every boot (platform != a users row), silently reverting billing to the fallback $0.05/$0.20. Exclude "platform" and gate the one-time cleanup behind a schema_migrations marker so it never runs again. Backend: remove the legacy supported_models catalog -- the bare GET/POST/DELETE /v1/admin/models endpoints, the store CRUD + table (now DROP TABLE), the empty-registry fallbacks, the IsRetiredProviderModel filter, and the dead seedModelCatalog. The manifest-backed model_registry is the single source of truth. The SupportedModel struct stays as the in-memory shape derived from the registry. The registry admin path and PUT /v1/admin/pricing are untouched. Frontend/docs: the landing pricing table and earnings calculator now source the lineup live from /v1/models/catalog + /v1/pricing (static fallback = the two served models). Public read endpoints (/v1/models/catalog, /v1/pricing) get permissive CORS so the marketing site can read them cross-origin. README, console-ui and benchmark scripts updated to Gemma 4 26B + GPT-OSS 20B; README revenue split made consistent (100% during the public alpha). Refs #257, #256
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR removes a dead code function ( Trust Boundaries Touched
Threat Analysis
New Attack SurfaceNone introduced. The removed function was already unreachable from Open Findings ResolvedNone. SEC-027, SEC-006, and all other findings flagged against
🔐 Threat model: |
The README, landing pricing table / earnings calculator, and the console models comparison were showing the $0.05/$0.20 platform fallback. Set them to the intended ~50%-of-OpenRouter rates: - Gemma 4 26B: $0.03 in / $0.165 out (OpenRouter google/gemma-4-26b-a4b-it: $0.06/$0.33) - GPT-OSS 20B: $0.015 in / $0.07 out (OpenRouter openai/gpt-oss-20b: $0.03/$0.14) console baselinePricing now holds the real OpenRouter output rates (330000 / 140000 micro-USD) so the "50% lower" comparison reads correctly. Live platform pricing must still be set in the coordinator (PUT /v1/admin/pricing or the register-model workflow) to match these docs; values now persist across restarts after the model_prices cleanup fix.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed3729ec66
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if publicCORSPaths[r.URL.Path] { | ||
| w.Header().Set("Access-Control-Allow-Origin", "*") | ||
| w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS") | ||
| w.Header().Set("Access-Control-Allow-Headers", "Content-Type") |
There was a problem hiding this comment.
Preserve credentialed CORS for pricing mutations
When a browser preflights DELETE /v1/pricing to revert a provider price, this branch is selected solely by path and returns Access-Control-Allow-Methods: GET, OPTIONS with no Authorization header or credentials support, even though the same path is also registered for authenticated pricing mutations. That preflight will be rejected before handleDeletePricing can run; gate the wildcard/public CORS behavior on the actual requested method (including Access-Control-Request-Method) or keep the credentialed CORS headers for non-GET pricing requests.
Useful? React with 👍 / 👎.
Summary
Resolves the stale landing-page model lineup (#257), removes its backend root
cause (a duplicate legacy catalog), and fixes a critical billing bug found
along the way where platform pricing was wiped on every coordinator restart.
The real, served lineup today is Gemma 4 26B + GPT-OSS 20B (verified against
live
/v1/models/catalog). Everything now flows from the manifest-backedmodel_registryas the single source of truth.1. Critical fix — platform pricing wiped on every restart
coordinator/store/postgres.goran this in its startup migration list on everyboot:
It was a one-time cleanup for legacy Solana-wallet-keyed rows, but platform
default pricing is stored under the synthetic
account_id = 'platform', which isnever a row in
users— so all per-model platform pricing was deleted on everyrestart, silently reverting billing (
consumer.go,provider.go) to the$0.05 / $0.20fallback. Models survived because they live in a different table(
model_registry).Fix:
'platform'system account from the cleanup.schema_migrationsmarkerso it runs once, not on every boot (defense against the next synthetic
account hitting the same trap).
Tests:
TestPostgresWalletPriceCleanupPreservesPlatformandTestPostgresWalletPriceCleanupRunsOnce(verified against a real Postgres;proven to fail on the old query and pass with the fix).
2. Backend — remove the legacy
supported_modelscatalogsupported_modelswas a duplicate ofmodel_registry, read only by the bareadmin CRUD and as an empty-registry fallback. It's what made the lineup look
"5-strong". Removed:
GET/POST/DELETE /v1/admin/models+ their handlers.SetSupportedModel/ListSupportedModels/DeleteSupportedModel(interface + memory + postgres) and the
supported_modelstable (nowDROP TABLE IF EXISTS).activeCatalogLookups,SyncModelCatalog,handleModelCatalog(now registry-only).model_catalog_filter.go(theIsRetiredProviderModeltoken hack) and thedead
seedModelCatalog.scripts/admin.sh models listto/v1/models/catalog.Untouched / intact: the manifest-backed registry path
(
POST /v1/admin/models/register,/v1/admin/models/{id}/...),PUT /v1/admin/pricing,/v1/models*, and thestore.SupportedModelstruct(now documented as the in-memory shape derived from the registry).
3. Frontend / docs — live lineup + stale removal
landing/index.html: the pricing table is now sourced live from/v1/models/catalog+/v1/pricing, with the two served models as a staticfallback. The API example uses
gemma-4-26b.landing/earn-calculator.js: model list now built live from the catalog(mirrors the already-live console earn page), with a corrected 2-model
fallback.
/v1/models/catalog,/v1/pricing) now return awildcard CORS origin (no credentials) so the marketing site can read them
cross-origin. Credentialed endpoints stay locked to the single configured
origin. Covered by
TestCORSPublicEndpointsAllowAnyOrigin.README.md: model table, example model id, and pricing table corrected to thetwo served models; the 95% vs 100% revenue-split contradiction resolved to
100% during the public alpha (consistent with the landing page and the 0%
platform fee default).
console-ui(models,api/stats,api-console,providers/setup) and thescripts/*.pybenchmark/load lists updated to the served lineup.Out of scope (intentionally not changed)
papers/dginf-private-inference.tex— published benchmark content, not productsurface.
scripts/mlx_lm_batch_bench.py— uses the real HuggingFace weights path for astandalone MLX tool, not a coordinator model id.
Testing
go build ./...,go vet ./...,gofmt -lclean.coordinatorapi+store(vs ephemeral Postgres) +cmdsuites pass.console-ui:npx eslint src/(0 errors) andnpm run buildpass.syntax-checked.
Deploy ordering
Ship the coordinator first — the landing page's live fetch only works in-browser
once the new CORS is deployed (until then it shows the correct static fallback).
Refs #257, #256
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.