Skip to main content

MCP plugin + Python library for LLM token compression. 50+ languages, zero ML models. Port of Caveman (C#).

Project description

Synthelion — Claude Code Plugin + Python Library

Synthelion is a Claude Code MCP plugin and Python library that reduces LLM token usage by stripping grammatical noise and lemmatizing words — across 50+ languages, with zero ML model dependencies.

"Why use many tokens when few tokens do trick?" — A caveman (and your wallet).

Python port of Caveman by Passaro Francesco Paolo (Digitalsolutions.it).


Use as Claude Code plugin (30 seconds)

1. Install:

pip install synthelion

2. Add to Claude Code (~/.claude/settings.json on macOS/Linux, %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "synthelion": {
      "command": "synthelion-mcp"
    }
  }
}

3. Restart Claude Code. Done — the tools compress, detect_language, route_content, summarize, compress_batch are now available.

Zero-install with uvx:

{
  "mcpServers": {
    "synthelion": {
      "command": "uvx",
      "args": ["synthelion-mcp"]
    }
  }
}

→ Full plugin guide: docs/claude-code-plugin.md


Powered by Synthelion — © Passaro Francesco Paolo, Digitalsolutions.it (https://digitalsolutions.it)


Installation

pip install synthelion
# With MCP server support (for Claude Code, OpenCode, …):
pip install "synthelion[mcp]"
# With OpenAI function tools:
pip install "synthelion[openai]"

Quick start

from synthelion import CompressionService, CompressionLevel

svc = CompressionService()
result = svc.compress(
    "I would like to know if it is possible to receive information about cheap restaurants in Rome.",
    CompressionLevel.SEMANTIC,
)
print(result.compressed_text)       # "know possible receive information cheap restaurant Rome"
print(f"{result.efficiency_pct:.1f}% saved")

Compression levels

Level What it does Typical savings
LIGHT Remove stop words ~25–35%
SEMANTIC Stop words + lemmatization ~30–69%
AGGRESSIVE Lemmatization + generic-term pruning ~35–70%

Language detection

from synthelion import LanguageDetector

det = LanguageDetector()
print(det.detect("Vorrei un tavolo per due persone, per favore."))  # ita
scores = det.detect_with_scores("Where is the nearest train station?")
# {"eng": 0.42, ...}

Content-aware routing

from synthelion import ContentRouter, CompressionProfile

router = ContentRouter.from_profile(CompressionProfile.BALANCED)
result = router.route(content)   # auto-detects JSON/HTML/diff/log/code/prose
print(result.strategy_used, result.savings_pct)

MCP server (Claude Code / OpenCode)

# Run the MCP server on stdio:
synthelion-mcp

# Or add to your Claude Code MCP config:
# {
#   "mcpServers": {
#     "synthelion": { "command": "synthelion-mcp" }
#   }
# }

Tools exposed: compress, detect_language, route_content, summarize, compress_batch.


OpenAI function tools

from synthelion.plugins.openai_tools import get_tool_definitions, execute_tool

tools = get_tool_definitions()
# Pass to: client.chat.completions.create(tools=tools, ...)

# Execute a tool call returned by the model:
result = execute_tool("compress", {"text": "...", "level": "semantic"})

CLI

synthelion compress --text "Hello world, I would like to know..." --level semantic
synthelion detect --text "Guten Morgen, wie geht es Ihnen?"
synthelion route --file myfile.json
synthelion serve-mcp   # same as synthelion-mcp

Summarization

from synthelion.nlp import TfIdfSummarizer, TextRankSummarizer

summarizer = TfIdfSummarizer()
summary = summarizer.summarize(long_text, sentence_count=3)

tr = TextRankSummarizer()
summary = tr.summarize(long_text, ratio=0.3)

Agent toolkit

from synthelion.agent import ContextWindow, MemoryStore

window = ContextWindow(max_tokens=4000)
window.append("user", "Tell me about Rome.")
window.append("assistant", "Rome is the capital of Italy...")
# Auto-compacts when over budget:
print(window.to_messages_json())

memory = MemoryStore()
memory.remember({"summary": "User prefers Italian cuisine", "keywords": ["pizza", "pasta"]})
relevant = memory.recall("What food does the user like?", top_k=3)

Attribution

Synthelion is a Python port of Caveman — © 2026 Passaro Francesco Paolo, Digitalsolutions.it. Original C# source: https://github.com/francescopaolopassaro/caveman

Language data derived from Universal Dependencies treebanks (CC BY-SA / CC BY).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synthelion-1.0.0.tar.gz (12.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synthelion-1.0.0-py3-none-any.whl (12.8 MB view details)

Uploaded Python 3

File details

Details for the file synthelion-1.0.0.tar.gz.

File metadata

  • Download URL: synthelion-1.0.0.tar.gz
  • Upload date:
  • Size: 12.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for synthelion-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1bbb5572659104cd68ea4218b8386785d961fb8bf9d0de8057445db15d1b197b
MD5 07ae36ec01ce2932f872295635869c9b
BLAKE2b-256 874d4a07d860ded741283beaa8061af1e7306f012b7a245fa851975ba86da177

See more details on using hashes here.

File details

Details for the file synthelion-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: synthelion-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for synthelion-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1976e2a1da43998b8e6f9f13487da13f7aa1571ee5341d73daae6c6d165f24f3
MD5 3a0a71cdc5d2b9cda7840027ac6613bb
BLAKE2b-256 04f722004f9a6b3f4b64873d0a3ef98c28389e9151c068ad1cd3f4dc2f990a80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page