zhanghandong/rust-skills/domain-ml
Claude Code and agent skill by zhanghandong/rust-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Use when building ML/AI apps in Rust. Keywords: machine learning, ML, AI, tensor, model, inference, neural network, deep learning, training, prediction, ndarray, tch-rs, burn, candle, 机器学习, 人工智能, 模型推理
Install
npx vskill@latest install zhanghandong/rust-skills/domain-mlSKILL.md
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
GPU Utilization
Model Portability
Trace Down ↓
From constraints to design (Layer 2):
Use Case → Framework
| Use Case | Recommended | Why | |
|---|---|---|---|
| Inference only | tract (ONNX) | Lightweight, portable | |
| Training + inference | candle, burn | Pure Rust, GPU | |
| PyTorch models | tch-rs | Direct bindings | |
| Data pipelines | polars | Fast, lazy eval |
Key Crates
| Purpose | Crate | |
|---|---|---|
| Tensors | ndarray | |
| ONNX inference | tract | |
| ML framework | candle, burn | |
| PyTorch bindings | tch-rs | |
| Data processing | polars | |
| Embeddings | fastembed |
Design Patterns
| Pattern | Purpose | Implementation | |
|---|---|---|---|
| Model loading | Once, reuse | OnceLock<Model> | |
| Batching | Throughput | Collect then process | |
| Streaming | Large data | Iterator-based | |
| GPU async | Parallelism | Data loading parallel to compute |
Code Pattern: Inference Server
Code Pattern: Batched Inference
Common Mistakes
| Mistake | Domain Violation | Fix | |
|---|---|---|---|
| Clone tensors | Memory waste | Use views | |
| Single inference | GPU underutilized | Batch processing | |
| Load model per request | Slow | Singleton pattern | |
| Sync data loading | GPU idle | Async pipeline |
Trace to Layer 1
| Constraint | Layer 2 Pattern | Layer 1 Implementation | |
|---|---|---|---|
| Memory efficiency | Zero-copy | ndarray views | |
| Model singleton | Lazy init | OnceLock<Model> | |
| Batch processing | Chunked iteration | chunks() + parallel | |
| GPU async | Concurrent loading | tokio::spawn + GPU |
Related Skills
| When | See | |
|---|---|---|
| Performance | m10-performance | |
| Lazy initialization | m12-lifecycle | |
| Async patterns | m07-concurrency | |
| Memory efficiency | m01-ownership |
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/domain-ml/SKILL.md
Popularity
- Repository stars
- 925
- Repository forks
- 84
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zhanghandong/rust-skills/domain-ml)