-
Notifications
You must be signed in to change notification settings - Fork 501
feat: AI auto-tagging #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: AI auto-tagging #1232
Conversation
|
This is awesome. Lgtm, hopefully this will get merged soon. |
|
@sissbruecker we are waiting for this |
|
@7jrxt42BxFZo4iAnN4CX sadly this is only a single OpenAI, not a self-hosted Ollama or other AI-APIs solution… The difference is not so bad but should be carefully thought of – my2ct |
|
@Eragos Then expand to any OpenAI compatible ones? I'd like an open router. |
I’m already working on Ollama integration, I was just waiting for this PR to be merged first and to check whether there were any blockers |
|
@emanuelebeffa Great news, that would be great. |
|
I almost finished Ollama integration, I’ll be reopening the PR soon |
Review SummaryThanks for this feature! The implementation is well-structured with good test coverage. I found a few issues worth addressing before merge. 🔴 CriticalBulk "Refresh AI tags" doesn't work for bookmarks with existing tags The documentation states:
However, if bookmark.tags.exists():
logger.info(f"Skipping AI tagging - bookmark {bookmark_id} already has tags")
returnSuggested fix: Add a def auto_tag_bookmark(user: User, bookmark: Bookmark, force: bool = False):
# ...
_auto_tag_bookmark_task(bookmark.id, user.id, force)
@task()
def _auto_tag_bookmark_task(bookmark_id: int, user_id: int, force: bool = False):
if bookmark.tags.exists() and not force:
return
# ...Then in 🟠 Important1. API key exposed in API response
Suggested fix: ai_api_key = serializers.CharField(write_only=True, required=False, allow_blank=True)2. No rate limiting for bulk AI operations Selecting many bookmarks for bulk refresh could trigger hundreds of API calls, potentially exceeding provider rate limits or incurring unexpected costs. Suggestion: Consider adding a limit or at least a warning in the UI. 🟡 Minor / Nice-to-have
Overall, great work! The Pydantic structured outputs, error handling with retry logic for 5xx errors, and hallucination filtering are all well done. 👍 |
|
Thanks for the review! I've pushed fixes for |
|
Looks great! I've reviewed the latest changes, and they successfully address all the previous points. The implementation looks solid and ready to go. |
Adds AI-powered auto-tagging functionality using OpenAI compatible APIs. Users can configure their API key, model, base URL and define a vocabulary of allowed tags, then use the "Refresh AI tags" action to automatically generate tag suggestions for their bookmarks based on content (URL, title, description).
The feature includes:
Estimated cost analysis
Using OpenAI's gpt-5-nano model at $0.05 per 1M input tokens and $0.4 per 1M output tokens:
Average cost per bookmark: ~$0.000043
Input: ~250 tokens
Cost: $0,0000125
Output: ~100 tokens
Cost: $0.00004
Possible future evolution