What License Governs NVIDIA Switchyard? Apache 2.0 Explained

TLDR: NVIDIA Switchyard is released under the Apache License, Version 2.0, allowing free use, modification, and distribution with patent protection and a requirement to retain license notices.

NVIDIA Switchyard, the pre-alpha routing engine for large language model traffic from the NVIDIA-NeMo organization, is distributed under the Apache License, Version 2.0. The full license text is available in the repository's top-level LICENSE file, and the README.md explicitly references this license in its License section. This permissive open-source license makes Switchyard suitable for both commercial and research applications, whether you use the Rust server binary, the Python bindings, or embed the routing algorithms directly.

What the Apache 2.0 License Grants You

According to the license text in the LICENSE file at the root of the NVIDIA-NeMo/Switchyard repository, Apache 2.0 provides four key rights and obligations:

  • Freedom to use, modify, and distribute the software in both source and binary forms, under the same license terms.
  • Patent protection from all contributors for the portion of the work they contributed — this shields you from patent litigation related to the code.
  • Obligation to retain the license notice and any NOTICE file in redistributed copies, including derivative works.
  • No warranty or liability — because Switchyard is a pre-alpha project, the license includes a no-warranty disclaimer (see the Disclaimer of Warranty section in the license text), meaning you adopt the software at your own risk.

This means you can integrate Switchyard into proprietary, closed-source products as long as you include a copy of the Apache license and preserve all copyright notices in the source files you ship.

Key Files for Understanding the License and Architecture

The repository structure makes it easy to locate everything you need for compliance and integration:

File Purpose
LICENSE Full Apache 2.0 license text
README.md Project overview, features, and explicit license reference
crates/switchyard-server/README.md Documentation for the standalone server binary
crates/libsy/README.md Guidance on embedding routing algorithms in Rust applications
crates/protocol/README.md Provider-neutral request/response type definitions
switchyard_rust/libsy.py Python façade for the Rust routing library

These files together give a complete picture of Switchyard's licensing, architecture, and how to incorporate it into your own codebases.

Code Examples: Using Switchyard Under the Apache 2.0 License

The following snippets demonstrate typical usage patterns. They assume you have installed the Rust server binary or the Python bindings — both usage patterns are fully permissible under the Apache 2.0 terms.

Starting the Switchyard Server from Python


# Example: Run the Switchyard server from Python (requires the `switchyard-rust` package)

# This code is freely usable under the Apache 2.0 license.

import os
from switchyard_rust.server import run_server

# Ensure your OpenAI-compatible backend keys are set in the environment

os.environ["OPENROUTER_API_KEY"] = "YOUR_KEY_HERE"   # pragma: allowlist secret

# Start the server with a TOML routing configuration

run_server(config_path="routes.toml", host="127.0.0.1", port=4000)

Configuring Routes with TOML

Here is what a minimal routing configuration file looks like:


# routes.toml – a minimal routing configuration (publicly shareable)

[[routes]]
type = "random"
targets = ["openai-gpt4", "nvidia-nim"]
weights = [0.5, 0.5]

Embedding Routing Logic in Rust Applications

You can include the Switchyard routing library directly in your own Rust project:

// Example: Embed Switchyard routing algorithms in a Rust application
// Cargo.toml dependency (Apache 2.0-licensed crate)
// switchyard-libsy = { git = "https://github.com/NVIDIA-NeMo/Switchyard.git", tag = "v0.2.0" }

use switchyard_libsy::algorithms::RandomRouter;

fn main() {
    let router = RandomRouter::new(vec!["backend_a", "backend_b"]);
    // Use `router` to decide which backend to call for each request
}

These examples are fully compliant with the Apache 2.0 license; you may adapt, redistribute, or integrate them into proprietary projects as long as you retain the license notice.

Summary

  • NVIDIA Switchyard is licensed under Apache License 2.0, per the LICENSE file at the repository root.
  • The license permits commercial use, modification, and redistribution, both in source and binary form, with no copyleft obligations.
  • Users must retain the license notice and any NOTICE file in redistributed copies.
  • The license includes a no-warranty disclaimer, so you should validate the pre-alpha software yourself before relying on it in production.

Frequently Asked Questions

Is NVIDIA Switchyard free to use commercially?

Yes. The Apache License 2.0 explicitly permits commercial use, modification, and distribution of the software without requiring you to open-source your own code. You only need to include a copy of the license and retain original copyright notices.

Does the Apache 2.0 license for Switchyard include patent protection?

Yes. Apache 2.0 includes a patent grant clause that licenses any patents held by contributors covering portions of the work they contributed. This protects you from patent infringement claims related to the software.

Do I need to include the license file if I only use a small part of Switchyard?

Yes. The license requires that you retain the license notice, a copy of the license, and any NOTICE file in redistributions — including when you distribute modified versions or incorporate portions of the code into your own projects.

Where can I find the exact license text for Switchyard?

The exact license text is in the top-level LICENSE file of the repository at https://github.com/NVIDIA-NeMo/Switchyard/blob/main/LICENSE. The README.md also references this license in its License section for quick verification.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →