Sarup
v0.2.0Thai-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.
| Parameter | Type | Description |
|---|---|---|
content * | string | Content to compress |
lossless | boolean | Only apply lossless transforms (whitespace/JSON compact). Default false. |
mode | string | Prose strategy. 'extractive' (default): offline TF-IDF, verbatim subset, ~1ms. 'semantic': embedding centrality, best ratio (needs Ollama). 'abstractive': local-LLM rewrite (needs Ollama, slow). 'pipe… |
query | string | Optional context query. Sentences relevant to this query are scored higher and more likely to be kept. |
target_ratio | number | Fraction 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.
| Parameter | Type | Description |
|---|---|---|
hash * | string | 24-char hash returned by sarup_compress |
sarup_stats
Return cumulative compression statistics, where the cache lives, and which optional Ollama models are available.