Skip to content

v1.2.11 — free models work before you configure anything

Choose a tag to compare

@stallenlu stallenlu released this 09 Nov 22:55
· 1 commit to main since this release

feat: turn on the keyless providers without a first-run setup

A fresh install had an empty api_keys table, and the router only routes to a
platform that has a row there (services/router.js, usableKeyCountsByPlatform).
So a brand-new install answered one model out of 296 and every other row said
no_key — despite seven providers that need no key at all. The user had to
discover the dashboard, add a keyless provider by hand, and only then see a
usable list.

The plugin now asks the router's own registry which platforms are keyless
(getAllProviders() → keyless === true, seven today) and, for any platform the
database has never seen, hands the server a declarative config at spawn time:

FREEAPI_CONFIG_JSON={"keys":[{"platform":"aihorde"},…]}

The server stores its no-key sentinel for each, exactly as the dashboard does
when a person adds one. Measured on a copy of a real database with api_keys
emptied: 1 available model before, 53 after. On this machine, which already had
seven sentinel rows, the plan comes back empty and nothing changes.

Deliberate choices:

  • No hardcoded platform list. The registry is the source, so an upstream
    provider being added or dropped is picked up without editing this plugin.
  • Only missing rows are declared, so a platform the user disabled stays
    disabled — the seed never re-enables something a person turned off.
  • settings.enabledModels is untouched. An empty list keeps meaning "follow the
    probes"; the seed does not quietly convert it into a 51-entry whitelist.
  • An operator who set FREEAPI_CONFIG_JSON themselves keeps it: the seed only
    fills the variable when it is absent.
  • The database read is skipped on a lean poll, and the panel gets the state as
    keyless: { already, pending }, so the settings card can say "7 keyless
    providers are on" instead of leaving the feature invisible.

smoke.mjs grows one behavioural check (registry membership, a fresh database
being all-missing, the payload shape, the empty case, the operator override, and
the supervisor asking for the plan), and asserts the panel reports the state.