@craftery/llm
v0.3.0
Published
LLM provider layer of craftery: AI SDK adapter, model router, fallback, Codex provider, context compaction
Readme
@craftery/llm
LLM provider layer of craftery. Entries: @craftery/llm (., AI SDK adapter, model router, fallback, recovery), @craftery/llm/codex (Codex subscription provider), @craftery/llm/context (token counting and compaction), @craftery/llm/structured (structured-output detectors and lenient JSON parse). ai is an optional peer dependency and is loaded only with a dynamic import('ai').
LLMResponseDiagnostics.attempts (and ProviderError.attempts on LLM_ALL_PROVIDERS_EXHAUSTED) is the per-try timeline written by callWithFallback: errorCode only carries this package's own LLM_* / NETWORK_ERROR codes (anything else becomes LLM_PROVIDER_ERROR; the original stays on the error's cause), and providerId is present only when the provider implementation reported one (it is never backfilled from modelId).
The exports of these four entries follow semver. Files under dist/ that the exports map does not expose are internal and carry no compatibility promise.
Design and release rules: docs/superpowers/specs/2026-10-09-04-layered-packages-publish-design.md in the craftery repository.
