@eltjs/embedding weekly downloads statistics
A rule of an elt computed dataset: it gives each loaded row a vector of its text, made by an AI SDK embedding model, so a search can find rows by meaning.
@eltjs/embedding has 4,682 recorded weekly downloads on npm, a change of -21.4% over the past 7 days, ranking #1555 of 3,247 tracked listings.
About @eltjs/embedding
Embedding
Embedding is a rule of a computed dataset. It gives each loaded row a vector of its text, made by an AI SDK embedding model, so that a vector search can find rows by meaning.
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
import { ComputedDataset } from '@eltjs/elt-sqlite';
import { Embedding } from '@eltjs/embedding';
const model = createOpenAICompatible({
name: 'llama.cpp',
baseURL: 'http://127.0.0.1:8080/v1',
}).embeddingModel('embeddinggemma-2');
new ComputedDataset({
into: destination,
name: 'listing_vectors',
description: 'The vector of each listing.',
from: [listings],
compute: new Embedding({
model,
dimensions: 768,
clock: globalThis,
key: 'id',
fields: ['title', 'description'],
}),
});
dimensionsis the number of values in each vector of the model, for example 768 for EmbeddingGemma and 1,536 fortext-embedding-3-small. The output columnvectoris a vector column of these dimensions.clockwaits out the limit of each model call. An app givesglobalThis, and a test gives a fake clock.keyis the column that identifies a row. It is the key of the output row.fieldsare the columns whose text makes the vector. The rule joins their text with line breaks. A row with no text in these columns has no vector.- The output column
vectorholds aUnitVectorof@zukhruf/vectors: float32 values with a length of 1, so the cosine similarity of two vectors is their dot product. Each destination keeps it in its own form. SQLite and Postgres keep the bytes oftoSqlof@zukhruf/vectors/sqlite, whichVectorSearchof@zukhruf/embeddingsreads. - The identity of each row is the provider, the id of the model and the dimensions, for example
openai/text-embedding-3-small (1536 dimensions). One model can give vectors of different dimensions, as thedimensionsoption of OpenAI'stext-embedding-3models does. When you change the model or the dimensions, the next refresh makes every vector again.
Failures
A model failure stays on the output row, and the next pass asks again (ADR 0007 of elt-sqlite).
- When the model answers a call with HTTP 400, the rule splits the call in halves until it finds each text that the model refuses. Only the row of that text fails. An example is a text over the limit of the model.
- Any other failure fails each row of the call. A split would only send more calls to a model that is down.
- One call has 120 seconds, with its retries. At that limit, each row of the call fails, and the next batch runs.
- A stopped refresh fails no row. The next refresh makes those rows.
- The rule sends 64 rows to
embedManyat a time. When the model refuses a call, each row of that call is stored asfailedwith the error, and the next refresh asks again. The load does not fail. - A vector with no usable length, because it is all zeros or holds a value that is not finite, has no unit vector. Its row is stored as
failedwith the error, the other rows of the call staycomputed, and the next refresh asks again. - A vector of other dimensions than
dimensionsdoes not fit its column. Its row is stored asfailedwith an error that names both counts, and the next refresh asks again. - To search, declare a view that gives
idandvector, and give its name toVectorSearch. A search by publish date, such asnearest, also needspublished_at. A query without a date range does not.
Give the model its prompts
Some models want a prompt before each text, and a different prompt for a document and for a search text. EmbeddingGemma wants title: none | text: … before a document and task: search result | query: … before a search text. The rule does not know the model, so it adds no prompt. Wrap the model with wrapEmbeddingModel of the AI SDK, one time for documents and one time for search texts:
import { embed, wrapEmbeddingModel } from 'ai';
const gemma = local.embeddingModel('embeddinggemma-2');
const prompted = (modelId: string, prompt: string) =>
wrapEmbeddingModel({
model: gemma,
modelId,
middleware: {
transformParams: async ({ params }) => ({
...params,
values: params.values.map((text) => `${prompt}${text}`),
}),
},
});
const documents = prompted('embeddinggemma-2/document', 'title: none | text: ');
const searches = prompted(
'embeddinggemma-2/query',
'task: search result | query: ',
);
new Embedding({
model: documents,
dimensions: 768,
clock: globalThis,
key: 'id',
fields: ['title', 'description'],
});
const { embedding } = await embed({ model: searches, value: 'family sedan' });
new VectorSearch({ database, table: 'listing_vectors' }).query(embedding);
Give each wrapped model its own modelId. The identity of a row names the provider and the id of the model, so a new prompt with a new modelId makes every vector again.
On 2026-10-27, 42 OpenSooq listings that source-opensooq-web crawled got their vectors from EmbeddingGemma 2 in one run. nearest of a bicycle listing gave other bicycle listings first. A second run made no vector again.
The package does not start a model or a server. Give it a model that is ready. See when the pipeline refreshes for how a pipeline refreshes the rows.
Description from the npm listing.
- elt
- embedding
- vector
- ai-sdk
- semantic-search
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (135)Similar npm AI SDKs plugins
All 20 @eltjs/embedding alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@eltjs/embedding. First seen Nov 20, 2026; last successful collection Dec 6, 2026. See the methodology.