Repository navigation
feat(pi): a fourth harness, and the endpoint it has no variable for - #6
Merged
Merged
Conversation
Pi ships no lever for a custom endpoint: its Anthropic provider hardcodes api.anthropic.com and hands it to the SDK explicitly, so ANTHROPIC_BASE_URL is read by nothing, and its models.json lives inside the config directory this program never writes to. PI_CODING_AGENT_DIR would move that whole directory, taking the user's logins and sessions with it. So a binding with a base_url is generated as a pi.registerProvider extension under fastpick's own config directory, one file per route, and loaded with --extension. That needs the endpoint's dialect, which is the new `api` field on the binding, refused at load when a base_url comes without one. The key stays a $FASTPICK_PROVIDER_KEY reference resolved at request time, so nothing generated holds a secret. `max_tokens` on a model is new for the same reason: pi asks for an output cap it would otherwise default low, and inventing one here would truncate answers with nobody to blame.
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.
Adds Pi as a fourth harness kind, with its adapter, an example block in
config.example.tomland tests beside the other three.Pi has no lever for a custom endpoint at launch. It bundles the Anthropic SDK, which does read
ANTHROPIC_BASE_URL, and then hands it an explicitbaseUrlfrom a provider that carries its own, so the variable never applies. Its other surface ismodels.json, which lives inside pi's own config directory, andPI_CODING_AGENT_DIRmoves that whole directory, taking the user's stored credentials, settings and sessions with it.So a binding with a
base_urlis written as api.registerProviderextension under fastpick's own config directory, one file per route, rewritten at every launch including--dry-run, and loaded with--extension. A binding without one changes nothing and lets pi use the provider it already knows by that id. The key is a$FASTPICK_PROVIDER_KEYreference resolved by pi per request, so nothing generated holds a secret, and the whole document is built throughserde_jsonso a name or a url holding a quote cannot escape into code.Two config fields come with it.
apion a binding names which of pi's streaming implementations speaks the endpoint, and abase_urldeclared without one is refused at load rather than at launch, mirroring the OpenCodenpmrule.max_tokenson a model is optional and emitted only when declared: pi asks for an output cap and defaults it low, and inventing one here would truncate answers.Model metadata follows the config and nothing else:
reasoningis true only when the model declares effort levels, cost fields are zeros, andcontextWindowandmaxTokensare left out when unset.cargo testandcargo clippy --all-targetspass.