Code map
Where each piece lives in src/. This is generated from the files in the repository when the site is built. +tests marks a file with its own test file; the others are covered by a shared one or by the call-path tests.
candidates.tsmodel-candidates/1: the models in use, for an evaluator
catalog.ts+testsReads a provider's catalogue; picks and ranks models; drops withdrawn ones
discover.ts+testsKeeps a provider's list alive and short: prune, then fill within a price limit
errors.tsLodestoneError, ProviderError and the failure kinds
explain.tsTurns an error into a sentence a person can read
health.ts+testsThe circuit breaker: skips models that keep failing, shared across instances
index.tsPublic exports
json.ts+testsStrips code fences and parses; json() uses it to skip bad answers
limiter.tscreateRateLimiter: an allowance for each caller, stored as a hash
lodestone.ts+testsThe core: createLodestone, the phases, the time budget, complete() and json()
models.tsDefault free model lists per tier
rateLimit.ts+testsTells the four kinds of 429 apart
scorecard.ts+testsReads model-scorecard/1 and orders models by it
spend.tscreateSpendLimit: a daily and monthly limit that takes a hold per attempt, so a burst cannot overshoot
stats.ts+testsLive success rate and speed per model, as a scorecard
store.tsA key-value store: memory by default, yours to share between functions
trust.ts+testsThe trust policy: trusted labs, block list, privacy and expiry checks
types.tsShared types
util.tsA hash, a mutex and shape checks, shared by the pieces above
providers/Adapters: anthropic, google, mock, openaiCompatible, openrouter
stores/Adapters: Netlify Blobs, Cloudflare KV, Upstash, Deno KV
python/The Python port (alpha), with its own tests
scripts/The smoke checks that run on Node, Workers, Deno and Bun
examples/A Netlify function, the daily check and a multi-provider setup, all type-checked in CI
.github/workflowsTests, builds and publishes to npm with provenance on a version tag
docs/scorecards.mdThe two JSON formats in full