rcgit

/ karakeep
follow (on) | order: default date topo
Age Commit message Author Files +/-
fix: more tagging tweaks Mohamed Bassem 1 -4/+3
fix: change prompt to better recognize error pages Mohamed Bassem 1 -3/+6
feat: add customizable tag styles (#2312)
* feat: add customizable tag styles
* add tag lang setting
* ui settings cleanup
* fix migration
* change look of the field
* more fixes
* fix tests
Mohamed Bassem 18 -136/+3895
fix: lazy load js-tiktoken in prompts module (#2176)
* feat: lazy load tiktoken to reduce memory footprint
The js-tiktoken module loads a large encoding dictionary into memory
immediately on import. This change defers the loading of the encoding
until it's actually needed by using a lazy getter pattern.
This reduces memory usage for processes that import this module but
don't actually use the token encoding functions.
* fix: use createRequire for lazy tiktoken import in ES module
The previous implementation used bare require() which fails at runtime
in ES modules (ReferenceError: require is not defined). This fixes it
by using createRequire from Node's 'module' package, which creates a
require function that works in ES module contexts.
* refactor: convert tiktoken lazy loading to async dynamic imports
Changed from createRequire to async import() for lazy loading tiktoken,
making buildTextPrompt and buildSummaryPrompt async. This is cleaner for
ES modules and properly defers the large tiktoken encoding data until
it's actually needed.
Updated all callers to await these async functions:
- packages/trpc/routers/bookmarks.ts
- apps/workers/workers/inference/tagging.ts
- apps/workers/workers/inference/summarize.ts
- apps/web/components/settings/AISettings.tsx (converted to useEffect)
* feat: add untruncated prompt builders for UI previews
Added buildTextPromptUntruncated and buildSummaryPromptUntruncated
functions that don't require token counting or truncation. These are
synchronous and don't load tiktoken, making them perfect for UI
previews where exact token limits aren't needed.
Updated AISettings.tsx to use these untruncated versions, eliminating
the need for useEffect/useState and avoiding unnecessary tiktoken
loading in the browser.
* fix
* fix
---------
Co-authored-by: Claude <noreply@anthropic.com>
Mohamed Bassem 5 -37/+110
fix(inferance): skip token slicing when content is already witin max length Mohamed Bassem 1 -0/+3
fix: Correct grammatical errors in prompts (#2020)
Corrected "who's" to "whose" in buildImagePrompt and buildTextPrompt.
atsggx 1 -2/+2
fix: minor changes to the tagging prompts (#1474)
* feat: add optional `thinking` key to tagging response schema
* prompt: fix indent
* prompt: remove extra 'language' word
* prompt: use xml as separator
* revert: dont use a thinking tags
Signed-off-by: thiswillbeyourgithub
<26625900+thiswillbeyourgithub@users.noreply.github.com>
* prompt: don't ask to include website tags
* prompt: aim for 5 tags
* prompt: dont tell bot its a bot
* prompt: propose a tag_error
* Revert "prompt: propose a tag_error"
This reverts commit 78c5099a187960cc3697b77f2b2bd687edb015f3.
* minor prompt tweaks
* minor prompt tweaks take 2
---------
Signed-off-by: thiswillbeyourgithub
Co-authored-by: Mohamed Bassem <me@mbassem.com>
Olicorne 1 -10/+11
fix: Collapse long runs of repeated whitespaces before tokenization to avoid… Mohamed Bassem 1 -0/+9
fix: Use proper tokenizer when truncating for inference. Fixes #1405 Mohamed Bassem 3 -8/+21
feat: Support customizing the summarization prompt. Fixes #731 Mohamed Bassem 10 -16/+1649
fix: Instruct the model to only respond with the summary when summarizing… Mohamed Bassem 1 -1/+1
feature: Add a summarize with AI button for links Mohamed Bassem 12 -11/+1536
feature: Allow customizing the inference's context length MohamedBassem 9 -36/+51
feature(web): Add the ability to customize the inference prompts. Fixes #170 MohamedBassem 13 -39/+1764