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

@infimind-next/llm-gateway

v0.1.0

Published

Node.js TypeScript SDK for unified text, image, and video generation across multiple model providers.

Readme

Infimind LLM Gateway TypeScript SDK

这是 sdks/typescript 下的 Infimind LLM Gateway TypeScript SDK。它面向 Node.js 18+ 服务端运行环境,使用 ESM、全局 fetchzodAsyncIterable,统一调用阿里云、火山引擎、云雾、WaveSpeed 的文本、图像、图像编辑和视频生成能力。

安装

pnpm install

环境变量

export ALIYUN_API_KEY="..."
export VOLCENGINE_API_KEY="..."
export YUNWU_API_KEY="..."
export WAVESPEED_API_KEY="..."

可选 base URL 覆盖:

export ALIYUN_BASE_URL="https://..."
export ALIYUN_TEXT_BASE_URL="https://..."
export ALIYUN_MEDIA_BASE_URL="https://..."

其他 provider 使用 VOLCENGINE_*YUNWU_*WAVESPEED_* 的同名规则。

文本生成

import { LLMGatewayClient } from "@infimind-next/llm-gateway";

const client = LLMGatewayClient.fromEnv();
const result = await client.generateText({
  provider: "aliyun",
  model: "qwen-plus",
  prompt: "写一句产品文案",
});

console.log(result.text);

文本流式

for await (const chunk of client.streamText({
  provider: "yunwu",
  model: "gpt-4o-mini",
  prompt: "用三点介绍流式输出",
})) {
  process.stdout.write(chunk.delta);
}

图像生成

PROVIDER=wavespeed MODEL=wavespeed-ai/flux-dev pnpm example:generate-image

图像编辑

图像编辑首版只对 Yunwu 和 WaveSpeed 开放;Aliyun 和 Volcengine 会返回 UnsupportedCapabilityError

PROVIDER=yunwu MODEL=gpt-image-1 IMAGE="https://example.com/input.png" pnpm example:edit-image

视频生成

PROVIDER=aliyun MODEL=wan2.6-t2v DURATION=5 pnpm example:generate-video

默认测试

pnpm test
pnpm lint
pnpm typecheck
pnpm build

Live Tests

Live tests 是 opt-in 的真实供应商调用,会产生供应商费用,也可能受额度、模型权限、区域和异步任务排队影响。

RUN_LIVE_TESTS=1 pnpm test:live

live tests 会自动加载仓库根目录 .env。缺少对应 API key 的 provider 会自动 skip。

License

本 SDK 使用 AGPL-3.0-only。发布包会包含 LICENSE