@byokit/decide has 2,053 recorded weekly downloads on npm.
About @byokit/decide
Install
npm install @byokit/decide
That is the whole tree for rules, any host-owned model behind answerer, and Jev: those backends
run on plain fetch and install no further packages. Import them from @byokit/decide/slim
(import { decide, rules, answerer, jev } from '@byokit/decide/slim') and bundlers resolve zero peers.
The remaining backends are optional peers npm skips unless the app installs them: @byokit/accounts
for ChatGPT plan billing (openai({ auth: 'account', ... }), subscription) and the OpenCode Go plan
account (opencodeGo({ account, ... }), subscription), and @byokit/pair for the
paired Jev route (the host app keeps its API key (billed per use) in its own store). Account billing
without the accounts peer throws UnsupportedAccountError naming @byokit/accounts. API-key OpenAI,
API-key Anthropic and plain-key OpenCode Go need no peer at runtime. The main entry keeps every export
and works either way.
· Latest release · All releases
Quickstart
npm install @byokit/decide
A rules-only backend: nothing leaves the device and no key is needed. The obvious case gets an answer; the rest abstains.
import { decide, rules, type Question } from '@byokit/decide';
const questions: Record<string, Question> = {
intent: { kind: 'choice', options: { task: 'Something new to do', followup: 'About an earlier job', chat: 'Just talking' } },
};
const backends = [rules((s) => (/^(thanks|thank you)\b/i.test(s.text) ? 'chat' : undefined))];
for (const text of ['thanks, that worked!', 'can you check if the plumber replied?']) {
const { intent } = await decide({ text }, questions, { privacy: 'stays-here', backends });
console.log(text, '->', intent);
}
thanks, that worked! -> {
answer: 'chat',
confidence: 1,
probabilities: { task: 0, followup: 0, chat: 1 },
abstained: false,
by: 'rules',
ms: 0
}
can you check if the plumber replied? -> {
answer: null,
confidence: 0,
abstained: true,
reason: 'no answer',
by: 'rules',
ms: 0
}
Add a model after the rules for the cases they leave open. Jev is API-billed: it needs a TypeSafe or OpenRouter key that your host holds.
import { decide, jev, rules } from '@byokit/decide';
const backends = [
rules((s) => (/^(thanks|thank you)\b/i.test(s.text) ? 'chat' : undefined)), // the obvious cases, free
jev({ key: hostConfig.jevKey }), // or jev({ key: openRouterKey, via: 'openrouter' })
];
const { intent } = await decide({ text: 'can you check if the plumber replied?' }, {
intent: { kind: 'choice', options: { task: 'Something new to do', followup: 'About an earlier job', chat: 'Just talking' } },
}, { privacy: 'may-leave', backends });
if (intent.abstained) askThePerson(); else route(intent.answer);
API at a glance…
Description from the npm listing.
- typescript
- ai
- ai-sdk
- react-native
- web
- privacy
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm AI SDKs plugins
All 20 @byokit/decide alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@byokit/decide. First seen Oct 26, 2026; last successful collection Oct 26, 2026. See the methodology.