
Domain Ml
This is a Layer 3 domain constraint reference for building ML/AI applications in Rust. It maps ML requirements like memory efficiency and GPU utilization directly to Rust patterns, showing you why batching matters for GPUs, when to use tract versus candle versus tch-rs, and how to avoid copying giant tensors around. The code samples are practical: inference servers with OnceLock for model singletons, batched prediction pipelines, and async data loading to keep GPUs fed. It's narrow in scope but information-dense, assuming you already know the Layer 1 and Layer 2 fundamentals and just need the ML-specific constraints translated into concrete Rust decisions.
- skills.sh installs
- 3K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add actionbook/rust-skills --skill domain-ml --agent claude-codeInstalls into .claude/skills of the current project.
Files
Machine Learning Domain
Layer 3: Domain Constraints
Domain Constraints → Design Implications
| Domain Rule | Design Constraint | Rust Implication |
|---|---|---|
| Large data | Efficient memory | Zero-copy, streaming |
| GPU acceleration | CUDA/Metal support | candle, tch-rs |
| Model portability | Standard formats | ONNX |
| Batch processing | Throughput over latency | Batched inference |
| Numerical precision | Float handling | ndarray, careful f32/f64 |
| Reproducibility | Deterministic | Seeded random, versioning |
Critical Constraints
Memory Efficiency
RULE: Avoid copying large tensors
WHY: Memory bandwidth is bottleneck
RUST: References, views, in-place ops
GPU Utilization
RULE: Batch operations for GPU efficiency
WHY: GPU overhead per kernel launch
RUST: Batch sizes, async data loading
Model Portability
RULE: Use standard model formats
WHY: Train in Python, deploy in Rust
RUST: ONNX via tract or candle
Trace Down ↓
From constraints to design (Layer 2):
Sponsors
Details
- Repository
- github.com/actionbook/rust-skills
- Categories
- Data Science & ML, Rust
- First seen
- Jun 3, 2026
More from actionbook/rust-skills
All 38- Domain Iot2.9K
- Rust Router2.9K
- Core Agent Browser2.2K
- Core Dynamic Skills2K
- Core Actionbook2K
- Core Fix Skill Docs2K
- M15 Anti Pattern9.3K
- Coding Guidelines4.2K
- M10 Performance3.8K
- M07 Concurrency3.7K
- M06 Error Handling3.7K
- M01 Ownership3.6K
- M04 Zero Cost3.6K
- M05 Type Driven3.6K
- M02 Resource3.6K
- M03 Mutability3.6K
- Rust Refactor Helper3.6K
- M12 Lifecycle3.5K
- M09 Domain3.5K
- M14 Mental Model3.5K
- M11 Ecosystem3.5K
- M13 Domain Error3.5K
- Unsafe Checker3.5K
- Rust Code Navigator3.4K