npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nebius-ai-provider

v0.1.0

Published

Vercel AI SDK community provider for Nebius Token Factory (formerly Nebius AI Studio)

Readme

Nebius Token Factory provider for the Vercel AI SDK

npm version CI License: MIT

A community provider for the Vercel AI SDK that gives you access to the open-source models served by Nebius Token Factory (formerly Nebius AI Studio): DeepSeek, Qwen, Llama, GLM, Kimi, gpt-oss and more, plus embedding and image models — all through the standard AI SDK interface.

Installation

npm install nebius-ai-provider ai

Requires Node.js >= 22 and the AI SDK v7.

Setup

Get an API key from the Token Factory console and expose it as NEBIUS_API_KEY:

export NEBIUS_API_KEY="your-api-key"

Quickstart

import { generateText } from 'ai';
import { nebius } from 'nebius-ai-provider';

const { text } = await generateText({
  model: nebius('deepseek-ai/DeepSeek-V4-Flash'),
  prompt: 'Hello!',
});

Model IDs are HuggingFace-style paths. Known models are typed for autocompletion, but any string is accepted, so new models on the platform work immediately. Browse the current catalog at tokenfactory.nebius.com/models/catalog.

Custom provider instance

Use createNebius to customize the API key, base URL, headers, or fetch:

import { createNebius } from 'nebius-ai-provider';

const nebius = createNebius({
  apiKey: process.env.MY_NEBIUS_KEY,
  // baseURL: 'https://api.tokenfactory.nebius.com/v1', // default
  headers: { 'X-Team': 'research' },
});

Streaming

import { streamText } from 'ai';
import { nebius } from 'nebius-ai-provider';

const result = streamText({
  model: nebius('Qwen/Qwen3-235B-A22B-Instruct-2507'),
  prompt: 'Write a haiku about GPUs.',
});

for await (const delta of result.textStream) {
  process.stdout.write(delta);
}

Tool calling

import { generateText, tool, stepCountIs } from 'ai';
import { nebius } from 'nebius-ai-provider';
import { z } from 'zod';

const { text } = await generateText({
  model: nebius('Qwen/Qwen3-32B'),
  tools: {
    weather: tool({
      description: 'Get the weather for a location',
      inputSchema: z.object({ location: z.string() }),
      execute: async ({ location }) => ({ location, temperature: 21 }),
    }),
  },
  stopWhen: stepCountIs(3),
  prompt: 'What is the weather in Amsterdam?',
});

Reasoning models

Nebius serves reasoning models (the DeepSeek-R1 family, Qwen "Thinking" variants) that emit their chain of thought as <think>...</think> blocks. Use the AI SDK's extractReasoningMiddleware to surface reasoning separately from the final text:

import {
  extractReasoningMiddleware,
  generateText,
  wrapLanguageModel,
} from 'ai';
import { nebius } from 'nebius-ai-provider';

const model = wrapLanguageModel({
  model: nebius('deepseek-ai/DeepSeek-R1-0528'),
  middleware: extractReasoningMiddleware({ tagName: 'think' }),
});

const { text, reasoningText } = await generateText({
  model,
  prompt: 'How many primes are there below 100?',
});

console.log(reasoningText); // the model's chain of thought
console.log(text); // the final answer

This works with streamText too — reasoning arrives as reasoning-delta stream parts, separate from text-delta.

Embeddings

import { embed } from 'ai';
import { nebius } from 'nebius-ai-provider';

const { embedding } = await embed({
  model: nebius.embeddingModel('Qwen/Qwen3-Embedding-8B'),
  value: 'sunny day at the beach',
});

Image generation

import { experimental_generateImage as generateImage } from 'ai';
import { nebius } from 'nebius-ai-provider';

const { image } = await generateImage({
  model: nebius.imageModel('black-forest-labs/flux-schnell'),
  prompt: 'A watercolor painting of a lighthouse at dawn',
});

Provider settings

| Option | Type | Default | Description | | --------- | ------------------------ | ---------------------------------------- | -------------------------------------- | | baseURL | string | https://api.tokenfactory.nebius.com/v1 | API base URL | | apiKey | string | process.env.NEBIUS_API_KEY | Bearer API key | | headers | Record<string, string> | — | Extra headers merged into each request | | fetch | typeof fetch | global fetch | Custom fetch for proxies/testing |

Legacy base URLs (AI Studio → Token Factory)

Nebius AI Studio was rebranded to Nebius Token Factory. This provider defaults to the current https://api.tokenfactory.nebius.com/v1 endpoint. If you need one of the legacy endpoints, pass it explicitly:

const nebius = createNebius({
  baseURL: 'https://api.studio.nebius.com/v1', // or https://api.studio.nebius.ai/v1
});

Links

License

MIT