You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
phantom-audio[separation] pulls ~2.5 GB of PyTorch + torchaudio + Demucs + model weights. Today this is hidden behind an extras flag, but the dependency tree exists in pyproject.toml as a first-class option of the main package. That couples the core analysis library's release cadence and platform-support matrix to PyTorch's.
Why it's a problem
Most users want analysis first and stem separation later, if at all. PyTorch's platform / Python-version matrix is more restrictive than essentia's, and a bad PyTorch release can cause pip install phantom-audio[separation] to break even when pure analysis is fine. Splitting the packages keeps the main install fast, lean, and resilient to upstream PyTorch issues, and it lets the separation feature evolve on its own cadence.
Suggested approach
Publish a sibling package phantom-audio-separation that:
Depends on phantom-audio>=1.1.0, demucs, torch, torchaudio.
Exposes the existing phantom.separation module as a plugin (entry-points or a registered subclass).
Move the lazy-imported separation logic out of src/phantom/separation.py into the new package; keep a thin shim in phantom-audio that detects and dispatches to the installed plugin and otherwise raises DependencyMissingError.
Keep the phantom-audio[separation] extra as a meta-installer that pulls phantom-audio-separation for backward compatibility.
pip install phantom-audio produces a wheel with no Torch in the dependency graph (verify via pip install --dry-run or uv pip compile).
pip install 'phantom-audio[separation]' (or pip install phantom-audio-separation) installs both packages and phantom separate works end-to-end.
A test in tests/test_separation.py confirms that without phantom-audio-separation installed, calling separate_stems raises DependencyMissingError with the correct install hint.
phantom doctor reports separation: OK only when the plugin is actually importable.
Problem
phantom-audio[separation]pulls ~2.5 GB of PyTorch + torchaudio + Demucs + model weights. Today this is hidden behind an extras flag, but the dependency tree exists inpyproject.tomlas a first-class option of the main package. That couples the core analysis library's release cadence and platform-support matrix to PyTorch's.Why it's a problem
Most users want analysis first and stem separation later, if at all. PyTorch's platform / Python-version matrix is more restrictive than essentia's, and a bad PyTorch release can cause
pip install phantom-audio[separation]to break even when pure analysis is fine. Splitting the packages keeps the main install fast, lean, and resilient to upstream PyTorch issues, and it lets the separation feature evolve on its own cadence.Suggested approach
phantom-audio-separationthat:phantom-audio>=1.1.0,demucs,torch,torchaudio.phantom.separationmodule as a plugin (entry-points or a registered subclass).src/phantom/separation.pyinto the new package; keep a thin shim inphantom-audiothat detects and dispatches to the installed plugin and otherwise raisesDependencyMissingError.phantom-audio[separation]extra as a meta-installer that pullsphantom-audio-separationfor backward compatibility.phantom doctor(issue Addphantom doctorinstall diagnostic command #3) and the MCP startup preflight (issue Pre-flight optional-dependency imports at MCP server startup #8) to report whether the separation plugin is detected.Verification
pip install phantom-audioproduces a wheel with no Torch in the dependency graph (verify viapip install --dry-runoruv pip compile).pip install 'phantom-audio[separation]'(orpip install phantom-audio-separation) installs both packages andphantom separateworks end-to-end.tests/test_separation.pyconfirms that withoutphantom-audio-separationinstalled, callingseparate_stemsraisesDependencyMissingErrorwith the correct install hint.phantom doctorreportsseparation: OKonly when the plugin is actually importable.