Skip to content

muna-ai/muna-flutter

Repository files navigation

Muna for Flutter

Muna logo

Run AI models in Flutter. Register at muna.ai.

Installing Muna

Add muna to your pubspec.yaml:

dependencies:
  muna: ^0.0.3

Running a Model

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

import "package:muna/muna.dart";

// 💥 Create an OpenAI client
final openai = Muna(accessKey: "<ACCESS KEY>").beta.openai;

Next, run a model:

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

Before building and running your app, embed the model into your app by adding a muna block to your app's pubspec.yaml:

muna:
  access_key: "<ACCESS KEY>"
  predictors:
    - tag: "@openai/gpt-oss-20b"

Then run the embed command in Terminal:

# Embed models for your app build
$ dart run muna:embed

Finally, run your app and use the results:

// 🚀 Use the results
print(completion.choices.first.message.content);

Useful Links

Muna is a product of NatML Inc.

About

Run AI models in your Flutter apps. https://muna.ai/explore

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages