Centralize model API capabilities and add Pi provider - #298
Merged
Conversation
a-github-name
marked this pull request as ready for review
August 14, 2026 12:09
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
/v1/models, request validation, runtime selection, agent eligibility, setup, and Pi metadata from that catalog source of truth@mere-run/piprovider package validated against Pi 0.84.2Why
An OpenAI-compatible base URL and API key do not describe the behavior an agent harness needs. Pi also needs reliable task, tool-call, reasoning-level, modality, context/output-limit, and OpenAI dialect metadata. Those facts were previously split across engine switches and integration-specific model definitions, which allowed behavior to drift.
This refactor makes the managed-model catalog authoritative and lets runtime configuration overlay only effective limits. It also fixes an existing inference bug where Q35 OCR models could be treated as chat-serving models.
Impact
Pi can now discover compatible local models dynamically from mere.run's self-describing
/v1/modelsresponse and configure each model without ID-based guessing. Other OpenAI-compatible clients keep the standard response fields and may ignore the additive metadata.Uncataloged custom runtimes remain supported through a conservative compatibility fallback.
Validation
./scripts/check.shpnpm typecheckinintegrations/pipnpm testinintegrations/pi: 4 passedpnpm pack --dry-runmere pi smoke ok