Skip to content

Conversation

@viacheslav-dobrynin
Copy link
Contributor

Context
super.dimensions() calls the embedding model API to know actual dimensions number even if model exists in KNOWN_EMBEDDING_DIMENSIONS map.
This leads to unnecessary expenses and problems during testing.

Solutions

  1. Compute dimensions number lazily.
  2. Cache results (questionable, can change to if res != null res else compute())

Signed-off-by: Viacheslav Dobrynin <w.v.dobr@gmail.com>
@viacheslav-dobrynin viacheslav-dobrynin changed the title fix: use lazy load for unknown embedding dimensions and cache results [minor-fix, one line change] use lazy load for unknown embedding dimensions and cache results Nov 5, 2025
@viacheslav-dobrynin viacheslav-dobrynin changed the title [minor-fix, one line change] use lazy load for unknown embedding dimensions and cache results [minor-fix, google genai] use lazy load for unknown embedding dimensions and cache results Nov 5, 2025
@ilayaperumalg ilayaperumalg self-assigned this Nov 5, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.0.RC1 milestone Nov 5, 2025
@ilayaperumalg
Copy link
Member

LGTM, rebased and merged as a8b3982

@viacheslav-dobrynin viacheslav-dobrynin deleted the lazy_load_dims branch November 5, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants