Skip to content
PluginStats

@vite-hub/gateways weekly downloads statistics

By vite-hub (2 listings) · npm · AI SDKs

One AI gateway object for every consumer: route Codex, Claude Code, the Gemini CLI, and AI SDK models, and ask TypeSafe Jev typed questions, through Vercel AI Gateway, Cloudflare AI Gateway, OpenRouter, LiteLLM, CLIProxyAPI, Ollama, OpenAI, Anthropic, Goo

View on npm Fresh · Dec 6, 2026

@vite-hub/gateways has 6,388 recorded weekly downloads on npm, an increase of 295% over the past 30 days, ranking #1438 of 3,247 tracked listings.

Weekly downloads
6,388
Official API · Dec 5, 2026
7-day growth
+63.8%
+2.5K weekly downloads
30-day growth
+295%
+4.8K weekly downloads
90-day growth
—
Insufficient history
Rank
#1438
▲ 137 in 7 days

About @vite-hub/gateways

@vite-hub/gateways

An AI gateway is one object that knows where AI requests go and how to sign them. A gateway has three capabilities:

  • Driver routes. It routes Codex and Claude Code model requests, for example through Vercel AI Gateway or CLIProxyAPI.
  • AI SDK models. languageModel(gateway, modelId) from @vite-hub/gateways/ai-sdk returns an AI SDK model that sends its requests through the gateway.
  • gateway.ask(). It answers typed TypeSafe Jev questions, such as "which category fits this transaction". Only gateways that can reach Jev have ask().

ask(prompt, { model, schema }) sends one model request and returns typed data that a schema checked. Without schema, it returns the answer text.

The package has no Agent, Vite, or Nitro code. It works in a plain Node script, a Worker, or another framework, and its only dependency is nostics. ViteHub applications import it as vite-hub/gateways. User docs: AI Gateways.

Install

languageModel(), ask(), and gateway.ask() load optional peer dependencies only when you use them. gateway.ask() needs advocaat, the TypeSafe client. languageModel() needs the AI SDK provider package of its model API, usually @ai-sdk/openai-compatible (@ai-sdk/openai with openai()), and ask(prompt, { model, schema }) needs ai:

pnpm add @vite-hub/gateways advocaat
pnpm add @vite-hub/gateways ai @ai-sdk/openai-compatible

Use a model with the AI SDK

import { generateText } from 'ai'
import { openrouter } from '@vite-hub/gateways'
import { languageModel } from '@vite-hub/gateways/ai-sdk'

// Reads OPENROUTER_API_KEY when it sends the request.
const model = languageModel(openrouter(), 'google/gemini-3.8-flash')

const { text } = await generateText({ model, prompt: 'What is a Server Primitive?' })

Change the preset to change the provider. The model ID is the ID that the gateway uses. The api option selects the model API, and the type accepts only the APIs that the gateway serves:

apiRequestURLPackage
'chat'OpenAI Chat Completionsopenai-compatible@ai-sdk/openai-compatible, or @ai-sdk/openai with openai()
'responses'OpenAI Responsesopenai-compatible, else codex; zai() uses codex@ai-sdk/openai
'messages'Anthropic Messagesclaude-code@ai-sdk/anthropic

The default is 'chat' when the gateway has an openai-compatible URL, else 'messages', else 'responses'. Use api: 'responses' for OpenAI reasoning models that call tools. The gateway resolves its URL, key, and headers for each request from the values that you passed or from process.env. Pass fetch to use a custom fetch implementation.

Put providerOptions under the gateway name for compatible Chat (such as { openrouter: { ... } }), openai for openai() Chat and Responses, and anthropic for Messages. Compatible Chat passes request fields to the gateway. openai() Chat reads native SDK options and still sends raw Chat Completions fields such as parallel_tool_calls. A raw field takes precedence over its SDK option.

Chat keeps JSON mode for schema output. It adds the JSON schema to the system instructions if you supply them, or to the user message if you do not. ask() validates the result locally and accepts schemas with optional fields. emulate() sends the schema as a structured output instead.

Get typed data from one call

ask(prompt, { model, schema }) sends one request to an AI SDK model and returns the answer that the schema validated, as [error, data]. It needs the ai package. Use languageModel(gateway, modelId) to send it through any gateway:

import { z } from 'zod'
import { ask, openrouter } from '@vite-hub/gateways'
import { languageModel } from '@vite-hub/gateways/ai-sdk'

const [error, receipt] = await ask('MERCADONA 23.10 -34.90 EUR', {
  model: languageModel(openrouter(), 'google/gemini-3.8-flash'),
  schema: z.object({ merchant: z.string(), amount: z.number() }),
})
if (error) throw error

receipt.merchant // string

schema is a Standard Schema that converts to JSON Schema: Zod 4, ArkType, or Valibot wrapped with toStandardJsonSchema() from @valibot/to-json-schema. Leave out schema to get the answer as a string: const [error, summary] = await ask(log, { model }). Options: instructions (system instructions), signal, and onUsage. error is GATEWAYS_ASK_MODEL_FAILED when the request fails and GATEWAYS_ASK_OUTPUT_INVALID when the answer does not match the schema or has no text. Setup errors, such as a missing key or a schema without JSON Schema, throw. Use an Agent when the model must call tools or keep a conversation.

Ask your first question

Pick the builder by the answer that you want. The answer types come from the questions.

You wantWriteYou get
Yes or noask.if(instructions, { threshold? })boolean. true when the probability of yes is above threshold. The default is 0.5.
The probability of yesask.chance(instructions, { true?, false? }){ chance }, from 0 to 1.
One labelask.switch(instructions, criteria)The label, such as 'groceries'.
One label, with how sure the model isask.choice(instructions, criteria){ choice, confidence, probabilities }.
A rating on an ordered scaleask.score(instructions, levels){ score, ratio, confidence, legend, probabilities }, for 2 to 10 levels.
The same question for each item of a listask.each(items, { key, question })One question for each item, under the key that key(item) returns. Pass the map to gateway.ask(), or spread it into your questions.

For ask.switch() and ask.choice(), criteria maps labels to descriptions, or is a list of 2 to 255 labels.…

Description from the npm listing.

  • ai
  • ai-gateway
  • ai-sdk
  • anthropic
  • cloudflare
  • deepseek
  • gateway
  • gemini
  • glm
  • jev
  • kimi
  • litellm
  • llm
  • minimax
  • ollama
  • openai
  • openrouter
  • qwen
  • typesafe
  • typescript

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

@vite-hub/gateways weekly downloads on npm, last 90 days: 6,388 weekly downloads as of Dec 5, 2026.@vite-hub/gatewaysWeekly downloads on npm · Last 90 days6,388downloads / week01K2K3K4K5K6K7KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@vite-hub/gateways weekly downloads on npm, last 90 days: 6,388 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@vite-hub/gateways weekly downloads growth on npm: +63.8% over 7 days, +295% over 30 days, 90-day growth unavailable.@vite-hub/gatewaysWeekly downloads growth on npm6,388downloads / week now7-day growth+2,487 weekly downloads+63.8%30-day growth+4,772 weekly downloads+295%90-day growth+6,388 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@vite-hub/gateways weekly downloads growth on npm: +63.8% over 7 days, +295% over 30 days, 90-day growth unavailable.

Ranking history

@vite-hub/gateways npm ranking history: currently #1438 (by weekly downloads).@vite-hub/gatewaysnpm ranking · by weekly downloads · Last 90 days#1438current rank#1200#1300#1400#1500#1600#1700#1800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 19, 2026 – Dec 6, 2026 · 18 observations · Updated Dec 5, 2026pluginstats.com
@vite-hub/gateways npm ranking history: currently #1438 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 72, #18 (overall #1,438)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 5, #20 (overall #100)
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 (135)
Recent weekly downloads observations for @vite-hub/gateways
Date (UTC)Weekly downloadsChange vs. previous
6,388-144
6,532+273
6,259-248
6,507-129
6,636+793
5,843+900
4,943+1K
3,901+653
3,248+113
3,135+503
2,632+457
2,175+231
1,944-20
1,964—

Similar npm AI SDKs plugins

All 20 @vite-hub/gateways 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/@vite-hub/gateways. First seen Nov 19, 2026; last successful collection Dec 6, 2026. See the methodology.