Overview of the contextual-distillation API.
Core Classes
| Class | Description |
|---|---|
| Distiller | Main extraction class |
| Funnel | Progressive refinement |
| BaseChunker | Custom chunking |
| BaseDownloader | Custom retrieval |
| BaseDistiller | Custom distillation |
Quick Example
from contextual_distillation import Distiller
from pydantic import BaseModel
class Answer(BaseModel):
summary: str
key_points: list[str]
distiller = Distiller(
model_name="openai/gpt-4.1-mini",
response_schema=Answer,
)
result = await distiller.distill(query="...", chunk_text="...")