feat(memory-lancedb): support custom OpenAI-compatible embedding providers#20771
Closed
marcodelpin wants to merge 1 commit intoopenclaw:mainfrom
Closed
feat(memory-lancedb): support custom OpenAI-compatible embedding providers#20771marcodelpin wants to merge 1 commit intoopenclaw:mainfrom
marcodelpin wants to merge 1 commit intoopenclaw:mainfrom
Conversation
e521dc2 to
285fa49
Compare
Author
|
CI note: The |
This was referenced Feb 19, 2026
Add baseUrl and dimensions config options to the memory-lancedb plugin, enabling use of any OpenAI-compatible embedding API (Ollama, LM Studio, vLLM, etc.) with custom models. Changes: - Add embedding.baseUrl config for custom API endpoints - Add embedding.dimensions config for non-built-in models - Pass baseUrl through to OpenAI client constructor (fixes openclaw#8118) - Remove hardcoded model enum from plugin JSON schema - Update vectorDimsForModel to accept config-provided dimensions - Add 3 new tests for custom embedding configuration Closes openclaw#8118 Ref openclaw#17564
70dd38f to
6042c70
Compare
|
this would also enable us to use azure openai / foundry deployments for embedding models, right? |
Author
|
Yes, this covers Azure OpenAI and Foundry deployments as well — the |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
baseUrlanddimensionsconfiguration to thememory-lancedbplugin, enabling use of any OpenAI-compatible embedding endpoint instead of being locked to OpenAI's API.This allows users to run memory embeddings with:
http://localhost:11434/v1)Changes
config.tsbaseUrl?: stringanddimensions?: numbertoMemoryConfig.embeddingtypevectorDimsForModel()now accepts optionalconfigDimensionsfallback — unknown models work when dimensions are specified in configparse()passes throughbaseUrlanddimensionsto the returned config (previously these were silently dropped)assertAllowedKeysto accept the new fieldsuiHintsforbaseUrlanddimensions(marked asadvanced)index.tsEmbeddingsconstructor accepts optionalbaseUrland passes it tonew OpenAI({ apiKey, baseURL })register()passescfg.embedding.baseUrlandcfg.embedding.dimensionsthrough to the relevant constructorsopenclaw.plugin.jsonenumrestriction on embedding model — any string is now acceptedbaseUrlanddimensionsproperties to the JSON schema with descriptionsuiHintslabels/help textindex.test.tsbaseUrl+dimensionsconfig is accepteddimensionsdimensionsthrows a helpful errorExample Configuration
Backwards Compatibility
baseUrl/dimensionswork exactly as beforetext-embedding-3-small,text-embedding-3-large) don't needdimensionsbaseUrldefaults to OpenAI's endpoint when not specifiedTest plan
Closes #8118
Closes #17564
🤖 Generated with Claude Code
Testing: fully tested (automated + manual verification)
I understand and can explain all changes in this PR.
Greptile Summary
Adds support for custom OpenAI-compatible embedding providers (Ollama, LM Studio, vLLM) by introducing
baseUrlanddimensionsconfiguration options. The implementation correctly handles backwards compatibility, validates unknown models require explicit dimensions, and passes configuration through all layers (schema → parser → constructor). Three new tests cover the key scenarios: custom providers with dimensions, known models without dimensions, and proper error handling for unknown models without dimensions.Confidence Score: 5/5
Last reviewed commit: 0f4059b