@contractspec/lib.ai-providers
v3.7.22
Published
Unified AI provider abstraction layer
Maintainers
Readme
@contractspec/lib.ai-providers
Website: https://contractspec.io
Unified AI provider abstraction layer.
What It Provides
- Layer: lib.
- Consumers: ai-agent, content-gen, image-gen, voice.
- Related ContractSpec packages include
@contractspec/lib.provider-ranking,@contractspec/tool.bun,@contractspec/tool.typescript. - Related ContractSpec packages include
@contractspec/lib.provider-ranking,@contractspec/tool.bun,@contractspec/tool.typescript.
Installation
npm install @contractspec/lib.ai-providers
or
bun add @contractspec/lib.ai-providers
Usage
Import the root entrypoint from @contractspec/lib.ai-providers, or choose a documented subpath when you only need one part of the package surface.
Architecture
src/factory.tsis part of the package's public or composition surface.src/index.tsis the root public barrel and package entrypoint.src/legacy.tsis part of the package's public or composition surface.src/models.test.tsis part of the package's public or composition surface.src/models.tsis part of the package's public or composition surface.src/selector-types.tsis part of the package's public or composition surface.src/selector.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
./factoryresolves through./src/factory.ts. - Export
./legacyresolves through./src/legacy.ts. - Export
./modelsresolves through./src/models.ts. - Export
./selectorresolves through./src/selector.ts. - Export
./selector-typesresolves through./src/selector-types.ts. - Export
./typesresolves through./src/types.ts. - Export
./validationresolves through./src/validation.ts.
Local Commands
bun run dev— contractspec-bun-build devbun run build— bun run prebuild && bun run build:bundle && bun run build:typesbun 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— tsc --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.
- Add latest models and align defaults.
- 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.
- Add first-class mistral provider support.
Notes
- Provider interface is consumed by all AI-powered libs; breaking changes cascade widely.
- Adding new providers must not break existing factory signatures.
