Skip to content
PluginStats

@nestjs/ai weekly downloads statistics

By nestjs (3 listings) · npm · AI SDKs

Language models for NestJS: model calls with timeouts, retries and fallbacks, structured output, tools and agents, and streaming to the browser.

View on npm Fresh · Dec 6, 2026

@nestjs/ai has 5,393 recorded weekly downloads on npm, an increase of 3149% over the past 30 days, ranking #1497 of 3,247 tracked listings.

Weekly downloads
5,393
Official API · Dec 5, 2026
7-day growth
+41.8%
+1.6K weekly downloads
30-day growth
+3149%
+5.2K weekly downloads
90-day growth
—
Insufficient history
Rank
#1497
▲ 86 in 7 days

About @nestjs/ai

<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a> </p> <p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> <p align="center"> <a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> <a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> <a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a> <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> <a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> <a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> <a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a> <a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> </p> <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer) [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

Description

Language models for Nest: named models through dependency injection, model calls with timeouts, retries and fallback models (run on @nestjs/resilience policies, or your own), budgets and usage events, structured output validated by a schema, the application's own provider methods as agent functions its agents call (through Nest's guards, interceptors, pipes and exception filters, as the user the agent acts for), answers streamed to the browser on Express, Fastify and the Node adapter, and durable agent runs on @nestjs/workflows (@nestjs/ai/workflows) that survive restarts and wait for a person's approval. You write an agent function with @AgentFunction(), and the model is offered it as a tool; a method can be an MCP tool too, served by @nestjs/mcp, with its @Tool() stacked on it. Embedding models have their own named registry, dependency injection, resilient single and batch calls, and usage events. Comes with fake language and embedding models for tests. Built on the AI SDK (ai) and its provider packages.

Installation

$ npm i --save @nestjs/ai @nestjs/resilience ai @ai-sdk/anthropic zod

Any @ai-sdk/* provider package works (@ai-sdk/openai, @ai-sdk/google, ...). Zod 4.2 or later for the schemas; any other Standard Schema library that produces JSON Schema works too. Node.js 22 or later.

Each major version of @nestjs/ai supports one major version of the AI SDK: this one, ai 7.

Quick Start

Register the models, and call them:

import { anthropic } from '@ai-sdk/anthropic';
import { Injectable, Module } from '@nestjs/common';
import { AgentFunction, AiModule, AiService, type AgentFunctionContext } from '@nestjs/ai';
import * as z from 'zod';

@Injectable()
export class OrdersTools {
  constructor(private readonly orders: OrdersService) {}

  @AgentFunction({
    name: 'find-order',
    description: 'Find an order by its id',
    inputSchema: z.object({ orderId: z.string() }),
  })
  find({ orderId }: { orderId: string }, ctx: AgentFunctionContext) {
    return this.orders.findFor(ctx.request?.user, orderId);
  }
}

@Injectable()
export class SupportService {
  constructor(private readonly ai: AiService) {}

  async answer(question: string, request: unknown) {
    const { text } = await this.ai.generateText({
      prompt: question,
      tools: ['find-order'],
      caller: { request },
    });
    return text;
  }
}

@Module({
  imports: [
    AiModule.forRoot({
      models: {
        default: anthropic('claude-opus-5-5'),
        fast: anthropic('claude-haiku-5-5'),
      },
      defaults: { timeout: '30s', retry: { attempts: 3 } },
    }),
  ],
  providers: [OrdersService, OrdersTools, SupportService],
})
export class AppModule {}

A method that MCP clients call too also carries @nestjs/mcp's @Tool(), with options of its own: the two decorators don't read each other's, and one schema constant serves both. generateObject({ schema }) answers a typed object, and streamText() an answer a controller sends to the browser with pipeUIMessageStreamToResponse(res), as the AI SDK's useChat() reads it. Agent function calls run through the guards, interceptors, pipes and filters of the class and the method, with the context type 'ai', so AiExecutionContext reads them in enhancers (on a method with both decorators, they see 'mcp' for MCP clients' calls), and @nestjs/authentication (0.1.4 or later) and @nestjs/authorization (0.1.2 or later) authenticate and authorize them. @nestjs/ai/testing has FakeModel, which answers with text, tool calls, objects or errors, without a network.…

Description from the npm listing.

  • nestjs
  • nest
  • ai
  • llm
  • agents
  • ai-agent
  • tools
  • tool-calling
  • openai
  • anthropic
  • ai-sdk
  • streaming
  • chat

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

@nestjs/ai weekly downloads on npm, last 90 days: 5,393 weekly downloads as of Dec 5, 2026.@nestjs/aiWeekly downloads on npm · Last 90 days5,393downloads / week01K2K3K4K5K6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@nestjs/ai weekly downloads on npm, last 90 days: 5,393 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@nestjs/ai weekly downloads growth on npm: +41.8% over 7 days, +3149% over 30 days, 90-day growth unavailable.@nestjs/aiWeekly downloads growth on npm5,393downloads / week now7-day growth+1,591 weekly downloads+41.8%30-day growth+5,227 weekly downloads+3149%90-day growth+5,393 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@nestjs/ai weekly downloads growth on npm: +41.8% over 7 days, +3149% over 30 days, 90-day growth unavailable.

Ranking history

@nestjs/ai npm ranking history: currently #1497 (by weekly downloads).@nestjs/ainpm ranking · by weekly downloads · Last 90 days#1497current rank#1300#1350#1400#1450#1500#1550#1600#1650Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 13, 2026 – Dec 6, 2026 · 24 observations · Updated Dec 5, 2026pluginstats.com
@nestjs/ai npm ranking history: currently #1497 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 75, #17 (overall #1,497)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 6, #10 (overall #110)
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 @nestjs/ai
Date (UTC)Weekly downloadsChange vs. previous
5,393+346
5,047+98
4,949+61
4,888+441
4,447+592
3,855-99
3,954+152
3,802+22
3,780+172
3,608+444
3,164+135
3,029-116
3,145+92
3,053—

Similar npm AI SDKs plugins

All 20 @nestjs/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/@nestjs/ai. First seen Nov 13, 2026; last successful collection Dec 6, 2026. See the methodology.