# Normalizing a vector when using weaviate with a text2vec-transformers

**URL:** <https://forum.weaviate.io/t/normalizing-a-vector-when-using-weaviate-with-a-text2vec-transformers/21533>\
**Category:** Support\
**Created:** [June 26, 2025, 1:37pm UTC](https://forum.weaviate.io/t/normalizing-a-vector-when-using-weaviate-with-a-text2vec-transformers/21533 "2025-06-26T13:37:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjalex](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rjalex/32/807_2.png) [@rjalex](https://forum.weaviate.io/u/rjalex)\
**Post date:** [June 26, 2025, 1:37pm UTC](https://forum.weaviate.io/t/normalizing-a-vector-when-using-weaviate-with-a-text2vec-transformers/21533/1 "2025-06-26T13:37:55Z")

</div>

I am using weaviate 1.3.1 local via docker with a text2vec-transformers (multilingual-e5-large-inference) image as the backend embedder (see below for details)

From this embedder I read:

```auto
* The E5 models (including `e5-multilingual-large`) produce embeddings that are **meant to be L2-normalized** (i.e., turned into unit vectors).
* The **contrastive loss** used during training assumes cosine similarity — which mathematically requires **unit-length vectors** for correct behavior.

```

and also asking ChatGPT about what happens if you skip it (which I have done until now) it says:

```auto
### Consequences of Skipping Normalization:

* Storing **raw, unnormalized vectors** in Weaviate (or any vector DB) means you're not really using **cosine similarity** , even if the DB claims to.
* This can lead to **suboptimal retrieval results** , particularly poor semantic matching and lower recall/precision.

```

The embedder /vectors endpoint does not allow me to do anything other that sending it a string:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/2X/4/41db892f353e9bc109742982249ee3abf1e5ef13.png)

so the question is “ **does this container wrongly return the raw E5 vector or does it normalize it under the covers?** ”

Thank you very much.

Docker compose declaration follows.

I am using weaviate 1.3.1 local via docker as per the following config:

```auto
services:
  weaviate131:
    networks:
      - mema_docker_compose_weaviate_net 
    command:
      - --host
      - 0.0.0.0
      - --port
      - '8080'
      - --scheme
      - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.31.0
    ports:
      - "${WEAVIATE_HTTP_PORT:-8099}:8080"
      - "${WEAVIATE_GRPC_PORT:-50099}:50051"
    volumes:
      - weaviate_131_data:/var/lib/weaviate
    restart: on-failure:0
    environment:
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
      ENABLE_MODULES: 'text2vec-transformers'
      TRANSFORMERS_INFERENCE_API: 'http://multilingual-e5-transformers:8080'
      CLUSTER_HOSTNAME: 'node1'
    depends_on:
      - multilingual-e5-transformers

  multilingual-e5-transformers:
    build:
      context: .
      dockerfile: multilingual-e5-large.Dockerfile
    image: multilingual-e5-large-inference
    networks:
      - mema_docker_compose_weaviate_net
    ports:
      - "${TRANSFORMER_PORT:-8092}:8080"
    environment:
      ENABLE_CUDA: '0'
    restart: on-failure:0

volumes:
  weaviate_131_data:

networks:
  mema_docker_compose_weaviate_net:
    external: true

```

---

<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:** [June 27, 2025, 1:12pm UTC](https://forum.weaviate.io/t/normalizing-a-vector-when-using-weaviate-with-a-text2vec-transformers/21533/2 "2025-06-27T13:12:10Z")

</div>

Ciao amico @rjalex !!! Long time no see!

This is a hard one that I do not have the answer 🙂

I will raise this to our team.

Just to confirm, you referring to this endpoint here, right?

> <https://github.com/weaviate/t2v-transformers-models/blob/929a804e0eff3db35e1e761b172649eef8171ab5/app.py#L190>

Thanks!

---

<div class="post-metadata">

**Author:** ![rjalex](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rjalex/32/807_2.png) [@rjalex](https://forum.weaviate.io/u/rjalex)\
**Post date:** [June 27, 2025, 2:05pm UTC](https://forum.weaviate.io/t/normalizing-a-vector-when-using-weaviate-with-a-text2vec-transformers/21533/3 "2025-06-27T14:05:50Z")

</div>

Hi Duda,  
I was almost going to call you Saint Duda since you always help me a lot but then remembered that to be a Saint the prerequisite is that you should be dead 🙂 🙂 🙂

Yes I am using the /vectors endpoint.

What I really hope is that the container dedicated to e5-multilingual does the required normalisation.

Will keep tuned to have a confirmation.

Muito obrigado  
Bob
