Skip to content

muna-ai/muna-py

Repository files navigation

Muna for Python

Muna logo

Dynamic JSON Badge

Run AI models anywhere.

Installing Muna

Muna is distributed on PyPi. This distribution contains both the Python client and the command line interface (CLI). To install, open a terminal and run the following command:

# Install Muna
$ pip install --upgrade muna

Note

Muna requires Python 3.10+

Retrieving your Access Key

Head over to muna.ai to create an account by logging in. Once you do, generate an access key:

generate access key

Making a Prediction

First, create a Muna client, specifying your access key:

from muna import Muna

# Create a Muna client
muna = Muan(access_key="<Muna access key>")

Then make a prediction:

# Create a prediction
prediction = muna.predictions.create(
    tag="@fxn/greeting",
    inputs={ "name": "Peter" }
)

# Print the returned greeting
print(prediction.results[0])

Using the Muna CLI

Open up a terminal and login to the Muna CLI:

# Login to Muna
$ muna auth login <ACCESS KEY>

Then make a prediction:

# Make a prediction using the Muna CLI
$ muna predict @fxn/greeting --name Peter

Useful Links

Muna is a product of NatML Inc.