zhipu-ai-sdk-provider weekly downloads statistics
Vercel AI SDK provider for Zhipu AI — GLM language models, embeddings, image generation, web search, and text-to-speech
zhipu-ai-sdk-provider has 1,722 recorded weekly downloads on npm, an increase of 515% over the past 30 days.
About zhipu-ai-sdk-provider
zhipu-ai-sdk-provider
Zhipu AI provider for the Vercel AI SDK. Integrates GLM language models, embedding models, image generation, and text-to-speech from bigmodel.cn.
Installation
npm install zhipu-ai-sdk-provider ai
Configuration
Set your API key from bigmodel.cn:
export ZHIPU_API_KEY=your-api-key
Quick Start
import { generateText } from "ai";
import { zhipu } from "zhipu-ai-sdk-provider";
const { text } = await generateText({
model: zhipu("glm-4.7"),
prompt: "Why is the sky blue?",
});
console.log(text);
Provider Setup
Default instance — reads ZHIPU_API_KEY from environment:
import { zhipu } from "zhipu-ai-sdk-provider";
Custom instance — pass your own config:
import { createZhipu } from "zhipu-ai-sdk-provider";
const zhipu = createZhipu({
apiKey: "your-api-key",
baseURL: "https://open.bigmodel.cn/api/paas/v4", // default
headers: { "X-Custom": "value" }, // optional
});
Settings
| Option | Type | Description |
|---|---|---|
apiKey | string | API key. Defaults to ZHIPU_API_KEY env var. |
baseURL | string | API base URL. Defaults to https://open.bigmodel.cn/api/paas/v4. |
headers | Record<string, string> | Custom headers to include in requests. |
fetch | FetchFunction | Custom fetch implementation (e.g. for testing or proxying). |
Supported Models
Language Models
| Model | Description |
|---|---|
glm-5 | Latest flagship, designed for agent applications |
glm-4.7 | High-performance with deep thinking |
glm-4.7-flash | Fast variant of GLM-4.7 |
glm-4.7-flashx | Extended fast variant of GLM-4.7 |
glm-4.6 | Previous-gen flagship, supports tool_stream |
glm-4.5 | GLM-4.5 with thinking support |
glm-4.5-air | Lightweight GLM-4.5 |
glm-4.5-x | Extended GLM-4.5 |
glm-4.5-airx | Extended lightweight GLM-4.5 |
glm-4.5-flash | Fast GLM-4.5 |
glm-4-plus | Enhanced GLM-4 |
glm-4-air | Lightweight GLM-4 |
glm-4-air-250414 | GLM-4-air dated snapshot |
glm-4-airx | Extended lightweight GLM-4 |
glm-4-long | Long-context GLM-4 |
glm-4-flash | Fast GLM-4 |
glm-4-flash-250414 | GLM-4-flash dated snapshot |
glm-4-flashx | Extended fast GLM-4 |
glm-4-32b-0414-128k | Open-source 32B model, 128K context |
Vision Models
| Model | Description |
|---|---|
glm-4.6v | GLM-4.6 vision model |
glm-4.6v-flash | Fast GLM-4.6 vision |
glm-4.6v-flashx | Extended fast GLM-4.6 vision |
glm-4.5v | GLM-4.5 vision model |
glm-4v-plus-0111 | Enhanced GLM-4 vision |
glm-4v-plus | GLM-4 vision |
glm-4v | Standard GLM-4 vision |
glm-4v-flash | Fast GLM-4 vision |
Reasoning Models
| Model | Description |
|---|---|
glm-z1-air | Lightweight reasoning model |
glm-z1-airx | Extended reasoning model |
glm-z1-flash | Fast reasoning model |
glm-4.1v-thinking-flash | Vision + reasoning |
glm-4.1v-thinking-flashx | Extended vision + reasoning |
Embedding Models
| Model | Description |
|---|---|
embedding-3 | Latest embedding model (recommended) |
embedding-2 | Standard embedding model |
Image Generation Models
| Model | Description |
|---|---|
cogview-4-250304 | Latest CogView 4, supports quality: "hd" |
cogview-4 | Standard CogView 4 |
cogview-3-flash | Fast image generation |
Speech Models
| Model | Description |
|---|---|
glm-tts | Text-to-speech model |
Usage
Text Generation
import { generateText } from "ai";
import { zhipu } from "zhipu-ai-sdk-provider";
const { text } = await generateText({
model: zhipu("glm-4.7"),
prompt: "Explain quantum computing in simple terms.",
});
Streaming
import { streamText } from "ai";
import { zhipu } from "zhipu-ai-sdk-provider";
const result = streamText({
model: zhipu("glm-4.7"),
prompt: "Write a short story about a robot.",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
Thinking / Reasoning Mode
GLM-5 and GLM-4.7 models have thinking enabled by default. You can control this via model settings:
// Enable with preserved thinking (retains reasoning across turns)
const { text } = await generateText({
model: zhipu("glm-4.7", {
thinking: {
type: "enabled",
clearThinking: false, // preserve reasoning context across turns
},
}),
prompt: "Solve step by step: What is 23 * 47?",
});
// Disable thinking for faster responses
const { text } = await generateText({
model: zhipu("glm-4.7", {
thinking: { type: "disabled" },
}),
prompt: "What is 2 + 2?",
});
You can also configure thinking at call time with zhipuOptions:
import { generateText } from "ai";
import { zhipu, zhipuOptions } from "zhipu-ai-sdk-provider";
const { text } = await generateText({
model: zhipu("glm-4.7"),
prompt: "Solve this complex math problem.",
providerOptions: zhipuOptions({
thinking: { type: "enabled", clear_thinking: false },
}),
});
Provider Options (zhipuOptions)
Use zhipuOptions to pass Zhipu-specific API parameters at call time. Options are passed directly — no nesting required:
import { generateText } from "ai";
import { zhipu, zhipuOptions } from "zhipu-ai-sdk-provider";
const { text } = await generateText({
model: zhipu("glm-4.7"),
prompt: "Hello!",
providerOptions: zhipuOptions({
temperature: 0.7,
top_p: 0.9,
max_tokens: 4096,
do_sample: true,
}),
});
Available Options…
Description from the npm listing.
- zhipu
- bigmodel
- glm
- ai
- provider
- vercel-ai
- vercel
- ai-sdk
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 zhipu-ai-sdk-provider 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/zhipu-ai-sdk-provider. First seen Oct 16, 2026; last successful collection Oct 22, 2026. See the methodology.