How to Uninstall Switchyard: Complete Removal Guide for Python and Rust Components
Uninstall Switchyard by running pip uninstall nemo-switchyard for the Python bindings and cargo uninstall switchyard-server for the Rust server binary, with optional cleanup of build artifacts using cargo clean and rm -rf target/.
Switchyard, NVIDIA's modular LLM routing framework, distributes two independent artifacts that require separate uninstall procedures. Because the project separates its Python bindings (nemo-switchyard) from its standalone Rust server (switchyard-server), complete removal involves using both pip and cargo package managers. This guide walks through the exact commands and verification steps based on the source structure in the NVIDIA-NeMo/Switchyard repository.
Understanding Switchyard's Dual-Component Architecture
Switchyard's architecture consists of independently installable parts that do not share system-wide files beyond their respective binaries.
-
nemo-switchyard(Python package): Defined in [pyproject.toml](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/pyproject.toml), this package exposes Rust core functionality via PyO3 bindings in [switchyard_rust/_native.py](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/switchyard_rust/_native.py). It installs as a standard Python wheel with a compiled native extension. -
switchyard-server(Rust binary): Documented in [crates/switchyard-server/README.md](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-server/README.md), this standalone HTTP server wraps the routing core defined in [crates/switchyard-server/src/main.rs](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-server/src/main.rs). It installs via Cargo into$HOME/.cargo/bin.
Because these components have no interdependence at the package manager level, you can uninstall either one independently without affecting the other.
Step-by-Step Switchyard Uninstall Instructions
Remove the Python Bindings
Run the following command to remove the nemo-switchyard package and its compiled native extension (_native.*):
pip uninstall -y nemo-switchyard
- If you installed within a virtual environment, activate it first before running the command.
- This command removes all Python modules and metadata but leaves any locally cloned source repositories intact.
Remove the Rust Server Binary
Execute Cargo's uninstall command to delete the switchyard-server executable from Cargo's binary directory (typically $HOME/.cargo/bin):
cargo uninstall switchyard-server
- This reverses the installation performed by
cargo install --locked switchyard-serveras referenced in the server's documentation. - If you built from source using
cargo build --releaseoruv run maturin develop, proceed to the optional cleanup step.
Clean Build Artifacts (Optional)
If you compiled Switchyard from source, remove leftover build directories from the repository root:
cargo clean
rm -rf target/
cargo cleanremoves compiled Rust artifacts from the workspace.- Deleting the
target/directory ensures no debug or release binaries remain.
Verify Complete Removal
Confirm successful uninstallation by checking for residual components:
# Verify Python package removal
python -c "import importlib.util; print('nemo-switchyard absent' if importlib.util.find_spec('nemo_switchyard') is None else 'Still installed')"
# Verify Rust binary removal
which switchyard-server && echo "Server still installed" || echo "Server uninstalled"
Both commands should indicate that the respective artifacts are no longer present on your system.
Key Source Files and Package Metadata
Understanding the source layout helps confirm what each uninstall command removes:
| Component | Key Source File | Role |
|---|---|---|
| Python package metadata | [pyproject.toml](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/pyproject.toml) |
Declares nemo-switchyard package configuration and dependencies |
| Python-Rust bridge | [switchyard_rust/_native.py](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/switchyard_rust/_native.py) |
Entry point for PyO3 bindings that gets removed with the Python package |
| Rust workspace root | [Cargo.toml](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/Cargo.toml) |
Defines the switchyard-server crate among others |
| Server implementation | [crates/switchyard-server/src/main.rs](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-server/src/main.rs) |
Contains the main() function for the standalone HTTP server |
| Core routing library | [crates/libsy/src/lib.rs](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/libsy/src/lib.rs) |
Implements the routing algorithms compiled into both the Python extension and server binary |
Summary
- Switchyard distributes two separate artifacts: the Python package
nemo-switchyardand the Rust binaryswitchyard-server. - Use
pip uninstall nemo-switchyardto remove Python bindings and the compiled native extension. - Use
cargo uninstall switchyard-serverto remove the standalone HTTP server from Cargo's binary path. - Run
cargo cleanandrm -rf target/to eliminate build artifacts when uninstalling from a source checkout. - Verify removal with
python -cimport checks andwhich switchyard-serverto ensure complete cleanup.
Frequently Asked Questions
Do I need to uninstall the Python package before the Rust server?
No. Because nemo-switchyard and switchyard-server are independent artifacts with no package-level dependencies according to the source code in NVIDIA-NeMo/Switchyard, you can uninstall them in either order. The Python bindings do not require the server binary to be present, and the server operates independently of the Python package.
Will uninstalling Switchyard delete my routing configuration files?
No. The uninstall commands only remove the binaries and Python packages defined in pyproject.toml and the Cargo manifest. The switchyard-server loads TOML routing configurations at runtime from paths you specify, and these user-created config files remain on your filesystem unless you manually delete them.
How do I completely remove Switchyard if I installed it from a Git clone?
First run pip uninstall -y nemo-switchyard and cargo uninstall switchyard-server from within your virtual environment or system path. Then navigate to your clone directory and run cargo clean followed by rm -rf target/ to remove all compiled artifacts. Finally, delete the repository directory with rm -rf /path/to/Switchyard to remove all source code and residual build files.
Can I reinstall Switchyard after uninstalling without rebuilding from source?
Yes. You can reinstall the Python bindings at any time using pip install nemo-switchyard and the server using cargo install --locked switchyard-server exactly as specified in the project's installation documentation. These commands pull pre-built wheels and crates from the package registries, requiring no local compilation unless you specifically install from a source checkout.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →