Skip to content

Commit ab2f52a

Browse files
committed
docs: choosing an embedding model
1 parent 28c7984 commit ab2f52a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/guide/choosing-a-model.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ npx --no node-llama-cpp inspect estimate <model-file-url>
8383
```
8484
:::
8585

86-
### What do you need this model for? (chat, code completion, analyzing data, classification, etc.) {#model-purpose}
86+
### What do you need this model for? (chat, code completion, analyzing data, classification, embedding, etc.) {#model-purpose}
8787
There are plenty of models with different areas of expertise and capabilities.
8888

8989
When you choose a model that is more specialized in the task you need it for, it will usually perform better than a general model.
@@ -111,6 +111,18 @@ Here are a few concepts to be aware of when choosing a model:
111111
you can either recognize the foundational model name and then assume that the rest is a fine-tune name,
112112
or you can open the model's page and read the model description.
113113

114+
* **Embedding models** - models that are trained to convert text into [embeddings](./embedding.md) that capture the semantic meaning of the text.
115+
116+
Generating embeddings for similarity search using such models is preferable
117+
because they are highly optimized for this task.
118+
Embedding models are often significantly smaller (sometimes as small as 100MB), faster,
119+
and consume less memory than general-purpose models, making them more efficient and practical.
120+
121+
While general-purpose models can also be used for generating embeddings,
122+
they may not be as optimized or as efficient as embedding models for this task.
123+
124+
Many embedding models include terms like `embed` in their name.
125+
114126
### How much data do you plan to feed the model at once with?
115127
If you plan to feed the model with a lot of data at once, you'll need a model that supports a large context size.
116128
The larger the context size is, the more data the model can process at once.

docs/guide/embedding.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Instead, we can embed all the documents once and then search for the most simila
2323
To do that, we embed all the documents in advance and store the embeddings in a database.
2424
Then, when a query comes in, we embed the query and search for the most similar embeddings in the database, and return the corresponding documents.
2525

26+
Read the [choosing a model tutorial](./choosing-a-model.md) to learn how to choose the right model for your use case.
27+
2628
## Finding Relevant Documents
2729
Let's see an example of how we can embed 10 texts and then search for the most relevant one to a given query:
2830
::: warning NOTE

0 commit comments

Comments
 (0)