@lssm/lib.provider-ranking
v2.0.1
Published
AI provider ranking: benchmark ingestion, scoring, and model comparison
Maintainers
Readme
@lssm/lib.provider-ranking
Website: https://contractspec.io
AI provider ranking: benchmark ingestion, scoring, and model comparison.
What It Provides
- Layer: lib.
- Consumers: module.provider-ranking.
- Related ContractSpec packages include
@lssm/tool.bun,@lssm/tool.typescript. - Related ContractSpec packages include
@lssm/tool.bun,@lssm/tool.typescript.
Installation
npm install @lssm/lib.provider-ranking
or
bun add @lssm/lib.provider-ranking
Usage
Import the root entrypoint from @lssm/lib.provider-ranking, or choose a documented subpath when you only need one part of the package surface.
Architecture
src/evalis part of the package's public or composition surface.src/in-memory-store.tsis part of the package's public or composition surface.src/index.tsis the root public barrel and package entrypoint.src/ingestersis part of the package's public or composition surface.src/scoringis part of the package's public or composition surface.src/store.tsis part of the package's public or composition surface.src/types.tsis shared public type definitions.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./evalresolves through./src/eval/index.ts. - Export
./eval/runnerresolves through./src/eval/runner.ts. - Export
./eval/typesresolves through./src/eval/types.ts. - Export
./in-memory-storeresolves through./src/in-memory-store.ts. - Export
./ingestersresolves through./src/ingesters/index.ts. - Export
./ingesters/artificial-analysisresolves through./src/ingesters/artificial-analysis.ts. - Export
./ingesters/chatbot-arenaresolves through./src/ingesters/chatbot-arena.ts. - Export
./ingesters/fetch-utilsresolves through./src/ingesters/fetch-utils.ts. - Export
./ingesters/open-llm-leaderboardresolves through./src/ingesters/open-llm-leaderboard.ts. - Export
./ingesters/registryresolves through./src/ingesters/registry.ts. - Export
./ingesters/swe-benchresolves through./src/ingesters/swe-bench.ts. - Export
./ingesters/typesresolves through./src/ingesters/types.ts. - Export
./provider-ranking.featureresolves through./src/provider-ranking.feature.ts. - Export
./routingresolves through./src/routing/index.ts. - Export
./routing/classify-promptresolves through./src/routing/classify-prompt.ts. - Export
./routing/configresolves through./src/routing/config.ts. - Export
./routing/escalationresolves through./src/routing/escalation.ts. - Export
./routing/model-capabilitiesresolves through./src/routing/model-capabilities.ts. - Export
./routing/profilesresolves through./src/routing/profiles.ts. - Export
./routing/resolve-difficultyresolves through./src/routing/resolve-difficulty.ts. - Export
./routing/role-matrixresolves through./src/routing/role-matrix.ts. - Export
./routing/scoringresolves through./src/routing/scoring.ts. - Export
./routing/select-modelresolves through./src/routing/select-model.ts. - Export
./routing/telemetryresolves through./src/routing/telemetry.ts. - Export
./routing/typesresolves through./src/routing/types.ts. - Export
./routing/weightsresolves through./src/routing/weights.ts. - Export
./scoringresolves through./src/scoring/index.ts. - Export
./scoring/composite-scorerresolves through./src/scoring/composite-scorer.ts. - Export
./scoring/dimension-weightsresolves through./src/scoring/dimension-weights.ts. - Export
./scoring/normalizerresolves through./src/scoring/normalizer.ts. - Export
./storeresolves through./src/store.ts. - Export
./typesresolves through./src/types.ts. - The package publishes 32 total export subpaths; keep docs aligned with
package.json.
Local Commands
bun run dev— contractspec-bun-build devbun run build— contractspec-bun-build buildbun run test— bun test --pass-with-no-testsbun run lint— bun lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsgo --noEmitbun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rimraf dist .turbobun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun run prebuild— contractspec-bun-build prebuild
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
- Resolve lint, build, and type errors across nine packages.
- Add first-class transport, auth, versioning, and BYOK support across all integrations.
- Add AI provider ranking system with ranking-driven model selection.
Notes
- Store interface is the adapter boundary — do not leak implementation details.
- Scoring algorithms must stay deterministic (no randomness, no side effects).
- Benchmark dimension enum is shared across ingesters and scoring — keep in sync.
Agent-aware routing
@lssm/lib.provider-ranking/routing adds deterministic Builder model routing without executing providers. Use selectModelForAgent(input) to classify difficulty, apply manual thinking and risk floors, enforce required capabilities, select cheap/optimized/best/critical policy, and return an inspectable routing decision.
This surface is research/discovery and offline candidate-generation guidance. It is not Protocol V1 qualification, Connect authorization, persisted selection, fallback, or production routing truth. Every suggested candidate must still pass hard policy gates, operation-specific evaluation, durable Agent Host admission, and exact Connect verification before execution.
Critical risk (payments, contract-liability, compliance, destructive data loss, legal) cannot be downgraded by budget mode or manual thinking settings.
