refactor(runtime)!: split model runtime protocols by capability#57
Merged
refactor(runtime)!: split model runtime protocols by capability#57
Conversation
Move capability-specific model runtime protocols into graphon.model_runtime.protocols and retarget model wrappers, Slim runtime helpers, and public exports to the narrower interfaces. This removes the top-level model_runtime runtime protocol module in favor of the new protocols package layout and updates downstream-facing imports accordingly.
41tair
approved these changes
Apr 21, 2026
41tair
previously approved these changes
Apr 21, 2026
WH-2099
approved these changes
Apr 21, 2026
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.
Important
!Related Issue
Closes #56
Summary
This refactor breaks the monolithic model runtime contract into capability-specific protocols and moves those protocol definitions under
graphon.model_runtime.protocols.The change narrows each model wrapper to the runtime surface it actually consumes, updates Slim runtime integrations to use the new protocol package, exports the new protocol set from
graphon.protocols, and makesModelProviderFactorya provider-only abstraction backed byModelProviderRuntime.Breaking Changes
graphon.model_runtime.runtimeis removed in favor ofgraphon.model_runtime.protocols.runtime.graphon.model_runtime.<model>_runtimetographon.model_runtime.protocols.<model>_runtime.ModelProviderFactorynow acceptsruntime=backed byModelProviderRuntimeinstead ofmodel_runtime=backed by the aggregateModelRuntime.ModelProviderFactory.get_model_type_instance()is removed. Callers that need invocation behavior must instantiate the appropriate model wrapper directly against the matching capability-specific runtime.ModelProviderRuntime,LLMModelRuntime,TextEmbeddingModelRuntime,RerankModelRuntime,SpeechToTextModelRuntime,ModerationModelRuntime, orTTSModelRuntimedirectly where appropriate instead of assuming a single required interface.SlimPreparedLLMand other LLM-facing helpers now depend on the LLM-specific runtime protocol package path.Downstream Checklist
graphon.model_runtime.runtimewithgraphon.model_runtime.protocols.runtimewhere a full aggregate runtime is still required.graphon.model_runtime.llm_runtime,text_embedding_runtime,rerank_runtime,speech_to_text_runtime,moderation_runtime,tts_runtime, andprovider_runtimewith theirgraphon.model_runtime.protocols.*equivalents.ModelProviderFactory(...)call sites that passedmodel_runtime=to useruntime=.ModelProviderFactory.get_model_type_instance()usage with direct construction ofLargeLanguageModel,TextEmbeddingModel,RerankModel,Speech2TextModel,ModerationModel, orTTSModelagainst the corresponding capability-specific runtime.SlimPreparedLLM, model wrappers, and provider factories to ensure they point at the new protocol package and provider-only factory boundary.Checklist
!