Skip to content
PluginStats

@pydantic/logfire-ai-sdk-code-mode weekly downloads statistics

By pydantic (3 listings) · npm · AI SDKs

Let Vercel AI SDK agents call their tools from Python running in Logfire Agent Sandboxes - https://pydantic.dev/logfire

View on npm Stale · Dec 1, 2026

@pydantic/logfire-ai-sdk-code-mode has 327 recorded weekly downloads on npm, a change of -51.1% over the past 7 days, ranking #2361 of 3,247 tracked listings.

Weekly downloads
327
Official API · Dec 5, 2026
7-day growth
-51.1%
-342 weekly downloads
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#2361
Among tracked npm listings

About @pydantic/logfire-ai-sdk-code-mode

Logfire AI SDK Code Mode

Let Vercel AI SDK agents write one Python program that calls their tools, instead of calling them one model turn at a time. The program runs in a Logfire Agent Sandbox, and your tools stay in your Node.js process.

npm install @pydantic/logfire-ai-sdk-code-mode @pydantic/monty@^1.5.0 ai zod

Create a Logfire project API key with the Run code in this project's agent sandboxes permission (project:execute_agent_sandboxes) and set it as LOGFIRE_API_KEY. The key also selects your data region.

import type { LanguageModel } from 'ai'

import { codeMode } from '@pydantic/logfire-ai-sdk-code-mode'
import { generateText, stepCountIs, tool } from 'ai'
import { z } from 'zod'

const getWeather = tool({
  description: 'Get the weather for a city.',
  inputSchema: z.object({ city: z.string() }),
  outputSchema: z.object({ city: z.string(), forecast: z.string() }),
  execute: async ({ city }) => ({ city, forecast: 'Sunny' }),
})

export async function askAgent(model: LanguageModel, prompt: string): Promise<string> {
  await using code = codeMode({ tools: { get_weather: getWeather } })
  const { text } = await generateText({
    model,
    prompt,
    tools: code.tools,
    stopWhen: stepCountIs(10),
  })
  return text
}

codeMode() turns your tools into typed async Python functions and gives the model one run_code tool to call them from. Create one codeMode() object per agent run: it is one sandbox session, kept like a REPL for every run_code call in that run.

See the Agent Sandboxes docs for streaming, approval, tool context, limits, and error handling.

Agent Sandboxes setup and checkout errors end the run instead of reaching the model. Use codeMode's onError handler for developer-side reporting, and handle thrown errors or rejected streams.

Description from the npm listing.

  • logfire
  • monty
  • sandbox
  • agents
  • ai-sdk
  • code-mode
  • python

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

@pydantic/logfire-ai-sdk-code-mode weekly downloads on npm, last 90 days: 327 weekly downloads as of Dec 5, 2026.@pydantic/logfire-ai-sdk-code-modeWeekly downloads on npm · Last 90 days327downloads / week02004006008001K1.2K1.4K1.6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@pydantic/logfire-ai-sdk-code-mode weekly downloads on npm, last 90 days: 327 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@pydantic/logfire-ai-sdk-code-mode weekly downloads growth on npm: -51.1% over 7 days, 30-day growth unavailable, 90-day growth unavailable.@pydantic/logfire-ai-sdk-code-modeWeekly downloads growth on npm327downloads / week now7-day growth-342 weekly downloads-51.1%30-day growth+327 weekly downloadsInsufficient history90-day growth+327 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@pydantic/logfire-ai-sdk-code-mode weekly downloads growth on npm: -51.1% over 7 days, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@pydantic/logfire-ai-sdk-code-mode npm ranking history: currently #2361 (by weekly downloads).@pydantic/logfire-ai-sdk-code-modenpm ranking · by weekly downloads · Last 90 days#2361current rank#1700#1800#1900#2000#2100#2200#2300#2400Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankDec 1, 2026 – Dec 6, 2026 · 3 observations · Updated Dec 5, 2026pluginstats.com
@pydantic/logfire-ai-sdk-code-mode npm ranking history: currently #2361 (by weekly downloads).

Listing placement

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

Listing placement

AI SDKs378 listings · 19 pages · page 15, #1 (overall #281)
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 (121)
Recent weekly downloads observations for @pydantic/logfire-ai-sdk-code-mode
Date (UTC)Weekly downloadsChange vs. previous
327-31
358-24
382-150
532-50
582-266
848+198
650-19
669-14
683-247
930+167
763+59
704+300
404+14
390—

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/@pydantic/logfire-ai-sdk-code-mode. First seen Dec 1, 2026; last successful collection Dec 1, 2026. See the methodology.