# Choose an embedding model · Semantic search on Chromia using Vector DB · Learn Chromia

> Choose an embedding model before you configure the backend or run any scripts.

Source: https://chromia.com/learn/vector-db-movie-demo/setup/embedding-model/

Semantic search on Chromia using Vector DBLesson 3 of 15

1. [01Searching movies semantically on Chromia](https://chromia.com/learn/vector-db-movie-demo/introduction/)

Module 1: Project setup

1. [02Overview](https://chromia.com/learn/vector-db-movie-demo/setup/)
2. [03Choose an embedding model](https://chromia.com/learn/vector-db-movie-demo/setup/embedding-model/)
3. [04Configure your Rell module](https://chromia.com/learn/vector-db-movie-demo/setup/configure.rell/)
4. [05Deploy your Rell module](https://chromia.com/learn/vector-db-movie-demo/setup/deploy-rell-module/)
5. [06Finalize your Python environment](https://chromia.com/learn/vector-db-movie-demo/setup/finalize-python-env/)

Module 2: Running the data pipeline

1. [07Overview](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/)
2. [08Preprocess movie data](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/preprocess/)
3. [09Generate sentence embeddings](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/generate-embeddings/)
4. [10Store vectors on the blockchain](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/upload-vectors/)

1. [11Search the vector database](https://chromia.com/learn/vector-db-movie-demo/search/)

Module 4: A deep dive into the code

1. [12Overview](https://chromia.com/learn/vector-db-movie-demo/code-deep-dive/)
2. [13Link your data to the Vector DB with Rell](https://chromia.com/learn/vector-db-movie-demo/code-deep-dive/rell-interface/)
3. [14Work with Chromia through the Python client](https://chromia.com/learn/vector-db-movie-demo/code-deep-dive/python-client/)

1. [15Use cases and extensions](https://chromia.com/learn/vector-db-movie-demo/use-cases/)

[Learn](https://chromia.com/learn/)[Semantic search on Chromia using Vector DB](https://chromia.com/learn/vector-db-movie-demo/)

03 / 15Module 1: Project setupAdvanced

# Choose an embedding model

Choose an embedding model before you configure the backend or run any scripts.

The model turns each movie plot summary into a vector of fixed length. That length, the **dimension**, depends on the model, and you need to set it in your backend.

## Clone the repo

If you don't have the project repository locally yet, clone it:

bash

```nolines
git clone https://bitbucket.org/chromawallet/vector-db-movie-demo.git
cd vector-db-movie-demo
```

## Create your `.env` file

In the `python/` folder, copy the template to create a `.env` file:

bash

```nolines
cd python
cp .env.template .env
```

You'll edit this file in the next step.

## Select your model

Open `.env` in your editor and uncomment the line for the `EMBEDDING_MODEL` option you want.

Example:

env

```nolines
EMBEDDING_MODEL=sentence-transformers/all-mpnet-base-v2
```

This setting determines which sentence embedding model vectorizes the movie summaries.

note

Write down the dimension of your chosen model. You'll need it in the next lesson when you set up the Rell module.

You can also use a different model from the Hugging Face Hub, as long as it works with the `sentence-transformers` library and outputs dense vectors.

## Model overview

| Model | Dimensions | Notes |
| --- | --- | --- |
| `all-MiniLM-L6-v2` | 384 | Compact and fast |
| `all-mpnet-base-v2` | 768 | Balanced; a sensible default |
| `all-roberta-large-v1` | 1024 | Higher quality, slower |
| `intfloat/e5-large-v2` | 1024 | Uses query:/passage: prefixes; strongest for search |
| `BAAI/bge-large-en-v1.5` | 1024 | Alternative with very strong performance |

## Choosing the right model

Bigger models can produce better semantic matches, but they use more memory and take longer to run.  
On a GPU, any model in the table should work without problems.  
On a CPU, a smaller model keeps processing from becoming slow.

In the next step, you'll enter the model's dimension when configuring your Rell module in `chromia.yml`.

Written for this site from Chromia’s public course. Code samples are the course’s own.

[← Previous**Module 1: Project setup**](https://chromia.com/learn/vector-db-movie-demo/setup/)[Next →**Configure your Rell module**](https://chromia.com/learn/vector-db-movie-demo/setup/configure.rell/)

On this page

* [Clone the repo](#clone-the-repo)
* [Create your .env file](#create-your-env-file)
* [Select your model](#select-your-model)
* [Model overview](#model-overview)
* [Choosing the right model](#choosing-the-right-model)
