AeroEdge
is an iOS SDK designed to streamline the process of fetching, managing, and compiling machine learning models. It offers seamless integration with your iOS apps, ensuring you can efficiently check local models, download new versions, and compile them for use.
Features:
- Local Model Checking: Quickly determine if the local version of a model matches the latest one.
- Automatic Downloads: If a newer version of a model exists, the SDK can fetch it for you.
- Model Compilation: Compile downloaded models, readying them for integration with your app.
- Model Storage: Models are stored locally and can be managed to ensure only the latest version is kept.
- Seamless Integration: Designed with Swift's modern features in mind, it integrates well with other iOS components.
- Background support: Ensuring downloads continue even if the app goes into the background.
- iOS 16.0 or later.
- Xcode 13.0 or later.
Add the following lines to your Package.swift
file:
let package = Package(
...
dependencies: [
...
.package(name: "AeroEdge", url: "https://github.com/saramaxyz/platform.git", branch: "main"), // Add the package
],
targets: [
.target(
name: "YourTargetName",
dependencies: ["AeroEdge"] // Add as a dependency
)
]
)
Or in Xcode, File > Add Package Dependency and add the url:
https://github.com/saramaxyz/platform.git
To start using AeroEdge
, you'll first need to initialize it using your apiKey
. Here's how you can do it:
import AeroEdge
let apiKey = "YOUR_API_KEY_HERE"
let aeroEdge = AeroEdge.make(apiKey: apiKey)
After initializing the manager, fetching a model becomes a breeze.
aeroEdge.getModel(modelName: "YourModelName", bundledModelURL: nil, progress: { progress in
print("Download Progress: \(progress)")
}, completion: { result, isFinal in
switch result {
case .success(let model):
// Use the fetched model
print(model.modelDescription)
case .failure(let error):
// Handle the error
print(error.localizedDescription)
}
})
Replace "YourModelName"
with the name of the model you wish to fetch.
AeroEdge
SDK supports background downloads, ensuring that the download of ML models continues even if your app goes to the background. Here's how to set it up:
- Open your project in Xcode.
- Select the app target and navigate to the "Signing & Capabilities" tab.
- Click the "+" button and add the "Background Modes" capability.
- Check the "Background fetch" and "Background processing" options.
If you're using UIKit
, ensure the AppDelegate
integrates with the AeroEdge
:
import UIKit
import AeroEdge
class AppDelegate: NSObject, UIApplicationDelegate {
let aeroEdge: AeroEdge = .make(apiKey: "your_token_here")
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
return true
}
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
if identifier == AeroEdge.backgroundIdentifier {
aeroEdge.backgroundSessionCompletionHandler = completionHandler
}
}
}
If you're using SwiftUI, you can use the AppDelegate
as follows:
@main
struct ExampleAppApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView(viewModel: ViewModel(aeroEdge: appDelegate.AeroEdge))
}
}
}
By integrating these steps, you ensure that the AeroEdge
handles model downloads efficiently, even in the background.
If you find any bugs or have a feature request, please open an issue on GitHub. Contributions, issues, and feature requests are welcome!
For major concerns or assistance, you can reach out to the team directly @AeroEdge
This SDK is under a specific license MIT Licence. All rights reserved.