LibreChat Shortcuts + Token Counter

Press Alt+S to click toggle-left-nav button on localhost:3080

Auteur
Brian Hurd
Installations quotidiennes
0
Installations (total)
0
Notes
0 0 0
Version
1.9.2
Créé
28/03/2025
Mis à jour
31/03/2025
Taille
15,6 ko
Licence
N/A
S'applique à

This has 2 iife. If part of it annoys you, delete the functionality you don't like. Each iife has a large comment section divider so it's easy to delete. Search for #1 or #2

1st iife: Keyboard shortcuts
2nd iife: show token usage and calculate based on 4o pricing ($2.50 input per million, $10 output per million, search for 2.50 to change the cost)

This provides some simple keyboard shortcuts for libreChat to scroll, toggle the sidebar, and start a new conversation. More to come. Keyboard shortcut keys below. This uses the free GSAP utilities for smooth scrolling behavior.

Depending on how you installed LibreChat, you may need to update this line:
// @match http://localhost:3080/*

// === Shortcut Keybindings ===
// Alt+S → Toggle sidebar (clicks #toggle-left-nav)
// Alt+N → New chat (clicks button[aria-label="New chat"])
// Alt+T → Scroll to top of message container
// Alt+Z → Scroll to bottom of message container
// Alt+A → Scroll up one message (.message-render)
// Alt+F → Scroll down one message (.message-render)

// Alt+r → refresh token count and conversation cost
// Alt+u → update the token cost per million to use based on the model