fix: improvement to ollama component to allow for dynamic filtering based on model capabilities
Refactored src/backend/base/langflow/components/models/ollama.py to avoid hardcoding model name patterns when filtering out embedding models.
The previous implementation relied on name-based heuristics to exclude embedding models from the list of available models. This approach has been replaced with a more robust solution that uses the Ollama REST API (/api/show) to dynamically inspect each model’s capabilities and exclude those with "embedding" listed.
This makes the logic more maintainable and resilient to future changes in model naming.
Single file/method changed
https://github.com/pedrocassalpacheco/langflow/blob/75bbced249b67b1b40d732182e7e507ec157a8cc/src/backend/base/langflow/components/models/ollama.py
@ogabrielluiz or @italojohnny or @edwinjosechittilappilly - please review.
@edwinjosechittilappilly - thanks for the review. I modified the filter, but moving constants to a global is not a good approach, as per my comments.
Looks Good Please do not remove the package lock.json
Changes to package lock reverted.
@pedrocassalpacheco can you fix the tests in the PR?
@pedrocassalpacheco I am waiting for the bug fixes to be merged. Also, since QA is in Progress, I suggest we keep this PR for the Next/follow-up release.