llm/

August 9, 2026 · View on GitHub

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.

PackageRolectx key
llm/LLM service and shared streaming vocabularyctx.llm
token-meter/Replay-aware token measurementctx.tokenMeter
llm-retry/Provider-scoped retry policylistens to agent/request-error
llm-deepseek/Direct DeepSeek adapterregisters on ctx.llm
llm-pi-ai/Multi-provider pi-ai adapterregisters 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.