Commit graph

464 commits

Author SHA1 Message Date
91d2ed9170 modified: index.html 2025-09-09 08:49:28 -04:00
04b49530b6 fix mobile zoom issue - remove overflow-x hidden and improve viewport constraints 2025-09-06 19:50:23 -04:00
3ac6386234 modified: css/sidebar-theme.css 2025-09-01 18:58:59 -04:00
35193b1c09 modified: css/sidebar-theme.css 2025-09-01 18:43:52 -04:00
17a19d53ea new file: css/sidebar-theme.css
modified:   index.html
2025-09-01 18:41:48 -04:00
88dece974a remove 2000 token hard cap for introduction messages - allow full model completion limits 2025-07-28 10:49:29 -04:00
eff2eee69b create centralized Groq TPM rate limit handling for all requests
- new groq-fetch.js provides groqAwareStreamingFetch for all API calls
- automatically detects Groq endpoints and handles TPM rate limits
- works for chat, translation, TTS - any request to Groq
- waits 60 seconds for TPM window reset, retries up to 3 times
- other platforms (Hermes, OpenAI, etc.) unaffected
- cleaner abstraction replaces inline retry logic in chat.js
2025-07-12 13:50:01 -04:00
bd10045c4a make TPM rate limit retry Groq-specific only - other platforms use normal error handling 2025-07-12 13:45:36 -04:00
6335b651e6 implement Groq TPM rate limit handling - wait 60s for token budget reset 2025-07-12 13:44:36 -04:00
04fa0fb05f remove artificial response caps - let models use their full completion token limits 2025-07-12 13:32:56 -04:00
471d61176d allow chat responses to use full available space for coherent answers - cap at 4096 tokens max 2025-07-12 13:31:39 -04:00
8467f58d6b optimize chat token allocation for maximum input/output space
- replace aggressive 1.5x buffer with smart model-based allocation
- 128k+ models: only 2k buffer (was wasting 10k+ tokens)
- 32k models: 1.5k buffer max
- 8k models: conservative buffer
- follow-up responses now have maximum room for both history and output
- especially important for long conversations on large context models
2025-07-12 13:29:58 -04:00
539121a165 increase intro generation tokens to prevent cutoffs - min 500, max 2000 2025-07-12 13:28:13 -04:00
c014adde73 fix intro generation getting cut off by being more generous with output tokens
- reduce aggressive buffering that was leaving too little room for intro output
- reserve up to 1000 tokens or 30% of model capacity for intro generation
- increase minimum output tokens from 100 to 200
- should fix truncated intros especially on Groq models with 8K completion limits
2025-07-12 13:27:08 -04:00
6645061372 make active tab even lighter green - very subtle background with dark green text 2025-07-12 11:46:00 -04:00
5198805155 replace blue active tab with lighter green - much better visual harmony 2025-07-12 11:42:04 -04:00
97af1d9b1a change tab colors from green to blue/gray to reduce visual competition
- tabs now use neutral gray (inactive) and blue (active) instead of green
- prevents distraction from green translate button (call-to-action)
- inactive tabs: light gray background with dark gray text
- active tab: blue background with white text
- hover: slightly darker gray
- updated both builtin and pico CSS versions
2025-07-12 11:37:22 -04:00
3bd518ff20 adjust progress timing: keep Hermes as default, speed up for Groq only 2025-07-12 11:26:05 -04:00
34e5e25bfb replace URL constructor with regex validation for remote URLs
- URL constructor was too strict and failing on valid domains
- new regex pattern validates common URL formats more permissively
- ensures scheme prepending works in both main logic and fetchRemotePageHTML
- fixes issues with domains like www.inrupt.com
2025-07-12 11:13:40 -04:00
c4c216316f auto-add https:// scheme to remote URLs when missing 2025-07-12 11:06:53 -04:00
e6e7a77fa3 use selected model name in translation progress messages
- replace hardcoded "Hermes AI" with actual selected model
- progress now shows "Translating with <model-name>..."
- makes progress messages accurate for all model selections
2025-07-12 11:03:43 -04:00
79377af49a switch tab order: remote URL tab now comes before custom text tab 2025-07-12 11:02:27 -04:00
e87e27b2a2 show both English and native language names in translation dropdown 2025-07-12 11:01:00 -04:00
7851c5747c fix remote URL input height - make it single line instead of textarea height 2025-07-12 08:35:18 -04:00
4c75f7cd6e fix chat and ui max_tokens errors with Groq models
- cap all max_tokens to model's max completion tokens limit
- fixes sendMessageWithCustomHistory in chat.js
- fixes intro generation in ui.js
- fixes TTS processing token calculation
- prevents "max_tokens must be less than or equal to 8192" errors
2025-07-12 07:51:31 -04:00
337f9970a8 improve translation prompt to prevent explanatory text prefixes 2025-07-12 07:40:38 -04:00
41ba59db1b use API-provided max completion tokens instead of hardcoding
Fetch and store maxCompletionTokens from models endpoint to respect
each model's specific output limits. This fixes 400 errors from
Groq models that have different completion limits than context windows.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 07:36:31 -04:00
a864366c80 add hardcoded context windows for Groq models 2025-07-12 07:28:13 -04:00
fd71442331 remove chunking complexity, use simple fit-or-error approach 2025-07-12 07:19:00 -04:00
50a0487bcd fix chunking to work directly with body children and handle edge cases 2025-07-12 07:14:51 -04:00
d4aa30e454 implement sibling-level chunking to prevent DOM duplication 2025-07-12 07:10:14 -04:00
e2c211b9c6 add chunk content debugging to identify duplication source 2025-07-11 22:10:46 -04:00
60743c5bfb add better error logging for fragment translation debugging 2025-07-11 22:04:44 -04:00
b7563d0f2b create separate translation functions for full pages vs fragments 2025-07-11 22:00:07 -04:00
e975e97ea3 fix chunk reassembly stacking and increase batch size for speed 2025-07-11 21:54:54 -04:00
a8a4359e96 auto-detect and cache endpoints without tokenization support
When upstream tokenization fails (404, errors), cache the endpoint
and automatically use JS tokenizer for future requests. This fixes
chunking for APIs like Groq that don't have tokenize endpoints.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 21:52:24 -04:00
e50b0b8118 improve token allocation for chunked translations
Changed from broken buffer calculation to 40% output reserve which gives
individual chunks much more room for translation output. Reverted
preservation mode changes to keep original behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 21:47:06 -04:00
8dbf607c03 fix duplicate const declaration of getSelectedModel
Consolidated duplicate imports in translate-modal.js that were causing
SyntaxError: redeclaration of const getSelectedModel.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 21:42:46 -04:00
04f0ac766b fix token buffer calculation causing chunking to fail
Previous buffer calculation used 1.5x input tokens which exceeded model
context window for large content. Changed to fixed 1000 token reserve
and improved chunk sizing to use reasonable portions of model capacity.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 21:38:47 -04:00
7b34e60f63 fix getSelectedModelMaxTokens import in progress calculation 2025-07-11 21:23:51 -04:00
854d22ee79 fix progress calculation to show actual tokens including preservation and chunking 2025-07-11 21:21:58 -04:00
cfc6dec1f4 remove unnecessary preservation in progress calculation that was creating placeholder confusion 2025-07-11 21:18:59 -04:00
a7dddf24d8 fix small model cutoffs by accounting for translation output expansion in chunking logic 2025-07-11 21:02:23 -04:00
a43714f82d fix tab content visibility and add proper styling to URL input 2025-07-11 20:59:43 -04:00
9550fb8e94 re-enable relative to absolute URL conversion for remote translations 2025-07-11 20:54:56 -04:00
e0a784c073 fix remote translation double processing by calling translateHTML directly 2025-07-11 20:53:54 -04:00
004764a05b add translation ID tracking to debug repeated page issues 2025-07-11 20:50:07 -04:00
84b06202dd fix countTokens returning object instead of number causing incorrect chunking 2025-07-11 20:48:40 -04:00
af6108e988 add debug logging to see why chunking is being triggered when it shouldn't 2025-07-11 20:46:44 -04:00
f476b6e476 disable URL conversion during chunking and add debug logging for chunk content 2025-07-11 20:43:09 -04:00