deepseek-harness/packages/llm
Tianyi Cui 6520f71f94 Merge remote-tracking branch 'origin/codex/invariant-service-seam' into codex/invariant-package-registration-gate
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-19-package-owned-invariant-service.i18n.yaml
#	docs/core-data-structures/session.md
#	docs/module-graph.md
#	package.json
#	packages/sdk/scripts/tsconfig.json
2026-07-20 00:35:06 +08:00
..
llm Merge remote-tracking branch 'origin/codex/invariant-service-seam' into codex/invariant-package-registration-gate 2026-07-20 00:35:06 +08:00
llm-deepseek Merge remote-tracking branch 'origin/codex/invariant-service-seam' into codex/invariant-package-registration-gate 2026-07-20 00:35:06 +08:00
llm-pi-ai Merge remote-tracking branch 'origin/codex/invariant-service-seam' into codex/invariant-package-registration-gate 2026-07-20 00:35:06 +08:00
token-meter Merge remote-tracking branch 'origin/codex/invariant-service-seam' into codex/invariant-package-registration-gate 2026-07-20 00:35:06 +08:00
README.md Rename RFCs to Agent Notes 2026-07-19 22:52:03 +08:00

llm/ — LLM capability family

The LLM seam and its provider adapters. The interface package (llm) owns the abstract service, the content-block vocabulary, and the stream-chunk assembler; the adapters are concrete implementations that register on ctx.llm. All product packages.

Package Role ctx key
llm/ Abstract LLM service + content-block vocabulary + chunk assembler ctx.llm
token-meter/ Replay-aware request and surface token measurement ctx.tokenMeter
llm-deepseek/ DeepSeek API adapter (hand-rolled fetch/SSE) (registers on ctx.llm)
llm-pi-ai/ Multi-provider adapter via @earendil-works/pi-ai (registers on ctx.llm)

The interface lives at llm/llm/; adapters and the reusable token meter are flat siblings under the group. Requests route by provider, while model is passed through to the selected adapter. A new provider adapter joins here and registers one or more provider routes on ctx.llm without touching the interface. See twin LLM adapters for the contract-validation origin of the two shipping implementations and the replay token meter Agent Note for measurement ownership.