Skip to content

Remove legacy model type alias parsing after Dify migration window #206

Closed

Description

@QuantumGhost

AI disclosure: This issue was drafted and analyzed with Codex using GPT-5.4.
I have reviewed the analysis, and I am responsible for the content.

Summary

We should remove the legacy model type alias parsing in Graphon after the Dify legacy model_type migration window has had enough time to complete.

Graphon currently accepts legacy provider-native model type strings through ModelType._missing_, including:

  • text-generation -> llm
  • embeddings -> text-embedding
  • reranking -> rerank

This compatibility path was useful while Dify still had persisted rows or API-origin payloads using the legacy values. The Dify-side migration has now been released, so this compatibility logic should have an explicit cleanup issue instead of staying indefinitely.

Background

Proposed cleanup

Remove the legacy alias parsing once we decide the compatibility window is over:

  • Remove the legacy alias mapping in src/graphon/model_runtime/entities/model_entities.py.
  • Remove or update tests that assert text-generation, embeddings, or reranking are accepted as ModelType inputs.
  • Keep canonical values as the only accepted Graphon model type representation:
    • llm
    • text-embedding
    • rerank
    • speech2text
    • moderation
    • tts

Risk and compatibility notes

This is a compatibility-breaking cleanup for callers that still pass legacy provider-native values directly into Graphon. Before removing it, we should confirm that supported Dify upgrade paths require the Dify migration to be run, and that any remaining legacy values are treated as invalid data rather than silently accepted runtime input.

The expected policy is:

  • Adjacent-version upgrades can rely on the temporary compatibility window.
  • Multi-version skipped upgrades should either upgrade step by step or stop serving traffic while applying the required migrations.

Validation

Suggested validation after implementation:

  • Run uv run pytest tests/model_runtime/test_model_dispatch.py tests/dsl/test_slim_package_loader.py.
  • Run the Graphon type/check workflow used by the repository, such as make tc if still current.
  • Confirm Dify no longer depends on Graphon accepting legacy values after its 1.15.0 data migration path.

Activity

  1. added this to the next milestone on Jul 3, 2026
  2. added
    enhancement
    on Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementproject#graphon

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions