mono项目开发模板,内置cli管理构建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
dash 695000b710 feat: add xllm package with streaming provider adapters 3 months ago
..
src feat: add xllm package with streaming provider adapters 3 months ago
README.md feat: add xllm package with streaming provider adapters 3 months ago
package.json feat: add xllm package with streaming provider adapters 3 months ago
vitest.config.ts feat: add xllm package with streaming provider adapters 3 months ago

README.md

@dm/xllm

统一的大模型请求库,支持:

  • 流式输出(for await...of
  • OpenAI-Compatible 与 DeepSeek 供应商适配
  • 文本、多模态输入(图片 URL)、工具调用结构统一

快速开始

import { createXllm } from "@dm/xllm";

const xllm = createXllm({
  provider: "deepseek",
  model: "deepseek-chat",
  apiKey: process.env.DEEPSEEK_API_KEY,
});

for await (const event of xllm.stream({
  messages: [{ role: "user", content: [{ type: "text", text: "你好" }] }],
})) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}