@chroma-core/chroma-cloud-qwen

中文文档
0.1.12发布于 2026/03/27TypeScriptESM + CJS近 30 天下载 2009

Chroma embedding function

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Configuration
  4. Configuration Options
  5. Supported Models

Chroma Embeddings

This package provides an embedding function for the Qwen model family hosted on Chroma's cloud embedding service.

Installation

npm install @chroma-core/chroma-cloud-qwen

Usage

import { ChromaClient } from "chromadb";
import {
  ChromaCloudQwenEmbeddingFunction,
  ChromaCloudQwenEmbeddingModel,
  ChromaCloudQwenEmbeddingTask,
} from "@chroma-core/chroma-cloud-qwen";

// Initialize the embedder
const embedder = new ChromaCloudQwenEmbeddingFunction({
  model: ChromaCloudQwenEmbeddingModel.QWEN3_EMBEDDING_0p6B,
  task: ChromaCloudQwenEmbeddingTask.CODE_TO_CODE,
  apiKeyEnvVar: "CHROMA_API_KEY",
});

// Create a new ChromaClient
const client = new ChromaClient({
  path: "http://localhost:8000",
});

// Create a collection with the embedder
const collection = await client.createCollection({
  name: "my-collection",
  embeddingFunction: embedder,
});

// Add documents
await collection.add({
  ids: ["1", "2", "3"],
  documents: ["Document 1", "Document 2", "Document 3"],
});

// Query documents
const results = await collection.query({
  queryTexts: ["Sample query"],
  nResults: 2,
});

Configuration

Set your Chroma API key as an environment variable:

export CHROMA_API_KEY=your-api-key

Get your API key from Chroma's dashboard.

Configuration Options

  • model: Model to use for embeddings
  • task: The task for which embeddings are being generated
  • instruction_dict: A dictionary mapping tasks and targets (documents/queries) to custom instructions for the specified Qwen model
  • apiKeyEnvVar: Environment variable name for API key (default: CHROMA_API_KEY)

Supported Models

  • Qwen/Qwen3-Embedding-0.6B

版本与发布记录

@chroma-core/chroma-cloud-qwen 共发布 5 个版本,首次发布于 2025/10/30;过去 12 个月发布了 4 个版本。

版本发布日期距今
0.1.12latest2026/03/277 个月前
0.1.112026/03/118 个月前
0.1.102026/01/099 个月前
0.1.92025/11/1311 个月前
0.1.82025/10/301 年前

关于 @chroma-core/chroma-cloud-qwen 的常见问题

@chroma-core/chroma-cloud-qwen 是什么?

Chroma embedding function

如何安装 @chroma-core/chroma-cloud-qwen?

在项目目录运行 npm install @chroma-core/chroma-cloud-qwen,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:chromadb(^3.4.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@chroma-core/chroma-cloud-qwen 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chroma-core/chroma-cloud-qwen 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@chroma-core/chroma-cloud-qwen 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chroma-core/chroma-cloud-qwen 可以商用吗?

@chroma-core/chroma-cloud-qwen 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@chroma-core/chroma-cloud-qwen 的下载量有多少?

根据 npm 官方下载统计,@chroma-core/chroma-cloud-qwen 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,009 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chroma-core/chroma-cloud-qwen 还在维护吗?

最新版本 0.1.12 发布于 2026/03/27(7 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 4 个;首次发布于 2025/10/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。