Skip to main content

Crate ainl_compression

Crate ainl_compression 

Source
Expand description

Heuristic compression primitives for AINL hosts.

This crate currently exposes the ArmaraOS “Ultra Cost-Efficient Mode” input compressor. It is intentionally embedding-free and dependency-light so it can be reused across hosts without shipping local ML models.

Set RUST_LOG=ainl_compression=debug to enable full before/after text logging per call (useful for tuning preserve lists and retention ratios).

Structs§

Compressed
Result of a compression pass.
CompressionMetrics
Structured telemetry emitted for each compression operation.
PromptCompressor
Standalone input prompt compressor.

Enums§

EfficientMode
Input compression aggressiveness.

Traits§

CompressionTelemetrySink
Optional telemetry sink for compression metrics.

Functions§

compress
Compress text toward mode.retain() of its original token budget.
compress_with_metrics
Compress and return structured telemetry metrics in one call.
estimate_semantic_preservation_score
Lightweight lexical semantic-preservation heuristic in range 0.0..1.0.