concise
No wrapper. Pure compressed output.
Every feature is designed for one goal: reduce tokens without losing meaning.
Zero-semantic-change cleanup. Runs first on every mode.
Composes characters, standardizes compatibility equivalents.
Converts curly quotes (""''‚„) to straight ASCII equivalents.
Converts — and – to simple hyphens for token efficiency.
Collapses ... / !!! / ???, removes decorative lines (--- === ~~).
CRLF→LF, tabs→spaces, collapse multi-spaces, trim trailing.
✓ NFKC applied ✓ 4 fancy quotes converted ✓ 2 em-dashes normalized ✓ 6 excess punctuation removed ✓ whitespace collapsed TOKENS: 142 → 138 (-2.8%)
✓ Stutters collapsed: 3 ✓ Commands stripped: "please note that" ✓ Hedges removed: 7 ✓ Fillers dropped: 12 ✓ Greetings stripped: "Hello there" ✓ Phrases compressed: 5 ✓ Synonyms swapped: 3 ✓ Numbers→digits: 2 TOKENS: 523 → 341 (-34.8%) GRAMMAR: PASSED
Content-aware removal & compression. Available in Balanced and Aggressive modes.
Removes instructional preambles at sentence boundaries: "please note that", "kindly note that", "i just want to say that", "let me just say that", etc.
Multi-word hedges: "you know", "i mean", "sort of", "kind of", "i guess", "if that makes sense", "to be honest", "at the end of the day", "for what it's worth".
Context-aware removal: "um", "uh", "basically", "literally", "actually", "really", "very", "just", "simply", "totally", "obviously", "clearly", "essentially", "rather" (guarded), etc.
50+ mappings: "in order to"→"to", "due to the fact that"→"because", "it is important to note that"→"", "make sure that"→"ensure", "take into consideration"→"consider", etc.
"utilize"→"use", "facilitate"→"help", "implement"→"do", "commence"→"start", "subsequently"→"then", "additional"→"more", "approximately"→"about", "individuals"→"people".
"twenty minutes"→"20 minutes", "five users"→"5 users". Only when followed by recognized unit. Quote-aware.
Every lexical change is validated. Reverts if result has: dangling prepositions/conjunctions, doubled determiners ("the the"), modal+"to" without verb ("would to propose"), "important to [subject]" without verb, unbalanced quotes/parens.
Semantic deduplication & structural compression. Aggressive mode uses Jaccard similarity; Balanced uses exact n-gram fallback.
Splits text into clauses, extracts content words (stemmed + synonym-canonicalized), computes Jaccard similarity. Restatement markers ("to confirm", "in other words", "to reiterate") trigger relaxed threshold (0.25) against immediate predecessor. General threshold: 0.55.
5-gram exact match detection for copy-paste repeats. Runs in Balanced mode. Prevents overlapping span conflicts with semantic pass.
Reduces 3+ consecutive newlines to double newline. Token-saving for verbose formatted prompts.
✓ Clauses detected: 12 ✓ Restatement markers: 3 ✓ Jaccard pairs evaluated: 22 ✓ Clauses collapsed: 4 ✓ Newlines collapsed: 3→2 TOKENS: 1,247 → 982 (-21.2%) CONFIDENCE: 0.94
Applied after optimization. Structural templates (role_context_task) restructure; others prepend directives.
No wrapper. Pure compressed output.
"Respond in short bullet points."
"Expert answer." prefix.
"Numbered steps." prefix.
"Compare options for: {prompt}"
Clean wording only. No prefix.
"Tutorial style." prefix.
"Reply conversationally." prefix. Preserves greetings.
Compact zero-shot task format.
"From examples below, complete:"
"Summarize concisely." prefix.
"Translate accurately." prefix.
"Write clean code.\nTask: {prompt}"
"Extract: {prompt}\nReturn structured."
"Use context above for: {prompt}"
"System: {prompt}\nRespond accordingly."
Classifies into Role / Context / Task sections. Structural restructure.
Token counting uses model-specific encodings (cl100k_base / o200k_base approximations).
Normalize pass only. Whitespace, unicode, punctuation. Zero semantic risk.
Normalize + Lexical. Filler/hedge/command removal, phrase compression, greeting stripping.
All passes. Semantic clause dedup, synonym swaps, number→digit, structural compression.
Integrate CuToken into your pipeline.
{ "prompt": "your prompt here", "mode": "balanced", "template": "concise", "model": "gpt-4o" }
{ "original": "...", "optimized": "...", "original_tokens": 123, "optimized_tokens": 78, "tokens_saved": 45, "savings_pct": 36.6, "confidence": 0.97, "changelog": [["pass_lexical", "filler:basically"]] }
curl -X POST https://yourdomain.com/api.php \ -H "Content-Type: application/json" \ -d '{"prompt":"please note that I need help...","mode":"balanced"}'