Qwen (Tongyi Qianwen)
Qwen embedding models are designed for text embedding and ranking. The family is based on Qwen3 dense foundation models and supports 100+ languages, long context (up to 32K tokens), and strong reasoning. seekdb provides QwenEmbeddingFunction so you can generate Qwen embeddings and use them with seekdb collections.
tip
Using Qwen service requires you to follow the provider's pricing rules and may incur corresponding fees. Before proceeding, please visit their official website or refer to relevant documentation to confirm and accept their pricing standards. If you do not agree, please do not proceed.
Dependencies and authentication
- Install the
@seekdb/qwenpackage. - Have permission to call the Qwen Embedding API (for example, a Dashscope API key).
Example: create a Qwen embedding function
Call the QwenEmbeddingFunction constructor with an optional config object.
import { QwenEmbeddingFunction } from "@seekdb/qwen";
const qwenEmbed = new QwenEmbeddingFunction({
modelName: "text-embedding-v4",
});
Configurations:
- apiKey: Dashscope API key (optional; if omitted, read from the environment).
- apiKeyEnvVar: Environment variable name for the API key (default:
DASHSCOPE_API_KEY). - modelName: Model name (default:
text-embedding-v4). - dimensions: Output dimension (default:
1024). - region: API region:
"cn"(China) or"intl"(international) (default:"cn").