Skip to content

Optimize MistralAiEmbeddingModel dimensions method#4810

Open
nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
nicolaskrier:optimize-mistral-ai-embedding-model-dimensions-method
Open

Optimize MistralAiEmbeddingModel dimensions method#4810
nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
nicolaskrier:optimize-mistral-ai-embedding-model-dimensions-method

Conversation

@nicolaskrier
Copy link
Copy Markdown
Contributor

@nicolaskrier nicolaskrier commented Nov 5, 2025

  • Calculate and cache values for unknown models only if necessary
  • Make known embedding dimensions a mutable map attribute
  • Verify the cache mechanism with MistralAiEmbeddingModelTests

@nicolaskrier
Copy link
Copy Markdown
Contributor Author

nicolaskrier commented Nov 5, 2025

Hi @ilayaperumalg, could you have a look on this one? I have been inspired by this commit for this PR.
Thank you.

@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from 7320cb0 to 62c4738 Compare November 6, 2025 20:00
1536);

private static final EmbeddingModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultEmbeddingModelObservationConvention();
private final Map<String, Integer> knownEmbeddingDimensions = createKnownEmbeddingDimensions();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit concerned about making a class constant mutable that is why I have decided to make it an attribute.

@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch 5 times, most recently from 09f86fa to e2ac527 Compare November 13, 2025 18:56
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from e2ac527 to 1eb5b68 Compare November 19, 2025 22:52
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch 2 times, most recently from 1266356 to 3d06d20 Compare December 10, 2025 21:29
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from 3d06d20 to 282f3fb Compare December 14, 2025 15:34
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from 282f3fb to 8a3b820 Compare December 29, 2025 09:54
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from 8a3b820 to c01391d Compare January 22, 2026 20:16
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from c01391d to 3f7f0db Compare March 7, 2026 13:16
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch 2 times, most recently from 0602411 to 5de4a49 Compare March 21, 2026 15:14
- Calculate and cache values for unknown models only if necessary
- Make known embedding dimensions a mutable map attribute
- Verify the cache mechanism with MistralAiEmbeddingModelTests

Signed-off-by: Nicolas Krier <7557886+nicolaskrier@users.noreply.github.com>
@nicolaskrier nicolaskrier force-pushed the optimize-mistral-ai-embedding-model-dimensions-method branch from 5de4a49 to c89e6f3 Compare April 18, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants