Skip to content
PluginStats

@askdb/ai weekly downloads statistics

By askdb (2 listings) · npm · AI SDKs

AskDB AI provider registry: resolves AskDB config/env into AI SDK language and embedding models, with built-in OpenAI, Azure OpenAI, Google Gemini, Anthropic, and Vercel AI Gateway providers.

View on npm Fresh · Dec 6, 2026

@askdb/ai has 1,006 recorded weekly downloads on npm, an increase of 25.6% over the past 30 days, ranking #2071 of 3,247 tracked listings.

Weekly downloads
1,006
Official API · Dec 5, 2026
7-day growth
-17.7%
-217 weekly downloads
30-day growth
+25.6%
+205 weekly downloads
90-day growth
+3369%
+977 weekly downloads
Rank
#2071
▼ 139 in 7 days

About @askdb/ai

@askdb/ai

Turn askdb.config.* (or an env map) into a plain AI SDK LanguageModel: one model for AskDB's ask() and for your app's own AI SDK calls, with provider choice and keys in one place. Built-in providers cover OpenAI, Azure OpenAI / Microsoft Foundry, Google Gemini, Anthropic, and the Vercel AI Gateway; embedding models resolve the same way.

@askdb/core stays BYO-model: it accepts any AI SDK LanguageModel and runs the NL-to-SQL pipeline. Passing a model you built yourself (e.g. openai("gpt-4o-mini") from @ai-sdk/openai) straight to ask() is an equally supported path that needs no AskDB AI package. Use this package when you want askdb.config.* / env to pick the provider and model.

Most applications never import this package directly: createAskDb({ config }) from @askdb/client registers every built-in provider and lets ai.provider in your config pick one. Import @askdb/ai yourself to construct model objects outside the client, to share one model with your app's other AI calls, to restrict or extend the provider set, or to share one registry across several clients.

Install

pnpm add @askdb/ai ai
# Plus the AI SDK package for each provider you configure (optional peer dependencies):
pnpm add @ai-sdk/openai
Provider (ai.provider)InstallAPI key env varDefault language model
openai@ai-sdk/openaiOPENAI_API_KEYgpt-4o-mini
anthropic@ai-sdk/anthropicANTHROPIC_API_KEYclaude-sonnet-4-6
google@ai-sdk/googleGOOGLE_GENERATIVE_AI_API_KEYgemini-2.0-flash
azure (aliases azure-openai, foundry)@ai-sdk/azureAZURE_OPENAI_API_KEYgpt-4o-mini (deployment name)
gateway (Vercel AI Gateway)nothing: ships with aiAI_GATEWAY_API_KEYopenai/gpt-4o-mini

