Add DSPyAlignmentOptimizer base class for DSPy-based optimizers#2
Closed
alkispoly-db wants to merge 1 commit intodefault_optimizer_utilsfrom
Closed
Add DSPyAlignmentOptimizer base class for DSPy-based optimizers#2alkispoly-db wants to merge 1 commit intodefault_optimizer_utilsfrom
alkispoly-db wants to merge 1 commit intodefault_optimizer_utilsfrom
Conversation
- Add abstract base class for DSPy-based alignment optimizers - Implement common functionality for trace conversion and DSPy setup - Provide align() method orchestrating the optimization process - Support separate model parameter for optimizer independence - Export DSPyAlignmentOptimizer from optimizers package This base class provides the foundation for implementing specific DSPy optimization algorithms like SIMBA, MIPROv2, etc. Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
4 tasks
Owner
Author
|
Closing to recreate against correct base branch |
alkispoly-db
pushed a commit
that referenced
this pull request
Oct 28, 2025
alkispoly-db
pushed a commit
that referenced
this pull request
Oct 31, 2025
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com> Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com> Co-authored-by: Daniel Lok <daniel.lok@databricks.com>
alkispoly-db
added a commit
that referenced
this pull request
Dec 17, 2025
Implements 6 of 9 review comments from smoorjani: **API Simplification (Comment #1):** - Remove last_turn_scorer parameter from public API - Simplify constructor to use default Pydantic initialization - Parameter kept as internal field for composition pattern **Code Quality (Comments #3, mlflow#6, mlflow#8):** - Remove duplicated kwargs validation (already in base class) - Remove unnecessary one-line docstring from _evaluate_turn - Use CategoricalRating enum instead of string literals ("yes"/"no") **Logic Improvements (Comments mlflow#7, mlflow#9):** - Move empty results check from _compute_aggregate to __call__ - Add per-turn details for success case (symmetric with failure case) **Code Reuse Analysis (Comments mlflow#4, mlflow#5):** - Researched _validate_session: serves different purpose (session ID validation) - Researched resolve_conversation_from_session: returns different type (list[dict]) - Keeping inline implementations as they serve different purposes **Deferred (Comment #2):** - _create_judge() architecture issue deferred per reviewer (non-blocking) All 5 KnowledgeRetention tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
alkispoly-db
added a commit
that referenced
this pull request
Feb 24, 2026
- Refactor _ToggleableSpanProcessor from inheritance to composition, wrapping MlflowV3SpanProcessor as inner processor (comment mlflow#5) - Add Langfuse and Arize/Phoenix to integration tiles (comment #2) - Simplify arize.mdx span type mapping to 1-to-1 note (comment #3) - Remove standalone otel.mdx; existing OTel docs suffice (comment mlflow#4) - Verified None preview works against Databricks backend (comment #1) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
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.
Summary
This PR adds the abstract base class for DSPy-based alignment optimizers.
Changes
DSPyAlignmentOptimizerabstract base classalign()method orchestrating the optimization processDescription
This base class provides the foundation for implementing specific DSPy optimization algorithms like SIMBA, MIPROv2, etc. It handles common tasks like converting MLflow traces to DSPy examples, setting up DSPy contexts, and creating optimized judges from results.
This is the second PR in a stack of 3 PRs that refactor the optimizer code:
Test plan
uv run ruff checkuv run ruff formatGenerated with Claude Code