Skip to content

Commit e8aab46

Browse files
rlaopeclaude
andcommitted
Initial implementation of airML - Lightweight ML Runtime
A Rust-based ML inference runtime that runs ONNX models without Python. Features: - Single binary deployment (~1MB, expandable with ONNX Runtime) - Fast cold start - Apple Silicon/Metal acceleration support (via CoreML feature) - ONNX model support Project structure: - airml-core: Inference engine with ONNX Runtime integration - airml-preprocess: Image preprocessing (ImageNet, CLIP, YOLO presets) - airml-providers: Execution providers (CPU, CoreML) - airml-embed: Model embedding utilities for include_bytes! - CLI: run, info, bench, system commands Phase 1 MVP (CPU-based) complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit e8aab46

36 files changed

Lines changed: 2827 additions & 0 deletions

.cargo/config.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Apple Silicon 빌드 최적화
2+
[target.aarch64-apple-darwin]
3+
rustflags = [
4+
"-C", "target-cpu=native",
5+
"-C", "link-arg=-undefined",
6+
"-C", "link-arg=dynamic_lookup",
7+
]
8+
9+
[target.x86_64-apple-darwin]
10+
rustflags = ["-C", "target-cpu=native"]
11+
12+
# Linux
13+
[target.x86_64-unknown-linux-gnu]
14+
rustflags = ["-C", "target-cpu=native"]
15+
16+
# 빌드 최적화
17+
[build]
18+
jobs = 8
19+
20+
[env]
21+
# ORT 동적 라이브러리 경로 (필요시 설정)
22+
# ORT_DYLIB_PATH = "/path/to/libonnxruntime.dylib"

.gitattributes

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Rust source files
5+
*.rs text eol=lf diff=rust
6+
*.toml text eol=lf
7+
8+
# Shell scripts
9+
*.sh text eol=lf
10+
11+
# Markdown
12+
*.md text eol=lf diff=markdown
13+
14+
# YAML
15+
*.yml text eol=lf
16+
*.yaml text eol=lf
17+
18+
# JSON
19+
*.json text eol=lf
20+
21+
# Ignore generated files in linguist
22+
Cargo.lock linguist-generated=true
23+
target/ linguist-generated=true
24+
25+
# Binary files
26+
*.onnx binary
27+
*.pt binary
28+
*.bin binary
29+
*.png binary
30+
*.jpg binary
31+
*.jpeg binary
32+
33+
# Exclude from export
34+
.github export-ignore
35+
.gitattributes export-ignore
36+
.gitignore export-ignore

