https://github.com/muna-ai/muna-py
Run AI models anywhere. https://muna.ai/explore
https://github.com/muna-ai/muna-py
ai deep-learning machine-learning numpy pytorch serverless serverless-gpu
Last synced: 1 day ago
JSON representation
Run AI models anywhere. https://muna.ai/explore
- Host: GitHub
- URL: https://github.com/muna-ai/muna-py
- Owner: muna-ai
- License: apache-2.0
- Created: 2023-05-15T15:10:22.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-20T16:52:25.000Z (26 days ago)
- Last Synced: 2026-01-21T01:54:23.808Z (25 days ago)
- Topics: ai, deep-learning, machine-learning, numpy, pytorch, serverless, serverless-gpu
- Language: Python
- Homepage: https://docs.muna.ai
- Size: 2.33 MB
- Stars: 75
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Muna for Python

Run AI models anywhere.
## Installing Muna
Muna is distributed on PyPi. This distribution contains both the Python client and the command line interface (CLI). Run the following command in terminal:
```sh
# Install Muna
$ pip install --upgrade muna
```
> [!NOTE]
> Muna requires Python 3.11+
## Transpiling a Python Function
Muna can transpile Python functions into C++, generating a self-contained header-only library that pulls all of its dependencies automatically (e.g. llama.cpp, mlx, CUDA). First, add the [`@compile`](https://docs.muna.ai/predictors/create) decorator to your function:
```py
from muna import compile
@compile()
def do_stuff():
...
```
Then use the Muna CLI to transpile to C++:
```sh
# Transpile the Python function to C++
$ muna transpile do_stuff.py
```
Muna will create a cloud sandbox to setup your Python function, trace it, lower to C++, then generate a folder containing the header-only library and a corresponding `CMakeLists.txt`.
> [!TIP]
> Even though the compiler is not open-source, you can [read up on how it works](https://blog.codingconfessions.com/p/compiling-python-to-run-anywhere).
Once compiled, you can then build the included example app and test it from the command line. Here's an example using
[Kokoro TTS](https://github.com/muna-ai/muna-predictors/blob/main/text-to-speech/kokoro.py) 🔊:
https://github.com/user-attachments/assets/a0090414-bb9d-4b69-8876-959bd60c699a
___
## Useful Links
- [Check out several AI models we've compiled](https://github.com/muna-ai/muna-predictors).
- [Join our Slack community](https://muna.ai/slack).
- [Check out our docs](https://docs.muna.ai).
- Learn more about us [on our blog](https://blog.muna.ai).
- Reach out to us at [hi@muna.ai](mailto:hi@muna.ai).
Muna is a product of [NatML Inc](https://github.com/natmlx).