feat: Enhance profile and comparison report formatting in sparkle-cli (…#29
Merged
Conversation
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.
This pull request introduces a new non-interactive "direct" mode for
sparkle-cli, adds a runtime profiling and metrics system, and refactors internal components to support these features. The documentation is updated to reflect the new usage patterns, and profiling hooks are integrated throughout the codebase for performance analysis.Key changes include:
New Features
Direct (Non-Interactive) Mode:
Adds a
directsubcommand tosparkle-clifor automation, scripts, and integrations, providing a single final response on stdout. This mode supports bothnormalandreasoning(withthinkingas an alias) and is documented in bothREADME.mdand user docs. [1] [2] [3] [4]Profiling and Metrics System:
Introduces a runtime profiler that tracks step durations, token usage, and throughput. Profiling can be enabled via config or CLI flag, and includes summary and comparison reporting. New files implement the profiler's types, token estimation, and output formatting. [1] [2] [3] [4] [5] [6] [7]
Internal Refactoring and Instrumentation
The
internal/searchpackage is refactored to accept aprofiler.Trackerand instrument key steps (embedding_retrieval,rerank) with profiling spans and metadata. [1] [2] [3] [4] [5] [6] [7]API Enhancements
The Ollama client and stream parser are extended to return token usage statistics (
PromptEvalCount,EvalCount) from streamed responses, supporting more detailed profiling. [1] [2] [3] [4]Documentation
Adds documentation for the new profiler option in the example config and describes the new direct mode and profiling features in the CLI and user guides. [1] [2] [3] [4]
Most important changes:
New CLI Modes and Profiling
directsubcommand tosparkle-clifor non-interactive, single-response usage, with documentation and flag parsing logic. [1] [2] [3] [4]Instrumentation and Internal Refactoring
API and Stats Enhancements
Documentation