Skip to content

Service · inherits Instance

MLService

Official docs ↗

A service that runs in-engine machine learning inference by loading model bundles and creating inference sessions.

About MLService

MLService loads machine learning model bundles and produces MLSession objects used to run inference on the client. It fetches a model asset and constructs a neural network session from the downloaded bundle, which the returned MLSession then executes.

Methods 1

  • CreateSessionAsync(assetId: string) → MLSessionYieldsCreates an MLSession for the model bundle identified by the given asset ID.

    Fetches the model bundle identified by assetId, constructs a neural network session from it, and resolves with a MLSession wrapping that session. As a yield function, it returns only once the model has been downloaded and the session created; if the asset cannot be fetched or the bundle is invalid, it raises an error instead of returning a session.

MLService also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.