Les nœuds vectoriels stockent une mauvaise dimension - toujours 192

Describe the problem/error/question

For some reason n8n-vector store nodes always return vectors in 192 dimension to the vector-database.
The emebedding models I tried should return 768 vectors according to their datasheet and do so if I call them via terminal or http-node with some test input.
So the model, and LM-Studio as hosting framework, dont seem to be the problem.
I also explicitly checked with chroma and qdrant that they allow for 768 collections if i set them manually.
For my understanding there seems to be an issue with either the Vector store nodes or with the openai embedding tool node.

Tested Nodes:

  • Chroma Vector Store
  • Qdrant Vector Store
  • Simple Vector Store

Tested Embedding Models:

  • text-embedding-embeddinggemma-300m-qat
  • text-embedding-jina-embeddings-v2-base-de
  • text-embedding-granite-embedding-278m-shindy-multilingual
  • text-embedding-nomic-embed-text-v2-moe

What is the error message (if any)?

  • No error message

Please share your workflow

Workflow Returning wrong 192 vectors:

Working HTTP Request => returns 768 dimensioned vectors

Additional:

If I manually setup a 768 DB via qdrant UI an error is raised that the vector settings are not matching:

I can not manually set the embedding node to 768 it’s not available

I called manually via terminal 768 vectors are returned, to the model works fine

Information on your n8n setup

Selfhosted as LXC Container via Proxmox

  • 2.17.8:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (v1):
  • Running n8n via (LXC, npm):
  • Alpine/Linux:

Hi @swdit

The problem is that you’re using the Embeddings OpenAI node pointed at LM-Studio. That node is built around OpenAI’s embedding models and their specific dimension values (256, 512, 1024, 1536, 3072), which is why 768 isn’t in the dropdown. Somewhere in the node’s processing pipeline, your 768-dimension vectors are being truncated to 192 (which is exactly 768/4, so it’s likely not random).

Two things to try:

  1. Use the Embeddings Ollama node instead if your LM-Studio instance exposes an Ollama-compatible API, or check if there’s an LM-Studio community node that handles non-OpenAI embedding dimensions properly.

  2. As a workaround, try setting the Dimensions option explicitly in the Embeddings OpenAI node. Even though 768 isn’t in the dropdown, switch the field to Expression mode and type 768 manually. The dropdown is just a UI convenience for OpenAI’s standard values, but the underlying API parameter might accept arbitrary numbers.

If the expression workaround doesn’t work, this is worth filing as a GitHub issue. The Embeddings OpenAI node is commonly used with OpenAI-compatible backends (LM-Studio, Ollama, vLLM, etc.) and should pass through whatever dimension the model actually returns rather than forcing OpenAI-specific values.

Could you test the expression approach and let me know?

bonjour @houda_ben

merci pour ton aide géniale - j’ai vérifié tes idées :
Pour l’instant :

  • Le nœud Ollama n’est pas compatible avec LM-Studio.

  • La tentative d’expression ne fonctionne pas.
    Il ne semble pas possible de définir des nombres arbitraires dans le nœud d’intégration OpenAI.

  • Je suis actuellement en train de configurer un serveur Ollama en parallèle pour pouvoir utiliser le nœud Ollama.

@swdit merci d’avoir testé les deux,

Je te recommande de signaler un problème sur GitHub pour cela. Le nœud Embeddings OpenAI est largement utilisé avec des backends compatibles OpenAI (LM-Studio, vLLM, LocalAI, etc.) et devrait soit utiliser les dimensions natives du modèle, soit permettre des valeurs arbitraires dans le champ Dimensions. Tes captures d’écran et tes résultats de test constituent un bon cas de reproduction.

:crossed_fingers:

Confirmé : le nœud OpenAI Embeddings ne convient pas ici s’il ne peut pas accepter des dimensions arbitraires comme 768.

Mettre en place Ollama en parallèle est probablement la solution la plus propre si vous voulez rester dans les nœuds AI/vector-store de n8n.

Une autre solution de contournement, si vous voulez conserver LM Studio :

Au lieu d’utiliser le nœud Embeddings OpenAI, appelez LM Studio directement avec un nœud HTTP Request, puisque vous avez déjà confirmé qu’il retourne des vecteurs de 768 dimensions. Ensuite, soit :

  1. envoyez les vecteurs à Qdrant via l’API REST de Qdrant en utilisant des nœuds HTTP Request, ou
  2. utilisez un nœud Code pour reformater la réponse au format attendu par le nœud suivant.

Le besoin clé est :

  • Sortie d’embedding LM Studio : 768 dimensions
  • Taille du vecteur de la collection Qdrant : 768
  • Nœud n8n transmettant le vecteur complet sans le modifier

Si un nœud intermédiaire suppose des dimensions OpenAI ou transforme le vecteur, Qdrant le rejettera.

Aussi, lors des tests, assurez-vous que la collection Qdrant est recréée après modification de la taille du vecteur. Qdrant ne permettra pas à une collection existante de passer de 192 à 768 dimensions.

Donc oui, le nœud Ollama est probablement la solution de contournement native n8n la plus facile, mais la route HTTP Request → LM Studio → Qdrant REST devrait également fonctionner et évite complètement la limitation du nœud OpenAI.

J’ai maintenant configuré un serveur ollama en fonctionnement et cela marche, les résultats d’embedding sont conformes aux attentes.

Je vais contacter LM-Studio et n8n et leur recommander de corriger cela ou au moins de générer une erreur.