lms icon indicating copy to clipboard operation
lms copied to clipboard

Text embedding models does not support `dimensions`

Open cusxio opened this issue 4 months ago • 1 comments

https://platform.openai.com/docs/api-reference/embeddings/create#embeddings_create-dimensions

The OpenAI API supports dimensions to customize the embeddings output, and models such as Qwen3, do support custom dimensions.

Adding support for it would be helpful.

const lmstudio = createOpenAICompatible({
  name: 'openai-compatible',
  baseURL: 'http://localhost:1234/v1',
})

const { embeddings } = await embedMany({
  providerOptions: {
    'openai-compatible': {
      dimensions: 1024,
    },
  },
  model: lmstudio.textEmbeddingModel('Qwen/Qwen3-Embedding-8B'),
  values: texts,
})

// Results in embeddings.length === 4096

cusxio avatar Aug 22 '25 01:08 cusxio

new around these parts but shouldn't this be reported in https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues? seeing as the API lives in the app

CinnamonRolls1 avatar Aug 25 '25 22:08 CinnamonRolls1