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

@easbot/local-model-sdk

v0.3.19

Published

Complete local model SDK for EASBot - Transformers.js + ONNX implementation supporting both Language Model (text generation) and Embedding (text embedding) with full AI SDK v3 compatibility

Readme

English | 中文

Local Model SDK

基于 Transformers.js + ONNX 的本地模型 SDK,支持 Language Model(文本生成)和 Embedding(文本嵌入)功能,完全兼容 AI SDK 规范。

特性

  • Language Model 支持:基于 Transformers.js 的文本生成能力
  • Embedding 支持:高质量的文本嵌入向量生成
  • 流式生成:支持实时流式文本输出
  • 批量处理:高效的批量嵌入处理
  • 模型缓存:自动管理模型文件缓存
  • AI SDK 兼容:完全兼容 AI SDK v3 规范
  • TypeScript:完整的类型定义支持
  • 离线运行:无需网络连接,完全本地化

安装

pnpm add @easbot/local-model-sdk

快速开始

Language Model - 文本生成

import { LocalModelProvider } from '@easbot/local-model-sdk';
import { generateText } from 'ai';

// 创建 Provider
const provider = new LocalModelProvider({
  cacheDir: '.cache/models',
});

// 创建 Language Model
const model = provider.languageModel('qwen2.5-0.5b-instruct');

// 生成文本
const result = await generateText({
  model,
  prompt: 'What is the capital of France?',
});

console.log(result.text);

Language Model - 流式生成

import { streamText } from 'ai';

const result = streamText({
  model,
  prompt: 'Write a short story about a robot.',
});

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

Embedding - 文本嵌入

import { embed, embedMany } from 'ai';

const result = await embed({
  model: provider.embeddingModel('bge-small-zh-v1.5'),
  value: 'Hello world',
});

console.log(result.embedding);

const batchResult = await embedMany({
  model: provider.embeddingModel('bge-small-zh-v1.5'),
  values: ['Text 1', 'Text 2', 'Text 3'],
});

console.log(batchResult.embeddings);

支持的模型

Language Models

| 模型 ID | 描述 | 参数量 | |---------|------|--------| | qwen3-0.6b | Qwen3 0.6B 基础模型 | 0.6B | | qwen2.5-0.5b-instruct | Qwen2.5 0.5B 指令模型 | 0.5B | | qwen2.5-1.5b-instruct | Qwen2.5 1.5B 指令模型 | 1.5B | | qwen2.5-3b-instruct | Qwen2.5 3B 指令模型 | 3B |

Embedding Models

| 模型 ID | 描述 | 维度 | |---------|------|------| | bge-small-zh-v1.5 | BGE Small 中文模型 | 512 | | bge-base-zh-v1.5 | BGE Base 中文模型 | 768 | | bge-large-zh-v1.5 | BGE Large 中文模型 | 1024 |

开发

# 安装依赖
pnpm install

# 构建
pnpm build

# 测试
pnpm test

# 类型检查
pnpm type-check

许可证

MIT