Trimwise
🚀 LaunchedOpen Source2h ago

Trimwise

Smart, source-faithful text trimming for high-signal LLM prompts.

About

Keep the evidence. Fit the budget.

Trimwise is an open-source Python library for query-aware prompt assembly.

Give it source text, a question, and a hard token, word, or character budget. Trimwise selects the most useful exact source passages, restores them in source order, and returns recoverable source spans for citation and provenance.

It is built for situations where the source is already known—repository excerpts, incident reports, policies, documentation, and institutional knowledge—but the full text does not belong in every LLM prompt.

What it does

  • Enforces token, word, or character limits.
  • Keeps exact source text rather than rewriting it.
  • Supports structural, lexical, semantic, and hybrid selection.
  • Preserves source order and exposes end-exclusive Python-string spans.
  • Supports sync and async use, including caller-provided embedding callbacks.

What it is not

Trimwise is not a RAG stack, vector database, search engine, answer generator, or summarizer. It is the small source-faithful preprocessing step between already-fetched text and prompt assembly.

Links

Screenshots4

Latest activity

More from Aakash Howlader

View profile →
CtxSift | Extend your coding sessions

CtxSift | Extend your coding sessions

Save tokens and extend your coding sessions with this skill.

🚀 Launched
2mo ago