Skip to main content
The very first step in making predictions is finding or compiling a model:

Explore Models

Explore public models on Muna.

Compile a Model

Compile a model with Muna.

Making Predictions

Making predictions with Muna can be done in as little as two lines of code.

Using Prediction Values

Muna supports a fixed set of value types for prediction input and output values:
Muna supports the following floating-point numbers:
In languages that don’t support fixed-size floating point scalars, the data type for floating point values defaults to float32. Use a tensor constructor to explicitly specify the data type.
Support for half-precision floating point scalars float16 is planned for the future depending on language support.
Muna supports floating point vectors (i.e. one-dimensional floating point tensors):
Although Muna supports input vectors, predictors will always output either scalars or Tensor instancesβ€”never plain vectors.
Muna supports floating point tensors:
Muna supports several signed and unsigned integer scalars:
When integer scalars are passed to predictors, the data type defaults to int32. Use a tensor constructor to explicitly specify the data type.
Muna supports integer vectors (i.e. one-dimensional integer tensors) of the aforementioned integer types:
Although Muna supports input vectors, predictors will always output either scalars or Tensor instancesβ€”never plain vectors.
Muna supports integer tensors:
Unsigned integer tensors are not supported in our Android client because of missing language support in Java.
Muna supports boolean scalars:
Muna supports boolean vectors (i.e. one-dimensional boolean tensors):
Although Muna supports input vectors, predictors will always output either scalars or Tensor instancesβ€”never plain vectors.
Muna supports boolean tensors:
Muna assumes that boolean values are 1 byte.
Muna supports string values:
Muna supports lists of values, each with potentially different types:
Input list values must be JSON-serializable.
Muna supports dictionary values:
Input dictionary values must be JSON-serializable.
Muna supports images, represented as raw pixel buffers with 8 bytes per pixel and interleaved by channel. Muna supports three pixel buffer formats:Some client SDKs provide Image utility types for working with images:
Muna supports binary blobs:
Because Muna’s security model prohibits file system access, binary input values are always fully read into memory before being passed to the predictor.To make predictions on large files, consider mapping the file into memory using mmap or your environment’s equivalent.

Streaming Predictions

Muna supports consuming the partial results of a prediction as they are made available by the predictor:

Consuming Prediction Streams

Streaming in Muna is designed to fully separate how a prediction function is implemented from how the function might be consumed. Consider these two predictors:
Here are the reuslts of creating vs. streaming each function at runtime:
In this case, the single prediction is returned:
In this case, the Muna client will consume all partial predictions yielded by the predictor then return the very last one:
In this case, the Muna client will return a prediction stream with the single prediction returned by the predictor:
In this case, the Muna client will provide a prediction stream containing all partial predictions yielded by the predictor:
You can choose how to consume a prediction function depending on what works best for your user experience. You don’t have to care about the underlying function!