Defining a Function
To define a prediction function, wrap a Python function with the@compile decorator, providing a
predictor tag and short description:
greeting.py
The predictor description is required and must be 100 characters or less.
The prediction function must specify parameter and return type annotations. Learn more.
Compiling the Function
Use the Muna CLI to compile the function. First, make sure you are logged into the Muna CLI:
Creating a predictor with the Muna CLI. This is realtime--not sped up.
Using the Function
Depending on the complexity of your function, it can take anywhere from a few seconds to a few minutes for the function to be compiled for all platforms. Once the function is compiled, you can run it everywhere:You can check the compilation status of the predictor at muna.ai/predictors.
Try it Out
We have an open-source Playground project that shows the full workflow from writing and compiling a Python function; to using it across the following platforms:- React with Next.js (Browser, Node.js)
- React Native with Expo (Android, iOS)
- Kotlin in Android Studio (Android)
- Swift in Xcode (iOS)
- Python (Linux, macOS, Windows)
- Unity Engine (Android, iOS, Linux, macOS, visionOS, WebGL, Windows)