Phase 4.4: Extract finetune endpoints to domain modules#570
Merged
Conversation
Phase 4.4 of orchestrator decomposition (Strangler Fig): - Extract 17 LLM finetune endpoints (dataset, training, adapters) to modules/llm/router_finetune.py (~260 lines) - Extract 13 TTS finetune endpoints (samples, training, models) to modules/speech/router_finetune.py (~150 lines) - Move 4 Pydantic models (DatasetProcessRequest, GenerateProjectDatasetRequest, FinetuneConfigRequest, AdapterRequest) to LLM finetune router - Conditional registration: GPU-only (DEPLOYMENT_MODE != "cloud") - Remove unused imports: get_finetune_manager, get_tts_finetune_manager, TTS_FINETUNE_AVAILABLE, File, UploadFile - Orchestrator: 2875 → 2471 lines (-404) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
modules/llm/router_finetune.py(~260 lines)modules/speech/router_finetune.py(~150 lines)DEPLOYMENT_MODE != "cloud"(GPU-only)Key changes
modules/llm/router_finetune.pymodules/speech/router_finetune.pyorchestrator.pyDesign decisions
prefix="/admin/finetune"andprefix="/admin/tts-finetune"on routers to keep URL paths identicaltts_finetune_managerremains optional (try/except import) in the new modulefinetune_manageris always available (non-optional import) — same as orchestrator behaviorrequire_permission("system", "view")auth guardTest plan
ruff checkpasses on all changed filesruff format --checkpassespytest tests/— all 65 tests pass/admin/finetune/configreturns config (GPU mode)/admin/tts-finetune/configreturns config (GPU mode)Closes #549
🤖 Generated with Claude Code