# Mistral-embed as custom vectorizer

**URL:** https://forum.weaviate.io/t/mistral-embed-as-custom-vectorizer/1602
**Category:** General
**Tags:** python
**Created:** [February 29, 2024, 11:33am UTC](https://forum.weaviate.io/t/mistral-embed-as-custom-vectorizer/1602 "2024-02-29T11:33:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mehmet\_ali\_abdulhayo](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/mehmet_ali_abdulhayo/32/1041_2.png) [@mehmet\_ali\_abdulhayo](https://forum.weaviate.io/u/mehmet_ali_abdulhayo)
#### Post date: [February 29, 2024, 11:33am UTC](https://forum.weaviate.io/t/mistral-embed-as-custom-vectorizer/1602/1 "2024-02-29T11:33:04Z")

</div>

As a novice to llama index and weaviate, I am following the codes in [Structured Hierarchical Retrieval - LlamaIndex 🦙 v0.10.14](https://docs.llamaindex.ai/en/stable/examples/query_engine/multi_doc_auto_retrieval/multi_doc_auto_retrieval.html).

Here weaviate uses the default openai embedding models. How can I customize it with **mistral-embed**. From my searches, if I am not mistaken, I need to introduce schema mentioning which text2vec to be used. But in the code I keep failing how to do this.

How to adjust the code below so that it would create the embeddings based ona custom embedding model?

> import weaviate
> 
> auth\_config = weaviate.AuthApiKey(  
> api\_key=“XRa15cDIkYRT7AkrpqT6jLfE4wropK1c1TGk”  
> )  
> client = weaviate.Client(  
> “[https://llama-index-test-v0oggsoz.weaviate.network](https://llama-index-test-v0oggsoz.weaviate.network)”,  
> auth\_client\_secret=auth\_config,  
> )
> 
> class\_name = “LlamaIndex\_docs”
> 
> from llama\_index.vector\_stores.weaviate import WeaviateVectorStore  
> from llama\_index.core import VectorStoreIndex, StorageContext
> 
> vector\_store = WeaviateVectorStore(  
> weaviate\_client=client, index\_name=class\_name  
> )  
> storage\_context = StorageContext.from\_defaults(vector\_store=vector\_store)
> 
> doc\_index = VectorStoreIndex.from\_documents(  
> docs, storage\_context=storage\_context  
> )

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [February 29, 2024, 2:38pm UTC](https://forum.weaviate.io/t/mistral-embed-as-custom-vectorizer/1602/2 "2024-02-29T14:38:21Z")

</div>

Hi!

When using those integrations, is a good one to initiate the class beforehand an have the correct vectorizer configured.

I have not played with llamaindex yet, only with langchain, and I did exactly that in a integration in our recipes:

> **[GitHub - weaviate/recipes: This repository shares end-to-end notebooks on how...](https://github.com/weaviate/recipes)**
>
> This repository shares end-to-end notebooks on how to use various features and integrations with Weaviate at the core! - weaviate/recipes

This will allow you run queries thru llama index as well as directly in Weaviate.

I believe you can run this model thru Hugging Face? [text2vec-huggingface | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-huggingface)

Another options is using text2vec-transformers, where you can customize a container with the model you want:

> **[text2vec-transformers | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-transformers#model-selection)**
>
> Overview

Let me know if that helps.
