Repository navigation
feat(dspymator): TypeSafe decision LMs, predict_proba, sklearn scorers - #14
Draft
crowdcent-centaur wants to merge 2 commits into
Draft
crowdcent-centaur wants to merge 2 commits into
crowdcent-centaur wants to merge 2 commits into
Conversation
- lm accepts any dspy BaseLM or decision client (dspy.experimental.TypeSafe) - predict/transform unwrap Noul/Choice/Score values - predict_proba + classes_ for a single decision target via dspy record_evidence - tag as classifier so sklearn scorers (roc_auc, neg_log_loss) work - lock dspy 3.4.0; offline tests with a fake decision client
…zer); fix lint Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Lets DSPyMator run on TypeSafe's non-generative decision models (
dspy.experimental.TypeSafe, Jev) and gives every decision-typed DSPyMator real probabilities.Changes
lmaccepts any DSPyBaseLMor decision client. Previously anything that wasn't adspy.LMgot re-wrapped asdspy.LM(model_name), which broke TypeSafe.predict_probaandclasses_for a single target typedbool,Literal[...], orNoul/Choice/Score. Probabilities come from DSPy 3.4'srecord_evidence(), one context per row (aContextVar, so async rows can't mix). This works with generative LMs too, not just Jev.scoring="roc_auc",neg_log_loss) work incross_val_score/GridSearchCV.predict/transformunwrapNoul/Choice/Scoreto plain values.uv.lock: dspy 3.0.3 → 3.4.0. The>=2.6.24floor is unchanged; the new paths are import-guarded.tests/test_dspymator.py); user-guide section added.Live check (Jev
jev-1.13.0, 300 balanced Onion-vs-HuffPost headlines)cross_val_score(..., scoring="roc_auc"), 3-fold: 0.856 / 0.919 / 0.889. 120 rows × 4 folds runs in about 6s.gpt-5-minias the reflection model runs end to end (about 300 rollouts, about 3.5 min). It did not beat the seed prompt on this task, in two runs (the second told the reflection model that the student is a non-generative classifier). The rewritten prompts are long, and Jev prefers short instructions. The mechanics work; the lift is unproven.Gotchas for users
dspy.Predict, notChainOfThought: Jev can't write a reasoning field.OutputField(desc=...).api_key="PROXY_TYPESAFE_KEY"(the egress proxy swaps in the real key).Draft until the demo notebook/video lands.