Team Ai
Modelpublic

dtaddis/SmolLM2-135M-Instruct-Unity

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
0likes19downloads
Model Card

SmolLM2-135M-Instruct for Unity Sentis

This repository contains optimized versions of the SmolLM2-135M-Instruct model, specifically formatted for use in Unity Sentis.

SmolLM2-135M is an ultra-compact model that excels at on-device tasks like text rewriting, summarization, and simple NPC dialogue while maintaining an exceptionally small memory footprint.

Available Versions

File NameFormatPrecisionSizeBest For
model.onnxONNXFP32~530MBHigh-fidelity source / Desktop
model_FP16.sentisSentisFP16~320MBBalanced Performance / Mobile
model_Uint8.sentisSentisUint8~160MBMaximum Performance / WebGL / Low-end Mobile

How to use in Unity

  1. 1.Install Sentis: Use the Unity Package Manager to install com.unity.sentis (2.1.0+ recommended).
  2. 2.Download Model: Choose the .sentis file based on your target platform's memory constraints.
  3. 3.Import: Drag the .sentis file and the tokenizer.json into your Unity project.

Basic C# Loading Snippet

csharp
using Unity.Sentis;
using UnityEngine;

public class TinyLLM : MonoBehaviour {
    public ModelAsset modelAsset;
    private IWorker engine;

    void Start() {
        Model runtimeModel = ModelLoader.Load(modelAsset);
        // GPUCompute is recommended for mobile performance
        engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, runtimeModel);
    }
}