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

@dysporium-sdk/qwen

v3.0.0

Published

Qwen provider for Dysporium SDK

Downloads

354

Readme

@dysporium-sdk/qwen

Qwen provider for Dysporium SDK - integrate Qwen models with a simple, type-safe API.

Installation

npm install @dysporium-sdk/qwen
# or
pnpm add @dysporium-sdk/qwen
# or
yarn add @dysporium-sdk/qwen

Note: This package includes all exports from @dysporium-sdk/core, so you only need to install this single package.

Quick Start

import { createQwen, generateText, streamText } from '@dysporium-sdk/qwen';

const qwen = createQwen({
  apiKey: process.env.QWEN_API_KEY,
});

// Generate text
const result = await generateText({
  model: qwen('qwen2.5-72b-instruct'),
  messages: [{ role: 'user', content: 'Hello!' }],
});

console.log(result.text);

Features

  • Full Qwen API support (Qwen 2.5, Qwen 2.0, and Qwen 1.5 models)
  • Streaming responses
  • Tool/function calling
  • Automatic retries with exponential backoff
  • Full TypeScript support

Usage

Text Generation

import { createQwen, generateText } from '@dysporium-sdk/qwen';

const qwen = createQwen({ apiKey: 'your-api-key' });

const result = await generateText({
  model: qwen('qwen2.5-72b-instruct'),
  messages: [
    { role: 'user', content: 'What is the capital of France?' },
  ],
  maxTokens: 100,
  temperature: 0.7,
});

console.log(result.text);
console.log(result.usage); // { inputTokens, outputTokens, totalTokens }

Streaming

import { createQwen, streamText } from '@dysporium-sdk/qwen';

const qwen = createQwen({ apiKey: 'your-api-key' });

const stream = await streamText({
  model: qwen('qwen2.5-72b-instruct'),
  messages: [{ role: 'user', content: 'Write a poem about coding' }],
});

for await (const chunk of stream) {
  if (chunk.type === 'text-delta') {
    process.stdout.write(chunk.textDelta);
  }
}

Tool Calling

import { createQwen, generateText } from '@dysporium-sdk/qwen';

const qwen = createQwen({ apiKey: 'your-api-key' });

const result = await generateText({
  model: qwen('qwen2.5-72b-instruct'),
  messages: [{ role: 'user', content: 'What is the weather in Paris?' }],
  tools: [
    {
      name: 'get_weather',
      description: 'Get current weather for a location',
      parameters: {
        type: 'object',
        properties: {
          location: { type: 'string', description: 'City name' },
        },
        required: ['location'],
      },
    },
  ],
});

if (result.toolCalls) {
  console.log(result.toolCalls);
}

Supported Models

Latest Models (Qwen 3 Series)

  • qwen3-235b-a22b-instruct - Largest model with 235B parameters (22B active), supports ultra-long context up to 1M tokens
  • qwen3-32b-instruct - High-performance 32B parameter model for complex reasoning
  • qwen3-8b-instruct - Efficient 8B parameter model

Qwen 2.5 Models

  • qwen2.5-72b-instruct - Largest and most capable model
  • qwen2.5-32b-instruct - High performance model
  • qwen2.5-14b-instruct - Balanced performance
  • qwen2.5-7b-instruct - Efficient model
  • qwen2.5-3b-instruct - Lightweight model
  • qwen2.5-1.5b-instruct - Ultra-lightweight model
  • qwen2.5-0.5b-instruct - Minimal model

Qwen 2.5 Specialized Models

  • qwen2.5-coder-32b-instruct - Specialized for code generation tasks
  • qwen2.5-math-72b-instruct - Specialized for mathematical reasoning

Qwen 2.0 Models

  • qwen2-72b-instruct - Large model
  • qwen2-57b-a14b-instruct - Specialized model
  • qwen2-32b-instruct - High performance
  • qwen2-14b-instruct - Balanced
  • qwen2-7b-instruct - Efficient
  • qwen2-1.5b-instruct - Lightweight
  • qwen2-0.5b-instruct - Minimal

Qwen 1.5 Models

  • qwen1.5-72b-chat - Large chat model
  • qwen1.5-32b-chat - High performance chat
  • qwen1.5-14b-chat - Balanced chat
  • qwen1.5-7b-chat - Efficient chat
  • qwen1.5-4b-chat - Lightweight chat
  • qwen1.5-1.8b-chat - Ultra-lightweight chat
  • qwen1.5-0.5b-chat - Minimal chat

Configuration

const qwen = createQwen({
  apiKey: 'your-api-key',
  baseURL: 'https://dashscope.aliyuncs.com/api/v1', // Optional: custom base URL
  retry: {
    maxRetries: 3,
    initialDelay: 1000,
    maxDelay: 30000,
  },
});

License

MIT