BYTES AND BRAINS v0.3.0 . CRATES.IO
UPLINK OK
guide/02.1 . install // SOURCE: README.md + Cargo.toml @ 0.3.0
Chapter 2

Install

bytesandbrains is published on crates.io. A single dependency line pulls the framework facade, which re-exports every public surface across the six workspace crates.

Toolchain

The crate targets the stable Rust toolchain. The minimum supported version is 1.86. Check yours:

rustc --version
# rustc 1.86.0 (...) or newer.

Update if needed:

rustup update stable

Add the dependency

In a fresh project:

cargo new my_node
cd my_node
cargo add bytesandbrains

In an existing Cargo.toml:

[dependencies]
bytesandbrains = "0.3"

cargo add resolves the latest 0.3.x release on crates.io and pins it into Cargo.toml. The default feature set enables cpu-backend, which surfaces the reference CpuBackend at bytesandbrains::ops::backends::cpu::CpuBackend. The first chapter example in Getting Started depends on it.

Other published features:

  • tracing-otel: opt-in OpenTelemetry exporter for the engine’s tracing:: spans. Constructors live at bytesandbrains::telemetry::otel.
  • test-components: ships the bundled KademliaHand test component plus the engine’s install_graph_for_test / op_ref_at introspection seams. Useful for integration tests that exercise the framework’s reference protocols.

For a no-default-features build, supply your own Backend impl and bind it at compile time:

[dependencies]
bytesandbrains = { version = "0.3", default-features = false }
use bytesandbrains::Compiler;

// `MyBackend` is your own concrete: `#[derive(bb::Concrete, bb::Backend)]`
// then implement the `bb::Backend` Contract trait. See the Roles chapter.
let _compiler = Compiler::new().bind_backend::<MyBackend>("compute");

Verify the install

A one-file program that confirms the framework compiles and links:

use bytesandbrains::ops::backends::cpu::CpuBackend;

fn main() {
    let _backend = CpuBackend::default();
    println!("bytesandbrains compiled and linked.");
}

cargo run prints the message. The next chapter walks one example end to end.

The crate family in 0.3

The umbrella bytesandbrains crate re-exports the workspace surface. You almost never depend on the inner crates directly.

CrateWhat it ships
bytesandbrainsThe framework facade. Re-exports the six workspace crates. The default cpu-backend feature surfaces CpuBackend at ops::backends::cpu::CpuBackend.
bb-irFoundation: ONNX-flavored ModelProto, GraphProto, NodeProto, the TypeNode polymorphism tree, the Storage trait, the wire envelope.
bb-runtimeEngine, Node, role-runtime traits, completion handles, the seven user-facing Contract traits (Backend, Index, Aggregator, Model, DataSource, Codec, PeerSelector).
bb-dslModule trait, Graph recorder, syscalls.
bb-compilerThe canonical compilation pipeline + Compiler driver + CompileError.
bb-deriveProc-macros: #[derive(bb::Concrete)], #[derive(bb::<Role>)], register_op!{}, register_protocol!{}.
bb-opsEvery concrete component the framework ships: CpuBackend, FedAvg, the GlobalRegistry peer-sampling protocols, the wire transport.

Built-in transports (bb-libp2p, bb-http) are not part of 0.3. Standalone transport crates ship in a later release.

License

bytesandbrains is dual-licensed under AGPL-3.0-or-later and a commercial license. Open-source use under the AGPL applies for most projects. Commercial deployments that need an alternative see the license page.

Build from source (contributors)

Contributors and anyone who wants to track main between releases can clone the workspace and depend on a path or a git revision instead of crates.io.

Clone:

git clone https://github.com/Bytes-Brains/bytesandbrains
cd bytesandbrains
cargo test --workspace --features test-components

Path dependency from a sibling project:

[dependencies]
bytesandbrains = { path = "../bytesandbrains" }

Or pin to a tag:

[dependencies]
bytesandbrains = { git = "https://github.com/Bytes-Brains/bytesandbrains", tag = "v0.3.0" }

The per-commit gate the workspace expects is documented in CLAUDE.md: cargo fmt, cargo test --workspace --features test-components, cargo clippy -- -D warnings, cargo doc, cargo check --no-default-features, and cargo deny check.