This is your Layer 3 constraint reference for when you're building ML/AI apps in Rust and need to make the right tradeoffs. It maps domain rules like "large data means efficient memory" to concrete Rust implications like zero-copy views and streaming. The big win here is the decision matrix: it tells you tract for ONNX inference-only cases, candle or burn when you need training, tch-rs for PyTorch models. Includes patterns for model singletons with OnceLock and batched inference for GPU efficiency. The "trace down" section connects ML constraints to the right Layer 2 modules, so you're not guessing which skill to reach for when you need async data loading or lazy evaluation.

skills.sh installs
573
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill domain-ml --agent claude-code

Installs into .claude/skills of the current project.

Files

Machine Learning Domain

Layer 3: Domain Constraints

Domain Constraints → Design Implications

Domain RuleDesign ConstraintRust Implication
Large dataEfficient memoryZero-copy, streaming
GPU accelerationCUDA/Metal supportcandle, tch-rs
Model portabilityStandard formatsONNX
Batch processingThroughput over latencyBatched inference
Numerical precisionFloat handlingndarray, careful f32/f64
ReproducibilityDeterministicSeeded 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/zhanghandong/rust-skills
Categories
Data Science & ML, Rust
First seen
May 16, 2026

More from zhanghandong/rust-skills

All 34
1davila7 avatarresearch-lookupdavila7/claude-code-templatesLook up current research information using Perplexity's Sonar Pro Search or Sonar Reasoning Pro models through OpenRouter. Automatically selects the best model 567skills.sh installs
2galaxy-dawn avatarresearch-ideationgalaxy-dawn/claude-scholarThis skill should be used when the user asks to "brainstorm research ideas", "use 5W1H framework", "identify research gaps", "conduct gap analysis", "start rese548skills.sh installs
3longbridge avatarlongbridge-factor-researchlongbridge/skillsFactor research framework for evaluating single-factor effectiveness across A-shares, HK, and US stocks — information coefficient (IC), information ratio (IR), 514skills.sh installs
4openclaudia avatarsemrush-researchopenclaudia/openclaudia-skillsSEO and competitive intelligence via the SemRush API. Use when asked to research competitors, analyze domains, find keyword opportunities, check backlinks, or e497skills.sh installs
5manutej avatarpandasmanutej/luxor-claude-marketplaceExpert data analysis and manipulation for customer support operations using pandas470skills.sh installs
6bahayonghang avatarindustrial-ai-researchbahayonghang/academic-writing-skillsIndustrial AI literature research with mandatory intake questions, venue-aware source prioritization, structured report outputs, and survey draft generation. Us469skills.sh installs