flodl-cli
fdl is the command-line tool for the floDl Rust
deep-learning framework. It drives first-time setup, libtorch management,
project scaffolding, hardware diagnostics, shell completions, and the
declarative project manifest (fdl.yml) used to dispatch training jobs,
DDP runs, and tooling inside a flodl workspace.
It is a pure-Rust binary with zero native dependencies. No libtorch, no Python, and no Rust toolchain required to install. The CLI stays useful even before anything else is set up, which is the whole point.
&&
See the
full CLI reference
for every command, flag, and the fdl.yml manifest format.
Design principles
- Pure Rust, zero external crate deps beyond serde. ~750KB static binary. Compiles in under a second. No C++, no libtorch linking.
- Cross-platform. Linux x86_64/aarch64, macOS arm64, Windows x86_64.
- GPU-aware by default. Probes
nvidia-smi, maps CUDA architectures to the right pre-built variant, warns when no single pre-built variant covers your hardware. - Multi-variant aware. Install CPU, cu126, cu128, and custom source
builds side-by-side. Switch the active variant in one command; everything
reading
.activefollows automatically. - Graceful degradation. Works fine without a GPU, without Docker, without an internet connection once variants are cached.
- Project-aware but not project-locked. Inside a flodl project,
fdlfinds the project root and uses./libtorch/. Standalone, it uses~/.flodl/libtorch/(override with$FLODL_HOME).
What fdl provides
Before you have a project
fdl setup- guided wizard: detect hardware, pick the right libtorch variant, configure Docker or native builds, optionally build images.fdl init <name>- scaffold a new flodl project with an annotated training template, Dockerfile,fdl.yml, and a.gitignore. The generated project uses the mounted-libtorch pattern by default; add--dockerto bake libtorch into the image instead.fdl libtorch …- install, list, switch, remove, and source-build libtorch variants (covered in detail below).fdl diagnose- hardware and compatibility report.
In any project that has a fdl.yml
The fdl.yml manifest turns fdl into a project task runner. It applies
equally to the flodl source checkout and to anything you scaffolded with
fdl init, as long as a fdl.yml sits at the project root (or above).
- Manifest-driven commands.
fdl.ymldeclares acommands:map; each entry is either arun:shell script (optionally wrapped indocker compose run --rm <service>viadocker:), apath:pointer to a nested sub-project with its ownfdl.yml, or a preset that merges structured config over an enclosingentry:. Replaces the oldmake/docker composeworkflow. - Environment overlays.
fdl --env ci testloadsfdl.ci.ymlon top of the base config;FDL_ENV=ciand first-arg conventions work too.fdl config show [env]prints the resolved merged config with per-layer annotations. - Shell completions.
fdl completions bash|zsh|fishemits a project-aware completion script covering every built-in plus every command declared in the currentfdl.yml. Flag completion is value-aware (--cuda <TAB>offers12.6 12.8from thechoices:declaration). - Schema introspection for your binaries. Any binary built with
#[derive(flodl_cli::FdlArgs)]responds to--fdl-schemawith a JSON description of its flags;fdl schema list/clear/refreshmanages the cache that powers project-aware help and completion. The derive lives in theflodl-cli-macroscrate (re-exported here) -- see its README or the CLI reference for the full attribute surface and a worked example.
In the flodl source checkout specifically
The flodl repo ships its own fdl.yml with commands like fdl test,
fdl cuda-test, fdl clippy, fdl shell, and the fdl ddp-bench
sub-project for DDP validation runs. These are concrete examples of the
manifest format, not built into the CLI. Your scaffolded project starts
with a minimal fdl.yml and grows its own command set as needed.
Also useful standalone: libtorch for any PyTorch / tch-rs project
The libtorch-management and diagnostics commands are independent of flodl
and handle a gap PyTorch itself never filled: a proper installer. fdl
works as a drop-in libtorch manager for:
- tch-rs projects - download the right libtorch, point
LIBTORCHat it, build. No more hand-fetching URLs from the PyTorch get-started page. - PyTorch C++ development - juggle CPU, CUDA 12.6, CUDA 12.8, and source-built variants on the same host without symlink choreography.
- Mixed-GPU systems - when no single pre-built variant covers your
architectures (e.g. GTX 1060 sm_61 + RTX 5060 Ti sm_120),
fdl libtorch buildcompiles PyTorch from source with the exact archs you need. Docker-isolated by default, native toolchain supported. - CI pipelines -
fdl diagnose --jsonemits a machine-readable hardware and compatibility report to gate jobs on GPU presence or libtorch version.
Standalone example with tch-rs
# precompiled/cu128 (active)
Standalone example with PyTorch C++ (libtorch)
# precompiled/cu128 (active)
# Point CMake at the active variant
Switching variants for different projects
Install
From crates.io (requires Rust):
Pre-compiled binaries (no Rust needed):
&&
Binaries are published for Linux x86_64/aarch64, macOS arm64, and Windows x86_64 on every GitHub Release.
Command tour
libtorch management
Source builds for custom architectures
Docker builds resume via layer cache if interrupted. Output lands in
libtorch/builds/<arch-signature>/.
Diagnostics
Reports CPU, OS (with WSL2 detection), Docker version, CUDA driver, per-GPU architecture and VRAM, active libtorch metadata, and per-GPU compatibility with the active variant.
GPU auto-detection
fdl libtorch download reads nvidia-smi and maps compute capabilities to
the right pre-built variant:
| Your hardware | Variant chosen | Covers |
|---|---|---|
| No GPU | CPU | any host |
| Pre-Volta only (sm_50 - sm_61) | cu126 | sm_50 - sm_90 |
| Volta+ only (sm_70+) | cu128 | sm_70 - sm_120 |
| Mixed archs | cu126 + hint | run build |
Override with --cpu or --cuda <version>.
Links
- Full CLI reference - every command, every flag, with examples
- floDl framework - the Rust deep learning framework
fdlwas built for - GitHub Releases - pre-compiled binaries
- GitHub repository
License
floDl is open-sourced software licensed under the MIT license.