.github/CONTRIBUTING.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Contributing to airML
2+
3+
Thank you for your interest in contributing to airML!
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- Rust 1.75 or later
10+
- ONNX Runtime (for testing)
11+
12+
### Building
13+
14+
```bash
15+
# Clone the repository
16+
git clone https://github.com/airml/airml.git
17+
cd airml
18+
19+
# Build in debug mode
20+
cargo build
21+
22+
# Build in release mode
23+
cargo build --release
24+
25+
# Run tests
26+
cargo test
27+
28+
# Run clippy
29+
cargo clippy --all-features
30+
31+
# Format code
32+
cargo fmt
33+
```
34+
35+
## Development Workflow
36+
37+
1. **Fork** the repository
38+
2. **Create a branch** for your changes
39+
3. **Make your changes** with clear, atomic commits
40+
4. **Write tests** for new functionality
41+
5. **Run tests and lints** before submitting
42+
6. **Submit a pull request**
43+
44+
## Code Style
45+
46+
- Follow Rust standard style (enforced by `rustfmt`)
47+
- Use meaningful variable and function names
48+
- Write doc comments for public APIs
49+
- Keep functions focused and small
50+
51+
## Commit Messages
52+
53+
Use conventional commits format:
54+
55+
```
56+
type(scope): short description
57+
58+
Longer description if needed.
59+
```
60+
61+
Types:
62+
- `feat`: New feature
63+
- `fix`: Bug fix
64+
- `docs`: Documentation
65+
- `refactor`: Code refactoring
66+
- `test`: Adding tests
67+
- `chore`: Maintenance tasks
68+
69+
Examples:
70+
```
71+
feat(core): add support for dynamic input shapes
72+
fix(preprocess): handle images with alpha channel
73+
docs(readme): add installation instructions
74+
```
75+
76+
## Pull Request Guidelines
77+
78+
- Keep PRs focused on a single change
79+
- Update documentation if needed
80+
- Add tests for new functionality
81+
- Ensure CI passes
82+
- Request review from maintainers
83+
84+
## Architecture Overview
85+
86+
```
87+
airML/
88+
├── crates/
89+
│ ├── airml-core/ # Core inference engine
90+
│ │ ├── engine.rs # InferenceEngine
91+
│ │ ├── session.rs # Session configuration
92+
│ │ └── error.rs # Error types
93+
│ │
94+
│ ├── airml-preprocess/ # Input preprocessing
95+
│ │ ├── image.rs # Image preprocessing
96+
│ │ └── text.rs # Text tokenization
97+
│ │
98+
│ ├── airml-providers/ # Execution providers
99+
│ │ ├── cpu.rs # CPU provider
100+
│ │ └── coreml.rs # CoreML provider
101+
│ │
102+
│ └── airml-embed/ # Model embedding
103+
104+
└── src/ # CLI binary
105+
├── main.rs # Entry point
106+
├── cli.rs # Clap definitions
107+
└── commands/ # Command implementations
108+
```
109+
110+
## Adding a New Execution Provider
111+
112+
1. Create a new file in `crates/airml-providers/src/`
113+
2. Implement the provider configuration
114+
3. Add to feature flags in `Cargo.toml`
115+
4. Export in `lib.rs`
116+
5. Add to auto-selection logic
117+
118+
## Adding a New Preprocessing Mode
119+
120+
1. Add configuration in `crates/airml-preprocess/src/image.rs`
121+
2. Implement the preprocessing logic
122+
3. Add a constructor method (e.g., `ImagePreprocessor::new_mode()`)
123+
4. Add to CLI preset options
124+
125+
## Questions?
126+
127+
Open a [Discussion](https://github.com/airml/airml/discussions) for questions or ideas.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
labels: ["bug", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Description
14+
description: A clear and concise description of what the bug is.
15+
placeholder: Describe the bug...
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: reproduction
21+
attributes:
22+
label: Steps to Reproduce
23+
description: Steps to reproduce the behavior.
24+
placeholder: |
25+
1. Run command `airml ...`
26+
2. See error
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: expected
32+
attributes:
33+
label: Expected Behavior
34+
description: What you expected to happen.
35+
placeholder: Describe what you expected...
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: actual
41+
attributes:
42+
label: Actual Behavior
43+
description: What actually happened.
44+
placeholder: Describe what actually happened...
45+
validations:
46+
required: true
47+
48+
- type: input
49+
id: version
50+
attributes:
51+
label: airML Version
52+
description: Output of `airml --version`
53+
placeholder: "0.1.0"
54+
validations:
55+
required: true
56+
57+
- type: dropdown
58+
id: os
59+
attributes:
60+
label: Operating System
61+
options:
62+
- macOS (Apple Silicon)
63+
- macOS (Intel)
64+
- Linux (x86_64)
65+
- Windows
66+
- Other
67+
validations:
68+
required: true
69+
70+
- type: textarea
71+
id: system-info
72+
attributes:
73+
label: System Information
74+
description: Output of `airml system`
75+
render: shell
76+
placeholder: |
77+
System Information
78+
==================
79+
Operating System: macos
80+
Architecture: aarch64
81+
...
82+
83+
- type: textarea
84+
id: logs
85+
attributes:
86+
label: Relevant Logs
87+
description: Any error messages or logs.
88+
render: shell
89+
90+
- type: textarea
91+
id: additional
92+
attributes:
93+
label: Additional Context
94+
description: Any other context about the problem.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Question
4+
url: https://github.com/airml/airml/discussions/new?category=q-a
5+
about: Ask questions in GitHub Discussions
6+
- name: Documentation
7+
url: https://github.com/airml/airml#readme
8+
about: Read the documentation
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
labels: ["enhancement"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for suggesting a feature!
9+
10+
- type: textarea
11+
id: problem
12+
attributes:
13+
label: Problem Statement
14+
description: What problem does this feature solve?
15+
placeholder: I'm always frustrated when...
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: solution
21+
attributes:
22+
label: Proposed Solution
23+
description: Describe the solution you'd like.
24+
placeholder: It would be great if airML could...
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: alternatives
30+
attributes:
31+
label: Alternatives Considered
32+
description: Describe any alternative solutions you've considered.
33+
34+
- type: dropdown
35+
id: category
36+
attributes:
37+
label: Category
38+
options:
39+
- CLI / UX
40+
- Performance
41+
- New Model Support
42+
- New Execution Provider
43+
- Preprocessing
44+
- Documentation
45+
- Other
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
id: additional
51+
attributes:
52+
label: Additional Context
53+
description: Any other context, mockups, or references.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Description
2+
3+
<!-- Brief description of what this PR does -->
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change that fixes an issue)
8+
- [ ] New feature (non-breaking change that adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Refactoring (no functional changes)
12+
13+
## Related Issues
14+
15+
<!-- Link any related issues: Fixes #123 -->
16+
17+
## Changes Made
18+
19+
<!-- List the specific changes made -->
20+
21+
-
22+
23+
## Testing
24+
25+
<!-- Describe how you tested your changes -->
26+
27+
- [ ] Unit tests pass (`cargo test`)
28+
- [ ] Clippy passes (`cargo clippy --all-features`)
29+
- [ ] Formatting passes (`cargo fmt --check`)
30+
- [ ] Manual testing done
31+
32+
## Checklist
33+
34+
- [ ] Code follows the project style guidelines
35+
- [ ] Self-review of code completed
36+
- [ ] Comments added for complex logic
37+
- [ ] Documentation updated (if needed)
38+
- [ ] No new warnings introduced

0 commit comments

Comments
 (0)