Sarup

v0.2.0
io.github.PHUICMT/sarup Checked 4 days ago Published 1 month ago

Thai-first context compression; shrinks long Thai and English text, originals retrievable.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

sarup_compress

Compress content for context efficiency. Supports Thai prose, English prose, mixed Thai+code, JSON, and logs. Returns compressed text, a retrieval hash, and token-saving metrics. Use sarup_retrieve(hash=...) to recover the original when needed.

ParameterTypeDescription
content *stringContent to compress
losslessbooleanOnly apply lossless transforms (whitespace/JSON compact). Default false.
modestringProse strategy. 'extractive' (default): offline TF-IDF, verbatim subset, ~1ms. 'semantic': embedding centrality, best ratio (needs Ollama). 'abstractive': local-LLM rewrite (needs Ollama, slow). 'pipe…
querystringOptional context query. Sentences relevant to this query are scored higher and more likely to be kept.
target_rationumberFraction of prose to keep (0.3–0.7). Default 0.5.

sarup_retrieve

Retrieve the original uncompressed content by hash. The hash is returned by sarup_compress.

ParameterTypeDescription
hash *string24-char hash returned by sarup_compress

sarup_stats

Return cumulative compression statistics, where the cache lives, and which optional Ollama models are available.