jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.53k stars 294 forks source link

Adding Ollama and other LLMs support #765

Open Haze-sh opened 3 months ago

Haze-sh commented 3 months ago

I would like to have autotagging with LLM support, firstly we should have Ollama support for offline tagging and for privacy reasons and we could add other services too, I think I can work on this.

I don't know how does tagging currently works, it seems inconsistent and I can't find a way to retag my whole database, Is there is a way for that so we can start from this point?

LeXofLeviafan commented 3 months ago

That sounds like a somewhat heavy feature, and possibly obscure / heavy on personal preference…

I've been thinking of implementing a plugin API as part of upcoming customization functionality; perhaps using that would be a better approach instead?

Haze-sh commented 3 months ago

Could be heavy or not, dependable how it would be implemented. It could be something like if ollama exists -> then add tags and this could be built-in if it doesn't affect the performance or as a python script (likely would need langchain).

LeXofLeviafan commented 2 months ago

For the time being, you can try implementing an external Python script that uses buku as a library. Bukuserver seems to manage doing that well enough, so going over the existing records and updating data when necessary should not pose much of a challenge. (Alternatively you can check unit tests – they should work alright as usage examples.)