Skip to content

feat(model-runtime): introduce isolated V2 input/output contracts #307

Open

Description

@laipz8200

Problem

Exclusive model-family categories cannot describe models that return native scores or support several input/output formats. Model Runtime V2 needs an additive contract surface that leaves the existing runtime unchanged.

Scope

Introduce one layered bounded context under graphon.model_runtime.v2: domain data, application protocols, and public exports. Input/output contracts define compatibility; operation tags are descriptive. The plugin system owns actual provider calls. Preserve provider usage unchanged, using integer zero only for absent/null usage; add no token estimation or accounting.

The contract surface covers identity, formats, descriptors, call context, continuation, errors, request/results, discovery, complete invocation, stream records/protocol, and job records/protocol. Downstream adoption covers SDK, daemon, package-reader, and host integration. Existing consumers require explicit adoption before switching to V2.

Related architectural history: #56. This proposal introduces input/output contracts rather than extending the earlier capability-family split.

Downstream adoption

Adoption is a separate milestone for each interface and consumer. Contracts use
JSON Schema Draft 2020-12 with document-local references; plugins and consumers
must agree on shared value profiles and wire exchanges.

  • R1–R4 cover the actual declaration readers: daemon, marketplace, registry, and
    toolkit. W1 covers SDK declaration writing. Only applicable paths need changes;
    record deployed/installed versions before publication.
  • Each interface's A1–A8 chain means wire agreement, SDK dispatch, daemon routing,
    provider implementation, host adapter, one opt-in consumer, publication, then
    activation. Package publication and consumer activation are separate gates.
  • Start with discovery and complete invocation for a selected provider/host.
    A pilot can pair Dify with one Jev-style provider.
    Streaming follows its own chain; submit and status jointly gate job adoption.
    Cancellation is optional and has a separate provider-specific chain.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions