Skip to content

muna-ai/muna-py

Repository files navigation

Muna for Python

Muna logo

Compile and run AI models locally & in the cloud.

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:

# Install Muna
$ pip install --upgrade muna

Note

Muna requires Python 3.11+

Running a Model

First, create a Muna client, specifying your access key (create one here):

from muna import Muna

# 💥 Create an OpenAI client
openai = Muna("<ACCESS KEY>").beta.openai

Next, run a model:

# 🔥 Create a chat completion
completion = openai.chat.completions.create(
  model="@openai/gpt-oss-20b",
  messages=[
    { "role": "user", "content": "What is the capital of France?" }
  ],
  acceleration="local_gpu"
)

Finally, use the results:

# 🚀 Use the results
print(completion.choices[0].message)

Useful Links

Muna is a product of NatML Inc.