Embedding models have no default: rag.embedder: "ai" requires ai.embedding.model, the section path (createEmbeddingModelFromSection) requires a model, and so does an env map (ASKDB_AI_EMBEDDING_MODEL or the provider's embedding model variable). With an API key and no model, each throws.

Each built-in provider imports its SDK package lazily, the first time it builds a model, so registering all of them costs nothing. If the package isn't installed, model creation fails with: Provider 'google' requires the optional peer dependency @ai-sdk/google. Install it: npm i @ai-sdk/google. The same data is exported as BUILTIN_AI_PROVIDERS.

Usage

import { bootstrapAskDbEnv, getAskDbRuntimeConfig } from "@askdb/config";
import { createAiRegistry, resolveReasoningEffortFromSection } from "@askdb/ai";
import { ask, loadSchema } from "@askdb/core";

// No arguments: every built-in provider. Or restrict it: createAiRegistry(["openai"]).
const ai = createAiRegistry();

bootstrapAskDbEnv({ cwd: process.cwd() });

const runtime = getAskDbRuntimeConfig();
// The typed ai.language section from askdb.config.*; no env map in between.
const model = await ai.createLanguageModelFromSection(runtime.ai.language);

if (!model) throw new Error(ai.keyMissingMessage("NL-to-SQL"));

const schema = loadSchema("./askdb");

const result = await ask({
  question: "How many users signed up last week?",
  schema,
  dialect: "postgres",
  model,
});
Use the same model for your own AI SDK calls

The registry returns a plain AI SDK LanguageModel, so the model ask() uses can serve your app's other AI features too, such as a summary or a chart plan. They then read the same ai config, instead of a second model factory that can drift from it:

import { generateText } from "ai";

// The same `model` as above, from the same askdb.config.* section.
const { text } = await generateText({
  model,
  prompt: `Explain this SQL in one sentence: ${result.sql}`,
});
Without a config file

A host with no askdb.config.* passes an env map instead: ai.createLanguageModelFromEnv(process.env) reads ASKDB_AI_PROVIDER (default openai), then the API key, model and base URL from the ASKDB_AI_* variables first and the provider's own variables (OPENAI_API_KEY, …) after them. The @askdb/ai API reference lists the precedence. The section and env paths give the same AiConfig for the same settings.

Custom providers

AiProviderAdapter is the extension point for providers that aren't built in. Pass adapter objects alongside (or instead of) built-in names:

const ai = createAiRegistry(["openai", myMistralAdapter]);

Bundling: importing @askdb/ai reaches every built-in, and each loads its SDK with import("@ai-sdk/<x>").catch(...). esbuild builds without the SDKs a host didn't install. webpack 5 reports Module not found for each missing one; install it or list it in externals.

Reasoning/latency effort

resolveProviderOptions maps a provider-portable reasoning effort ("minimal" | "low" | "medium" | "high") to each adapter's native generateText providerOptions — OpenAI/Azure reasoningEffort, Google thinkingConfig (thinkingLevel for Gemini 3.x, thinkingBudget for Gemini 2.5), Anthropic extended or adaptive thinking. It returns undefined when the effort is unset or the model doesn't support reasoning tuning. The gateway provider uses its upstream's mapping for openai/, google/, and anthropic/ model ids and returns undefined for other upstreams.

const config = ai.resolveAiConfigFromSection(runtime.ai.language)!;
const model = await ai.createLanguageModel(config);
const reasoningEffort = resolveReasoningEffortFromSection(runtime.ai.language.reasoning, "nlToSql");
const providerOptions = reasoningEffort ? ai.resolveProviderOptions(config, { reasoningEffort }) : undefined;

await ask({ question, schema, dialect: "postgres", model, deps: { providerOptions } });
```…

Description from the npm listing.

  • askdb
  • ai
  • llm
  • ai-sdk
  • provider-registry
  • openai
  • azure
  • foundry
  • google
  • gemini
  • anthropic
  • ai-gateway

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

@askdb/ai weekly downloads on npm, last 90 days: 1,006 weekly downloads as of Dec 5, 2026, +3369% over 90 days.@askdb/aiWeekly downloads on npm · Last 90 days1,006downloads / week+3369% over 90 days05001K1.5K2K2.5K3K3.5KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@askdb/ai weekly downloads on npm, last 90 days: 1,006 weekly downloads as of Dec 5, 2026, +3369% over 90 days.

7/30/90-day growth

@askdb/ai weekly downloads growth on npm: -17.7% over 7 days, +25.6% over 30 days, +3369% over 90 days.@askdb/aiWeekly downloads growth on npm1,006downloads / week now7-day growth-217 weekly downloads-17.7%30-day growth+205 weekly downloads+25.6%90-day growth+977 weekly downloads+3369%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@askdb/ai weekly downloads growth on npm: -17.7% over 7 days, +25.6% over 30 days, +3369% over 90 days.

Ranking history

@askdb/ai npm ranking history: currently #2071 (by weekly downloads).@askdb/ainpm ranking · by weekly downloads · Last 90 days#2071current rank#1400#1500#1600#1700#1800#1900#2000#2100Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 10, 2026 – Dec 6, 2026 · 27 observations · Updated Dec 5, 2026pluginstats.com
@askdb/ai npm ranking history: currently #2071 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 104, #11 (overall #2,071)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 12, #4 (overall #224)
AI SDKs: every listing in weekly downloads order

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 (142)
Recent weekly downloads observations for @askdb/ai
Date (UTC)Weekly downloadsChange vs. previous
1,006-133
1,139-115
1,254-70
1,324-1
1,325+23
1,302+1
1,301+78
1,223+94
1,129-73
1,202-68
1,270-63
1,333-10
1,343-222
1,565—

Similar npm AI SDKs plugins

All 20 @askdb/ai alternatives

Data 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/@askdb/ai. First seen Nov 10, 2026; last successful collection Dec 6, 2026. See the methodology.