@agentor/dashscope weekly downloads statistics
AI SDK provider for Alibaba Cloud DashScope (Bailian) API
@agentor/dashscope has 1,059 recorded weekly downloads on npm, an increase of 353% over the past 30 days, ranking #1431 of 2,322 tracked listings.
About @agentor/dashscope
@agentor/dashscope
AI SDK provider for Alibaba Cloud DashScope (Bailian) API.
Features
- Chat Completions -
/chat/completionswith function calling, streaming, reasoning, and vision - Completions (FIM) -
/completionsfor code completion with Qwen Coder models - Responses -
/responsesendpoint with built-in tools (web search, code interpreter, MCP, etc.) - Embedding - Text vectorization via
/embeddingsendpoint - Reranking - Document reranking via
/reranksendpoint - Image Generation - Text-to-image via multimodal generation endpoint
- Video Generation - Text-to-video and image-to-video with async polling
- Speech Synthesis - Text-to-speech for CosyVoice and Qwen-TTS models
- Transcription - Speech-to-text for short and long audio
- Built-in Tools - Web search, code interpreter, web extractor, file search, web search image, image search, MCP integration
- Thinking Mode - Enable reasoning/thinking with configurable budget
- Multi-region - Beijing, Singapore, US, Germany regions
- AI SDK V4 - Implements the LanguageModelV4 specification
- TypeScript-First - Full type safety with comprehensive TypeScript support
Installation
# Install with npm
$ npm install @agentor/dashscope
# Install with yarn
$ yarn add @agentor/dashscope
# Install with pnpm
$ pnpm add @agentor/dashscope
Quick Start
Setup
import { createDashScope } from "@agentor/dashscope";
const dashscope = createDashScope({
apiKey: process.env.DASHSCOPE_API_KEY,
});
Or use the default instance (reads DASHSCOPE_API_KEY from environment):
import { dashscope } from "@agentor/dashscope";
Basic Chat
import { dashscope } from "@agentor/dashscope";
import { generateText } from "ai";
const result = await generateText({
model: dashscope("qwen3.5-flash"),
prompt: "Introduce yourself in one sentence.",
});
console.log(result.text);
Streaming
import { streamText } from "ai";
const result = streamText({
model: dashscope("qwen3.5-flash"),
prompt: "Explain the Vercel AI SDK in three sentences.",
});
for await (const part of result.textStream) {
process.stdout.write(part);
}
Function Calling
import { generateText, hasToolCall, tool } from "ai";
import { z } from "zod/v4";
const result = await generateText({
model: dashscope("qwen3.5-flash"),
tools: {
weather: tool({
description: "Get weather information for a city",
inputSchema: z.object({
city: z.string().describe("City name"),
}),
execute: async ({ city }) => {
return `${city}: Sunny, 25°C`;
},
}),
},
prompt: "What's the weather in Beijing?",
stopWhen: hasToolCall("weather"),
});
Chat Completions API
Web Search
Enable web search via providerOptions:
await generateText({
model: dashscope("qwen3.5-flash"),
providerOptions: {
dashscope: {
enableSearch: true,
},
},
prompt: "What are the latest tech news today?",
});
Options: enableSearch, searchStrategy ("enable" | "enable_with_history" | "agent_max").
Code Interpreter
Enable code interpreter (requires thinking mode):
await generateText({
model: dashscope("qwen3.5-flash"),
providerOptions: {
dashscope: {
enableCodeInterpreter: true,
enableThinking: true,
},
},
prompt: "Calculate the sum of the first 20 Fibonacci numbers.",
});
Thinking Mode
Enable reasoning with configurable budget:
await generateText({
model: dashscope("qwen3.5-flash"),
providerOptions: {
dashscope: {
enableThinking: true,
thinkingBudget: 5000,
},
},
prompt: "Which is larger, 9.11 or 9.9?",
});
Context Cache
Applies to the Chat endpoint (dashscope(modelId)). The Responses endpoint (dashscope.responses(modelId)) caches via a session header instead — see Session Cache.
DashScope supports explicit caching to reduce cost and latency for repeated prefixes. Add cacheControl via providerOptions on messages or content parts:
import { generateText } from "ai";
// Cache a long system prompt (minimum 1024 tokens)
const first = await generateText({
model: dashscope("qwen3.5-flash"),
messages: [
{
role: "system",
content: longText, // must be >= 1024 tokens
providerOptions: {
dashscope: { cacheControl: { type: "ephemeral" } },
},
},
{ role: "user", content: "What does this code do?" },
],
});
// Second request with same system prompt hits the cache
const second = await generateText({
model: dashscope("qwen3.5-flash"),
messages: [
{
role: "system",
content: longText,
providerOptions: {
dashscope: { cacheControl: { type: "ephemeral" } },
},
},
{ role: "user", content: "How can it be optimized?" },
],
});
Cache on user message content parts:
await generateText({
model: dashscope("qwen3.5-flash"),
messages: [
{
role: "user",
content: [
{
type: "text",
text: longCode,
providerOptions: {
dashscope: { cacheControl: { type: "ephemeral" } },
},
},
{ type: "text", text: "Explain this code." },
],
},
],
});
Implicit caching is enabled automatically for supported models — no configuration needed.
Combining with structured output…
Description from the npm listing.
- ai
- ai-sdk
- alibaba
- aliyun
- bailian
- dashscope
- qwen
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (122)Similar npm AI SDKs plugins
All 20 @agentor/dashscope alternativesData 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/@agentor/dashscope. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.