Project Files
PROJECT_SUMMARY.md
Troglodyte is an LM Studio plugin that compresses user prompts before they reach the LLM by removing polite filler words, redundant phrases, and verbosity โ saving tokens and reducing latency while preserving core meaning.
| Category | Examples |
|---|---|
| Polite fillers | "please", "thank you", "I would appreciate" |
| Redundant phrases | "in order to" โ "to", "due to the fact that" โ "because" |
| Excessive verbosity | "I was wondering if you could" โ "" |
| Articles & pronouns | (Balanced/Aggressive modes) |
Protects critical elements from being modified:
Why PUA?
\uE000โ\uEFFF are reserved for private use| Before | After |
|---|---|
\uE001P1\uE001 = 7+ chars | \uE000 = 2 chars |
| Protection overhead destroyed savings | Compact placeholders preserve savings |
Problem:
Root Cause: Path protection was removed/not implemented.
Fix: Added Windows path protection BEFORE synonym phase:
Problem: Shorter phrases matched before longer ones.
Fix: Sort phrases by length descending:
Problem: out?explain (missing space), Node. js (space in version)
Fix: Smart cleanup chain:
Problem: 'and': '&&' replaced "and" in natural text.
Fix: Commented out all logic symbol replacements โ they belong in code contexts only.
| Metric | Value |
|---|---|
| English Compression (Balanced) | ~30-50% reduction โ |
| German Compression (Balanced) | ~28-45% reduction โ |
| Placeholder Overhead Reduction | 71% less (7+ โ 2 chars) โ |
| Path Protection | Working โ |
| Setting | Options | Default |
|---|---|---|
| Compression Level | Gentle / Balanced / Aggressive | Balanced |
| Protect URLs & Links | On/Off | On |
| Protect Version Numbers & IDs | On/Off | On |
| Protect Markdown Headers | On/Off | On |
| Language Mode | Auto-Detect (EN/DE) / English / German | Auto-Detect |
| Show Statistics in Console | On/Off | On |
'and': '&&' breaks natural languageMIT
Last Updated: May 17, 2026 | TypeScript 6.x Build System Update
`code` and blocks https://..., www....v1.0.0, software names like Node.js## HeaderC:\Source Code\... (protects against synonym corruption)troglodyte/
โโโ src/
โ โโโ index.ts # Entry point
โ โโโ promptPreprocessor.ts # Pipeline orchestrator + system metadata extraction
โ โโโ troglodyte.ts # Compression engine (main logic)
โ โโโ config.ts # UI configuration schematics
โ โโโ dictionaries/
โ โโโ en-filler.ts # English blacklists (gentle/balanced/aggressive)
โ โโโ de-filler.ts # German blacklists
โ โโโ phrases.ts # Multi-word phrase replacements
โ โโโ synonyms.ts # Single-word abbreviations
โโโ dist/ # Compiled output
โโโ package.json
โโโ tsconfig.json
// Before: verbose placeholders like "\uE001P1\uE001" = 7+ chars
const PU = '\uE001';
generatePlaceholder() => `${PU}P${++counter}${PU}`;
// After: compact single-char placeholders = 2 chars
String.fromCodePoint(0xE000 + (counter++ % 0xFFF)); // "\uE000"
C:\Source Code\ServiceMonitor\...
โ synonym replacement
C:\src Code\ServiceMonitor\... โ CORRUPTED!
text = text.replace(/([A-Za-z]:[\/\\][^<>"|?*\r\n]{10,})/g, (match) => {
return protectIfWorthwhile(match, 15);
});
const sortedPhrases = Object.entries(this.phrasesAndLogic)
.sort((a, b) => b[0].length - a[0].length);
text = result
.replace(/\s+/g, ' ') // Collapse spaces
.replace(/\s+([.,?!;:])/g, '$1') // Remove space BEFORE punct
.replace(/([.?!;:])(?=[A-Zรรรร])/g, '$1 ') // Add space AFTER (before CAPITAL)
.trim();
Input: "Hello there! I was wondering if you could possibly help me out?
I would really appreciate it if you could explain how to install
Node.js on Windows step by step. Thank you so much for your time
and assistance!"
Output: "possibly help me out? explain how install Node.js Windows steps.
and assistance."
Ratio: ~65-70% compression โ
Input: "check C:\Source Code\ServiceMonitor:\ServiceMonitor \ for issues."
Output: "check C:\Source Code\ServiceMonitor:\ServiceMonitor \ for issues."
Path preserved intact โ
(not corrupted to "C:\src Code\...")
cd "C:\Source Code\LM Studio Plugins\troglodyte"
lms dev --install
npm run dev