Skip to content

Meter teacher requests through supported DSPy engines - #102

Merged
CompleteDotTech merged 1 commit into
mainfrom
fix/supported-teacher-metering
Oct 3, 2026
Merged

CompleteDotTech merged 1 commit into
mainfrom
fix/supported-teacher-metering

Conversation

@CompleteDotTech

Copy link
Copy Markdown
Contributor

Teacher request accounting on DSPy3.4 used the deprecated BaseLM.forward override. This moves the3.4 path to an owned supported engine, reserves before each provider attempt, observes raw identity/usage/cost before canonical conversion, and propagates owned typed budget/drift failures. The composition wrapper excludes complete_legacy so ordinary Predict calls cannot bypass metering. The supported3.3.1 legacy branch remains intact, including terminal identity refusal; the <3.5 cap stays.

Closes #93. Key/base/timeout overrides reach loopback, retries/cache/history controls stay off, and unknown cost remains null. Primary upstream and installed pinned source were rechecked.

Validation on isolated f9080cb: full suite628 passed, zero skipped on each DSPy3.3.1 and3.4.0; targeted17 passed each; independent code review passed; whole-tree Ruff passed; wheel/sdist built and50 package files/four entrypoints verified. Fresh installed-wheel flat/hierarchy no-key demos and runtime/helper lazy imports passed outside checkout with zero provider calls.

Retained exploratory failure: an early inherited complete_legacy hook bypassed the proposed engine and an unguarded synthetic test attempted an uncredentialed external request, returningHTTP401. The wrapper and hard loopback-only/socket guards now prevent that path; no paid inference or private data was authorized or executed. Current qualifying tests use guarded in-memory/loopback doubles. Exact-head hosted checks remain required before merge.

@CompleteDotTech
CompleteDotTech merged commit 67a53ee into main Oct 3, 2026
10 checks passed
@CompleteDotTech
CompleteDotTech deleted the fix/supported-teacher-metering branch October 3, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate teacher metering off the deprecated BaseLM.forward() override before DSPy 3.5

1 participant