# Switchyard Development Dependencies: A Complete Guide to the Rust and Python Toolchain

> Master Switchyard development dependencies with our guide to the Rust and Python toolchain. Learn about Rust crates like tokio, axum, serde, pyo3, and Python's pytest for efficient development.

- Repository: [NVIDIA-NeMo/Switchyard](https://github.com/NVIDIA-NeMo/Switchyard)
- Tags: getting-started
- Published: 2026-08-23

---

**TLDR: Switchyard development requires a dual-language toolchain — a Rust core with `tokio`, `axum`, `serde`, and `pyo3`, plus a Python layer that needs only `pytest ≥ 9.0.3` for testing, since the published wheel ships as a compiled PyO3 extension.**

Switchyard, from the NVIDIA-NeMo organization, is a system that connects language model agents to tools through a routing server. What makes its dependency profile unique is its **dual-language architecture**: the heavy lifting of request routing, tool discovery, and asynchronous serving happens in **Rust**, while a thin **Python façade** lets developers interact with that Rust core through the Pyo3 binding. Because of this split, the requirements for Switchyard development live in two separate ecosystems, which you'll need to understand fully before you can build, test, or extend the project.

## Switchyard Development: A Dual-Language Architecture

The first thing to know about Switchyard's dependencies is that they are not uniform. The project is divided into a **Rust workspace** containing multiple crates and a **Python wrapper** built with PyO3. The top-level [`Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/Cargo.toml) at the repository root defines the Rust workspace, while individual crates under `crates/` declare their own runtime and build dependencies.

This means a developer must be comfortable with both `cargo` and `pip` ecosystems. The **runtime dependencies** are all implemented in Rust; the Python side exposes them without requiring any external Python runtime packages.

## Rust Core Dependencies for the Switchyard Server

The heart of Switchyard is the async Rust server. It relies on a well-established set of crates found in the workspace's [`Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/Cargo.toml) files.

**Async runtime** — the foundation of the entire server. `tokio` is used everywhere in the codebase for async I/O, timers, and concurrent task management. You'll find it declared in the root [`Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/Cargo.toml) (at line 46 of the main workspace file) and it is fundamental to the routing engine that handles concurrent tool invocation requests.

**HTTP framework** — `axum` is the web framework powering the native server. It's declared in [`crates/switchyard-server/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-server/Cargo.toml) at line 22. For production TLS support, `axum-server` is also required (line 23 of the same file), enabling secure connections through the server.

**Serialization** — `serde` and `serde_json` handle the de/serialization of tool schemas, JSON payloads, and routing configurations. These are listed in [`crates/libsy/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/libsy/Cargo.toml) at lines 21–22. Serde enables the strict type mapping that keeps the Rust and Python data exchange predictable.

**PyO3 bridge** — the entire Python façade depends on `pyo3` (the binding library) and `pyo3-async-runtimes` (which integrates PyO3 with the async runtime so Python can await Rust futures). Both are declared in [`crates/switchyard-py/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-py/Cargo.toml) at line 23.

```toml

# crates/switchyard-server/Cargo.toml (excerpt)

[dependencies]
axum = { version = "…", features = […] }
axum-server = { version = "…", features = ["tls-rustls"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
pyo3 = "0.20"
pyo3-async-runtimes = { version = "0.20", features = ["tokio"] }

```

These three crates (`switchyard-server`, `libsy`, `switchyard-py`) are the main places you'll interact with when adding new protocol handlers, new routing logic, or new Python-facing functions.

## Python Layer Dependencies: Minimal by Design

The Python side of Switchyard is deliberately minimal. According to the project source, **no external runtime packages are required** to use the published wheel. The wheel ships as a compiled PyO3 extension; when you import `switchyard`, you're importing that native module plus a few pure-Python helper utilities.

For **development**, however, you do need one tool:

- **`pytest >= 9.0.3`** — this is the only Python-dev environment requirement. All the test suite is written with `pytest` and relies on its fixtures and async support to drive the routing tests that push requests through the Rust core.

Open a command-line, create a virtual environment, and run:

```bash
pip install pytest

```

The absence of a [`requirements.txt`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/requirements.txt) or [`pyproject.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/pyproject.toml) with heavy dependencies on the Python side (like `numpy` or `requests`) is intentional. The project team keeps the Python facade free of third-party runtime packages, so deployment is as simple as the extra burden beyond installing the wheel.

## Where To Find the Dependency Declarations

If you're exploring the repository directly, you'll want to check these specific files to see exact versions, feature flags, and any platform-specific hooks:

- **[`Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/Cargo.toml)** — the workspace root at the top of the repo. Line 46 contains the `tokio` declaration that ties the workspace together.
- **[`crates/switchyard-server/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-server/Cargo.toml)** — declares `axum` (line 22) and `axum-server` (line 23), the server runtime and its TLS module.
- **[`crates/libsy/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/libsy/Cargo.toml)** — holds `serde` and `serde_json` (lines 21–22). This is the shared library for router logic, so any new protocol message will touch this crate.
- **[`crates/switchyard-py/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-py/Cargo.toml)** — at line 23, you'll find `pyo3` and `pyo3-async-runtimes`. This file is the contract between Python and Rust.
- **[`pyproject.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/pyproject.toml)** — the Python packaging file that declares the build system and the `pytest` dev dreq.

```bash
grep -r "tokio\|axum\|pyo3" Cargo.toml crates/*/Cargo.toml

```

## Summary

- **Switchyard is a dual-language project**: a Rust core responsible for the server, routing, and protocol, with a thin Python facade via Pyo3.
- **The Rust core** depends on `tokio` (async runtime), `axum` (HTTP server), `serde`/`serde_json` (serialization), and `pyo3`/`pyo3-async-runtimes` (Python bridge).
- **The Python layer** has **no runtime dependencies** in the published wheel;  `pytest ≥ 9.0.3` is the only development-time tool, which you install to run the test suite.
- Key manifest files to read are the workspace [`Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/Cargo.toml), [`crates/switchyard-server/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-server/Cargo.toml), [`crates/libsy/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/libsy/Cargo.toml), and [`crates/switchyard-py/Cargo.toml`](https://github.com/NVIDIA-NeMo/Switchyard/blob/main/crates/switchyard-py/Cargo.toml).

## Frequently Asked Questions

#### Does Switchyard require a specific Rust version?

Yes — because of the async runtimes and PyO3 integrations, you need a recent stable Rust toolchain. Folks have reported being on stable 1.70+ works with the existing crate versions, but you should consult the project's CI configuration (usually `.github/workflows`) for the exact pinned version that the maintainers run against.

#### Can I run Switchyard without the Rust code?

No. The published Python wheel is a compiled extension, meaning the Rust code is compiled into the binary you like. There is no pure-Python fallback implementation. If you install Switchyard from PyPI, you're getting the Rust executable packaged inside; if you build from source, you must have both `cargo` and `pip` working together.

#### On which platforms does Switchyard's Python binding run?

Because Pyo3 compiles the modules against the `abi3` stable ABI, the wheel supports Python 3.8 through the latest on Linux, macOS, and Windows, given that you have the appropriate Rust target toolchain to build the wheel for each platform. The NVIDIA public package on PyPI publishes multi-platform wheels, so you rarely need to build yourself.

#### Do I need Docker for the development environment?

Docker is **not required** for core development. The only mandatory tools are `cargo` (Rust), `python` + `pytest`, and a C compiler. If you need to run a full agent routing test suite, some systems rely on a Redis, but those are only needed by your actual application, not the Switchyard library itself.