Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified img/vector/create_index_with_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 26 additions & 56 deletions llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99184,9 +99184,9 @@ curl $UPSTASH_VECTOR_REST_URL/info \
"similarityFunction": "COSINE",
"indexType": "HYBRID",
"denseIndex": {
"dimension": 1024,
"dimension": 1536,
"similarityFunction": "COSINE",
"embeddingModel": "BGE_M3"
"embeddingModel": "TEXT_EMBEDDING_3_SMALL"
},
"sparseIndex": {
"embeddingModel": "BM25"
Expand Down Expand Up @@ -100649,56 +100649,38 @@ you can now upsert and query raw string data when using your database instead of
converting your text to a vector first. The vectorization is done automatically
by your selected model.

## Upstash Embedding Models - Video Guide

Let's look at how Upstash embeddings work, how the models we offer compare, and
which model is best for your use case.

<iframe
id="intro-video"
width='560'
height='315'
src='https://www.youtube.com/embed/aImBIYwn5Ew?rel=0&disablekb=1'
title='YouTube video player'
frameBorder='0'
allow='accelerometer; fullscreen; clipboard-write; encrypted-media; gyroscope'
allowFullScreen></iframe>

## Models

Upstash Vector comes with a variety of embedding models that score well in the
[MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard, a benchmark
for measuring the performance of embedding models. They support use cases such
as classification, clustering, or retrieval.
Upstash Vector hosts the following embedding model for dense and hybrid indexes:

You can choose the following general purpose models for dense and hybrid indexes:
| Name | Dimension | Sequence Length | MTEB |
| ----------------------------------------------------------------------------------------- | --------- | --------------- | ---- |
| [openai/text-embedding-3-small](https://platform.openai.com/docs/guides/embeddings) | 1536 | 8191 | 62.3 |

| Name | Dimension | Sequence Length | MTEB |
| ------------------------------------------------------------------------------------------------------- | --------- | --------------- | ----- |
| [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) | 1024 | 512 | 64.23 |
| [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) | 768 | 512 | 63.55 |
| [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) | 384 | 512 | 62.17 |
| [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3) | 1024 | 8192 | * |
The MTEB score is the average reported by OpenAI in its
[model announcement](https://openai.com/index/new-embedding-models-and-api-updates/).

<Note>
The sequence length is not a hard limit. Models truncate the input
appropriately when given a raw text data that would result in more tokens than
the given sequence length. However, we recommend using appropriate models and
not exceeding their sequence length to have more accurate results.
The sequence length is not a hard limit. The model truncates the input
appropriately when given raw text that would result in more tokens than
the given sequence length. However, we recommend not exceeding the sequence
length to have more accurate results.
</Note>

<Note>
MTEB score for the `BAAI/bge-m3` is not fully measured.
</Note>
For sparse and hybrid indexes, the following model can be selected:

For sparse and hybrid indexes, on the following models can be selected:
| Name |
| ------------------------------------------------ |
| [BM25](https://en.wikipedia.org/wiki/Okapi_BM25) |

| Name |
| ------------------------------------------------- |
| [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3) |
| [BM25](https://en.wikipedia.org/wiki/Okapi_BM25) |
See [Creating Sparse Vectors](/docs/vector/features/sparseindexes#creating-sparse-vectors) for the details of the above model.

See [Creating Sparse Vectors](/docs/vector/features/sparseindexes#creating-sparse-vectors) for the details of the above models.
<Note>
The BGE models (`BAAI/bge-large-en-v1.5`, `BAAI/bge-base-en-v1.5`,
`BAAI/bge-small-en-v1.5` and `BAAI/bge-m3`) are no longer available for new
indexes. If you need a different model, you can generate the embeddings
yourself and create the index with a custom dimension.
</Note>

## Using a Model

Expand Down Expand Up @@ -103868,7 +103850,7 @@ Sparse vectors are representations in a high-dimensional space,
where only a small number of dimensions have non-zero values.

For example, for the same text, a dense vector representation with
the BGE-M3 model would have 1024 non-zero valued dimensions.
the `text-embedding-3-small` model would have values in all of its 1536 dimensions.
However, the sparse vector representation of the same text would
have less than a hundred non-zero valued dimensions, whereas vector
space potentially has more than 250 thousand dimensions. Also, unlike
Expand Down Expand Up @@ -103917,24 +103899,12 @@ that enhance documents and queries with term weighting and expansion.
Upstash gives you full control by allowing you to upsert and query
sparse vectors.

Also, to make embedding easier for you, Upstash provides some hosted
models and allows you to upsert and query text data. Behind the scenes,
Also, to make embedding easier for you, Upstash provides a hosted
BM25 model and allows you to upsert and query text data. Behind the scenes,
the text data is converted to sparse vectors.

You can create your index with a sparse embedding model to use this feature.

### BGE-M3 Sparse Vectors

BGE-M3 is a multi-functional, multi-lingual, and multi-granular model
widely used for dense indexes.

We also provide BGE-M3 as a sparse vector embedder, which outputs
sparse vectors from `250_002` dimensional space.

These sparse vectors have values where each token is weighted
according to the input text, which enhances traditional sparse vectors
with contextuality.

### BM25 Sparse Vectors

BM25 is a popular algorithm used in full-text search systems to rank
Expand Down
4 changes: 2 additions & 2 deletions vector/api/endpoints/info.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ curl $UPSTASH_VECTOR_REST_URL/info \
"similarityFunction": "COSINE",
"indexType": "HYBRID",
"denseIndex": {
"dimension": 1024,
"dimension": 1536,
"similarityFunction": "COSINE",
"embeddingModel": "BGE_M3"
"embeddingModel": "TEXT_EMBEDDING_3_SMALL"
},
"sparseIndex": {
"embeddingModel": "BM25"
Expand Down
60 changes: 21 additions & 39 deletions vector/features/embeddingmodels.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,38 @@ you can now upsert and query raw string data when using your database instead of
converting your text to a vector first. The vectorization is done automatically
by your selected model.

## Upstash Embedding Models - Video Guide

Let's look at how Upstash embeddings work, how the models we offer compare, and
which model is best for your use case.

<iframe
id="intro-video"
width='560'
height='315'
src='https://www.youtube.com/embed/aImBIYwn5Ew?rel=0&disablekb=1'
title='YouTube video player'
frameBorder='0'
allow='accelerometer; fullscreen; clipboard-write; encrypted-media; gyroscope'
allowFullScreen></iframe>

## Models

Upstash Vector comes with a variety of embedding models that score well in the
[MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard, a benchmark
for measuring the performance of embedding models. They support use cases such
as classification, clustering, or retrieval.
Upstash Vector hosts the following embedding model for dense and hybrid indexes:

You can choose the following general purpose models for dense and hybrid indexes:
| Name | Dimension | Sequence Length | MTEB |
| ----------------------------------------------------------------------------------------- | --------- | --------------- | ---- |
| [openai/text-embedding-3-small](https://platform.openai.com/docs/guides/embeddings) | 1536 | 8191 | 62.3 |
Comment thread
CahidArda marked this conversation as resolved.

| Name | Dimension | Sequence Length | MTEB |
| ------------------------------------------------------------------------------------------------------- | --------- | --------------- | ----- |
| [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) | 1024 | 512 | 64.23 |
| [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) | 768 | 512 | 63.55 |
| [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) | 384 | 512 | 62.17 |
| [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3) | 1024 | 8192 | * |
The MTEB score is the average reported by OpenAI in its
[model announcement](https://openai.com/index/new-embedding-models-and-api-updates/).

<Note>
The sequence length is not a hard limit. Models truncate the input
appropriately when given a raw text data that would result in more tokens than
the given sequence length. However, we recommend using appropriate models and
not exceeding their sequence length to have more accurate results.
The sequence length is not a hard limit. The model truncates the input
appropriately when given raw text that would result in more tokens than
the given sequence length. However, we recommend not exceeding the sequence
length to have more accurate results.
Comment thread
CahidArda marked this conversation as resolved.
</Note>

<Note>
MTEB score for the `BAAI/bge-m3` is not fully measured.
</Note>
For sparse and hybrid indexes, the following model can be selected:

For sparse and hybrid indexes, on the following models can be selected:
| Name |
| ------------------------------------------------ |
| [BM25](https://en.wikipedia.org/wiki/Okapi_BM25) |

| Name |
| ------------------------------------------------- |
| [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3) |
| [BM25](https://en.wikipedia.org/wiki/Okapi_BM25) |
See [Creating Sparse Vectors](/vector/features/sparseindexes#creating-sparse-vectors) for the details of the above model.
Comment thread
CahidArda marked this conversation as resolved.

See [Creating Sparse Vectors](/vector/features/sparseindexes#creating-sparse-vectors) for the details of the above models.
<Note>
The BGE models (`BAAI/bge-large-en-v1.5`, `BAAI/bge-base-en-v1.5`,
`BAAI/bge-small-en-v1.5` and `BAAI/bge-m3`) are no longer available for new
indexes. If you need a different model, you can generate the embeddings
yourself and create the index with a custom dimension.
</Note>

## Using a Model

Expand Down
18 changes: 3 additions & 15 deletions vector/features/sparseindexes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Sparse vectors are representations in a high-dimensional space,
where only a small number of dimensions have non-zero values.

For example, for the same text, a dense vector representation with
the BGE-M3 model would have 1024 non-zero valued dimensions.
the `text-embedding-3-small` model would have values in all of its 1536 dimensions.
However, the sparse vector representation of the same text would
have less than a hundred non-zero valued dimensions, whereas vector
space potentially has more than 250 thousand dimensions. Also, unlike
Expand Down Expand Up @@ -55,24 +55,12 @@ that enhance documents and queries with term weighting and expansion.
Upstash gives you full control by allowing you to upsert and query
sparse vectors.

Also, to make embedding easier for you, Upstash provides some hosted
models and allows you to upsert and query text data. Behind the scenes,
Also, to make embedding easier for you, Upstash provides a hosted
BM25 model and allows you to upsert and query text data. Behind the scenes,
the text data is converted to sparse vectors.

You can create your index with a sparse embedding model to use this feature.

### BGE-M3 Sparse Vectors

BGE-M3 is a multi-functional, multi-lingual, and multi-granular model
widely used for dense indexes.

We also provide BGE-M3 as a sparse vector embedder, which outputs
sparse vectors from `250_002` dimensional space.

These sparse vectors have values where each token is weighted
according to the input text, which enhances traditional sparse vectors
with contextuality.

### BM25 Sparse Vectors

BM25 is a popular algorithm used in full-text search systems to rank
Expand Down