[GH-ISSUE #11213] Add support for custom vector dimensions in embedding #69445

Closed
opened 2026-05-04 18:07:31 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @bgeneto on GitHub (Jun 26, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11213

New embedding models like Qwen3 Embedding (e.g. Qwen3-Embedding-8B) has "MRL Support", meaning one can configure the vector dimension for the final embedding. The 8B model, for example, has a default dimension of 4096. This, unfortunately, implies that it cannot be used with pgvector from Postgres, unless Ollama adds a new dimensions parameter (like DeepInfra) for supporting changing the default model dimension. An example usage of this parameter is here.

Originally created by @bgeneto on GitHub (Jun 26, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11213 New embedding models like [Qwen3 Embedding](https://qwenlm.github.io/blog/qwen3-embedding/) (e.g. [Qwen3-Embedding-8B](https://huggingface.co/Qwen/Qwen3-Embedding-8B)) has "MRL Support", meaning one can configure the vector dimension for the final embedding. The 8B model, for example, has a default dimension of 4096. This, unfortunately, implies that it cannot be used with pgvector from Postgres, unless Ollama adds a new `dimensions` parameter (like [DeepInfra](https://deepinfra.com/Qwen/Qwen3-Embedding-4B/api?example=http)) for supporting changing the default model dimension. An example usage of this parameter is [here](https://github.com/QwenLM/Qwen3-Embedding/blob/main/examples/qwen3_embedding_transformers.py).
GiteaMirror added the feature request label 2026-05-04 18:07:31 -05:00
Author
Owner

@drifkin commented on GitHub (Jun 27, 2025):

for MRL models I believe you should be able to manually truncate (at the trained boundaries) and normalize, though that's a bit annoying to do. But a workaround in the meantime

<!-- gh-comment-id:3014645924 --> @drifkin commented on GitHub (Jun 27, 2025): for MRL models I believe you should be able to manually truncate (at the trained boundaries) and normalize, though that's a bit annoying to do. But a workaround in the meantime
Author
Owner

@rick-github commented on GitHub (Sep 17, 2025):

#12242

<!-- gh-comment-id:3302617029 --> @rick-github commented on GitHub (Sep 17, 2025): #12242
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69445