feat(pipeline): unified dedup→compress→summarize pipeline (#4)#70
Merged
Conversation
Implements issue #4. Adds: pkg/pipeline: - Runner.Run: chains ClusterByThreshold → ExtractiveCompressor → HierarchicalSummarizer; each stage independently enable/disable - StageStats: per-stage input/output tokens, reduction ratio, latency - DefaultOptions: dedup+compress enabled, summarize opt-in cmd/pipeline.go: - 'distill pipeline' CLI reads JSON chunks from stdin/file, writes optimised chunks to stdout/file; --stats prints per-stage breakdown cmd/api_pipeline.go: - POST /v1/pipeline: synchronous pipeline with full stats response - POST /v1/batch: submit async job, returns job_id - GET /v1/batch/{id}: poll status and progress - GET /v1/batch/{id}/results: retrieve completed results Co-authored-by: Ona <no-reply@ona.com>
f57900a to
43115eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4
Summary
Adds a unified pipeline that chains dedup → compress → summarize in a single call, with per-stage stats. Exposed as both a CLI command and an HTTP endpoint.
pkg/pipelineRunner.Run(ctx, chunks, Options)— executes enabled stages in orderOptionsStatsincludes per-stage: input/output tokens, reduction ratio, latencyDefaultOptions: dedup + compress enabled; summarize opt-indistill pipelineCLIPOST /v1/pipeline{ "chunks": [...], "options": { "dedup": {"enabled": true, "threshold": 0.15}, "compress": {"enabled": true, "target_reduction": 0.5}, "summarize": {"enabled": false} } }Response includes
chunksandstatswith per-stage breakdown.Files
pkg/pipeline/pipeline.go+pipeline_test.go(9 tests)cmd/pipeline.go— CLI commandcmd/api_pipeline.go— HTTP handlers (also wires batch routes)cmd/api.go— registers/v1/pipelineand/v1/batch/*