--- license: mit base_model: google/functiongemma-270m-it language: - en - ko tags: - unity - sentis - function-calling - gemma - on-device - smart-home --- # FunctionGemma Home (Unity package) On-device function calling for Unity with **FunctionGemma-270M** running on **Unity Sentis**. The package contains the runtime generator and the model files. ## Install In `Packages/manifest.json`, add: ```json "com.sky-kim.functiongemma-home": "https://huggingface.co/Sky-Kim/com.sky.sentis.functiongemma.home.git" ``` Unity Sentis (`com.unity.ai.inference` 2.6.1) is installed automatically as a dependency. ## Model files The model ships in the package's `Models~` folder, together with the tokenizer and the developer block: ``` Models~/ functiongemma_home_uint8.sentis # FunctionGemma-270M, uint8 weights (about 436 MB) tokenizer.json fg_dev_block_home.txt # system instruction + tool declarations, byte-identical to training ``` Unity does not import `Models~`, so the model is not duplicated as an asset. In the Editor, `FunctionGemmaGenerator` reads the files straight from the package cache. For a player build, the package copies them to `Assets/StreamingAssets/FunctionGemmaHome/` before the build and removes the copy afterwards. Android keeps StreamingAssets inside the APK, so the first launch copies the files to `Application.persistentDataPath` (call `WarmupRoutine` from a coroutine). ## Use Add `FunctionGemmaGenerator` to a GameObject and call: ```csharp var gen = GetComponent(); yield return gen.WarmupRoutine(); // on Android, copies the model out of the APK first yield return gen.GenerateCallRoutine("Turn on the living room light", raw => Debug.Log(raw)); // raw looks like: call:turn_on_light{room:living room} ``` Parse and validate the raw text in your own code. The output format is a flat call, `call:NAME{key:value}`. ## Notes - The model is a fine-tune of Gemma, so the Gemma terms of use apply. Training source: [Sky-Kim/functiongemma-270m-finetune](https://huggingface.co/Sky-Kim/functiongemma-270m-finetune). - `Models~/` is not imported by Unity. The build copies its contents into StreamingAssets only for the player. - Code is MIT licensed (see `LICENSE`).