@daihum/ai-model-contracts
v0.1.1
Published
DAIHUM AI pure, serializable model-operation payload contracts: chat, embedding, candidate-rank, tools, usage, embedding-compat. Zero dependencies. Carries NO routing (routePlan), provider selection, secrets, catalog/pricing, runtime, RAG, or product auth
Readme
@daihum/ai-model-contracts
Pure, serializable model-operation payload contracts for DAIHUM AI. The stable vocabulary leaf: zero dependencies, no behavior, no environment assumptions.
Subpaths: ./chat, ./embedding, ./candidate-rank, ./tools, ./usage,
./embedding-compat. Prefer subpath imports over the root barrel.
What this package is NOT
By rule (boundary gate R1/R7/R8) it carries only model I/O. It must never grow:
routePlanor any routing/provider-selection structure — that lives in@daihum/ai-routing, which lowers a route plan into resolvedproviderId/modelId/routeId+ a provider call context.- execution/authority context (workspaceId, actorId, dataClass, …) — that travels
in the provider call context (
@daihum/ai-provider-contracts), never in a payload. - provider registries/interfaces/errors —
@daihum/ai-provider-contracts. - secrets, catalog, pricing, cost, audit, config, runtime code, fetch/fs, RAG hits.
Test: these types should be copy-pasteable into another repo as plain TypeScript without bringing behavior, environment, provider knowledge, or product assumptions.
candidate-rank vs rerank
candidate-rank is the model-level ranking op (query + candidate texts → ids/
order/scores), a peer of chat/embedding. The word rerank is reserved for the
RAG pipeline stage in @daihum/ai-rag. Candidates are { candidateId, text } only
(no metadata backdoor); result score is optional (scoreKind documents its origin).
