Repository navigation
Conversation
Define an artifact for state that a runtime builds while running a model, such as a prompt cache or a saved conversation. Its manifest references the model artifact through subject, and its config records the state's format, the tokens it was built from and, optionally, its precision. Refs modelpack#239 Signed-off-by: João Galego <jgalego1990@gmail.com>
Add the artifact, config and layer media types for model state artifacts, a State type for the config, and a JSON schema registered under ValidatorMediaTypeModelStateConfig. As with model configs, the validator decodes a state config into its Go type before validating it against the schema. Refs modelpack#239 Signed-off-by: João Galego <jgalego1990@gmail.com>
JGalego
force-pushed
the
feat/model-state-artifacts
branch
from
November 12, 2026 10:56
1435155 to
dc063a4
Compare
JGalego
marked this pull request as ready for review
November 12, 2026 16:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds OCI artifacts for runtime state, such as prompt caches and saved conversations.
application/vnd.cncf.model.state.manifest.v1+jsonwith a requiredsubjectreferencing the model artifact's manifest.application/vnd.cncf.model.state.config.v1+jsonwith requiredformat(encoding and version) andtokens, and optionalprecision.application/vnd.cncf.model.state.v1.raw,.tar,.tar+gzip, and.tar+zstd.Adds Go types and constants, a JSON schema, typed config validation, and tests for invalid configs and the documentation example.
State encoding is runtime-specific and identified by
format. Loading rules:subjectreferences, or by a runtime that does not support itsformat.States built from images, audio or other non-token input, or with an adapter applied, are out of scope. Existing media types and the model config schema are unchanged.
Related Issue
Closes #239
Motivation and Context
ModelPack does not currently define how to package reusable runtime state. This supports two use cases:
Linking through
subjectleaves the model artifact unchanged and lets multiple states be published independently. As discussed on #60, the doc notes that this link is advisory.This PR proposes defining state artifacts in ModelPack rather than a separate spec.