Expand description
Local-LLM distillation trait and the optional distill-http implementation.
Distillation: turning a raw conversation transcript into durable memory.
This module defines the Distiller trait and the data types it
produces. The trait itself is always available (not feature-gated) so
that callers can implement their own distillers — for example, a remote
API client, a different local model runtime, or a test stub.
The OpenAiCompatDistiller implementation in the openai_compat
submodule (behind the distill-http feature) talks to an
OpenAI-compatible chat completions endpoint such as Ollama or
llama-server. It is the only place in this crate that performs HTTP, and
only when that feature is enabled.
Structs§
- Chunking
Distiller - A
Distillerdecorator that bounds the size of any single prompt sent toinner. - Distilled
Memory - The result of distilling a conversation transcript into durable memory.
- Fact
- A single distilled fact extracted from a transcript.
Enums§
- Fact
Kind - The category of a distilled
Fact. - Reduce
Strategy - Strategy used to reduce several partial
DistilledMemoryresults — one per transcript chunk — into a single result.
Constants§
- MAX_
FACTS - Maximum number of facts persisted from a single distillation. Excess facts (untrusted model output) are dropped.
- MAX_
FACT_ CHARS - Maximum character length of a single distilled fact’s text. Longer text
is truncated on a
charboundary. - MAX_
SUMMARY_ CHARS - Maximum character length of a distilled summary. Longer text is
truncated on a
charboundary.
Traits§
- Distiller
- Produces
DistilledMemoryfrom a raw conversation transcript.
Functions§
- merge_
distilled - Reduces several
DistilledMemorypartial results — one per transcript chunk — into a singleDistilledMemory. - split_
on_ budget - Splits
transcriptinto chunks that each fit withinmax_chars.