The /v3/embeddings endpoint currently doesn't support the dimensions parameter from the OpenAI API.
Many modern embedding models (like ibm-granite/granite-embedding-311m-multilingual-r2, nomic-embed-text, text-embedding-3-small) support Matryoshka Representation Learning, which allows truncating embeddings to smaller dimensions without retraining.
Request
Add support for the dimensions parameter in EmbeddingsCalculatorOV to truncate and re-normalize the output embeddings.
Example request
{
"model": "my-embedding-model",
"input": "Hello world",
"dimensions": 256
}
Expected behavior
Return embeddings truncated to 256 dimensions (instead of full 768), re-normalized.
References
The
/v3/embeddingsendpoint currently doesn't support thedimensionsparameter from the OpenAI API.Many modern embedding models (like
ibm-granite/granite-embedding-311m-multilingual-r2,nomic-embed-text,text-embedding-3-small) support Matryoshka Representation Learning, which allows truncating embeddings to smaller dimensions without retraining.Request
Add support for the
dimensionsparameter inEmbeddingsCalculatorOVto truncate and re-normalize the output embeddings.Example request
{ "model": "my-embedding-model", "input": "Hello world", "dimensions": 256 }Expected behavior
Return embeddings truncated to 256 dimensions (instead of full 768), re-normalized.
References