continue
continue copied to clipboard
Fix: Prioritize user-defined embed models over Transformers.js built-in
Description
When defining an embed model with roles: [embed] in the YAML config file, the extension defaults to using the built-in Transformers.js embedder instead of the user-defined model. This PR fixes this issue by ensuring user-configured embed models in config.yaml are prioritized over the built-in Transformers.js model.
Changes Made
- Updated
core/config/yaml/loadYaml.tsto:- Only add the Transformers.js embedder when no other embed models exist
- Explicitly initialize the selected embed model to prioritize non-Transformers.js models
- Enhanced
core/config/selectedModels.tsto prioritize non-Transformers.js models when selecting the initial embed model
Testing
I've tested these changes with a custom OpenAI-compatible embed model defined in config.yaml with roles: [embed], and confirmed that:
- The custom model is now automatically selected on startup
- The built-in Transformers.js model is still available as a fallback
- The changes don't affect other model roles
Checklist
- [x] I've read the contributing guide
- [x] The relevant docs, if any, have been updated or created
- [x] The relevant tests, if any, have been updated or created
Deploy Preview for continuedev canceled.
| Name | Link |
|---|---|
| Latest commit | 18bc7a55482cbeb07662d5c868c04652dae67b66 |
| Latest deploy log | https://app.netlify.com/sites/continuedev/deploys/681b49777f73ce000800cb88 |
Nice find! I want to make sure we are able to test this, but I also understand that the work required to do that would probably blow up the scope of this PR. I'm going to make an attempt at doing this before merging
✨ No issues found! Your code is sparkling clean! ✨
Does this still need merging? @sestinj
looking back at this I realistically don't think it's something we want to change given the amount of feedback we've gotten about this particular ability versus the critical path that it would be updating. we may be able to circle back to this later but especially given the decreased prevalence of embeddings vs. agentic search it doesn't feel high on our priority list. as always open to further feedback if you have it