pi-ai resolves an OAuth provider from a stored OAuth credential alone, and this adapter builds its Models collection with no credential store and runs no login flow. `openai-codex` — the one installed provider declaring `auth.oauth` with no `auth.apiKey` — was therefore offered on the Models page with the keyless placeholder every pi-ai route carries, and every request on it failed `Provider is not configured` before going out. `catalogProviderTakesApiKey()` answers whether pi-ai's installed provider for a route declares the one method this adapter can supply, and the directory skips the catalog routes that fail it. Catalog membership is unchanged, so `declared` still answers what pi-ai ships; the profile half of the union stays unconditional, so a route a settings document already names keeps its entry and can be edited or deleted. Resolution is untouched: a profile naming `apiKeyEnv` on such a route still builds a working provider.
llm/ — LLM capability family
English | 中文
The LLM seam and its provider adapters. The llm package owns both the Service Definition and Consumer roles: the abstract service, content-block vocabulary, and stream-chunk assembler. Provider adapters register on ctx.llm. All product packages.
| Package | Role | ctx key |
|---|---|---|
llm/ |
LLM service and shared streaming vocabulary | ctx.llm |
token-meter/ |
Replay-aware token measurement | ctx.tokenMeter |
llm-retry/ |
Provider-scoped retry policy | listens to agent/request-error |
llm-deepseek/ |
Direct DeepSeek adapter | registers on ctx.llm |
llm-pi-ai/ |
Multi-provider pi-ai adapter | registers on ctx.llm |
Adapters register provider routes on the seam; retry and token measurement remain separate consumers. The child READMEs own routing, metadata, replay, and provider-wire details; the LLM architecture decisions own the rationale.
The subsystem reference — messages and blocks, the model request, the StreamChunk protocol, the adapter contract — is docs/subsystems/llm-streaming.md (token measurement: token-meter.md); see the twin adapters, replay token meter, and routed model context Agent Notes.