Skip to content

feat(ui): model relationship management #7963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xiaden
Copy link

@xiaden xiaden commented Apr 27, 2025

Adds full support for managing model-to-model relationships in the UI and backend.

Introduces RelatedModels subpanel for linking and unlinking models in model management.

  • Adds REST API routes for adding, removing, and retrieving model relationships.
  • New database migration: creates model_relationships table for bidirectional links.
  • New service layer (model_relationships) for relationship management.
  • Updated frontend: Related models float to top of LoRA/Main grouped model comboboxes for quick access.
    • Added 'Show Only Related' toggle badge to MainModelPicker filter bar

Summary

Introduces a full system for managing model-to-model relationships.
New database migration: model_relationships table (bidirectional, FK constrained, cascade deletes, sorted input).
New service layer: model_relationships for API interaction.
New UI subpanel (RelatedModels) for linking/unlinking models in the Model Manager.
UI on frontend linked to relationships, pulling either to the top, or allowing filters.
Rebased due to snazzy new model selector that happened this week.

image
image
image
image
image
image
image


Notes

  • Linking currently allows connecting any models with matching base_model types (or any model with the base type any ) in the UI.
  • API has no frontend constraints on linking — assumes trusted input.
  • API prevents duplicates automatically.
  • May want a virtual field (related_model_ids) on models for optimized frontend access (instead of extra API calls).
    First PR, Please be gentle.

Related Issues / Discussions

Part of 7894 used_with tag support.


QA Instructions

Ran Lint, Prettier, pnpm test, Made sure UI and API routes functioned with DB open to watch.


Merge Plan

Unless a migration happens between now and PR, Rebase if needed and repush? Honestly not completely sure what's needed here, but more than willing to work for whatever is needed.


Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Adds full support for managing model-to-model relationships in the UI and backend.

Introduces RelatedModels subpanel for linking and unlinking models in model management.
 - Adds REST API routes for adding, removing, and retrieving model relationships.
 - New database migration: creates model_relationships table for bidirectional links.
 - New service layer (model_relationships) for relationship management.
 - Updated frontend: Related models float to top of LoRA/Main grouped model comboboxes for quick access.
     - Added 'Show Only Related' toggle badge to MainModelPicker filter bar
@github-actions github-actions bot added api python PRs that change python files services PRs that change app services frontend PRs that change frontend files labels Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api frontend PRs that change frontend files python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant