![]() |
LLM for Unity
v3.0.1
Create characters in Unity with LLMs!
|
Class implementing the LLM model manager. More...
Static Public Member Functions | |
| static void | SetDownloadProgress (float progress) |
| Sets the model download progress in all registered callbacks. | |
| static Task< bool > | Setup () |
| Setup of the models. | |
| static async Task< bool > | SetupOnce () |
| Task performing the setup of the models. | |
| static ModelEntry | Get (string path) |
| Gets the model entry for a model path. | |
| static string | GetAssetPath (string filename) |
| Gets the asset path based on whether the application runs locally in the editor or in a build. | |
| static int | Num (bool lora) |
| Returns the number of LLM/LORA models. | |
| static int | NumModels () |
| Returns the number of LLM models. | |
| static int | NumLoras () |
| Returns the number of LORA models. | |
| static void | Register (LLM llm) |
| Registers a LLM to the model manager. | |
| static void | Unregister (LLM llm) |
| Removes a LLM from the model manager. | |
| static void | LoadFromDisk () |
| Loads the model manager from a file. | |
| static string | AddEntry (ModelEntry entry) |
| Adds a model entry to the model manager. | |
| static string | AddEntry (string path, bool lora=false, string label=null, string url=null) |
| Creates and adds a model entry to the model manager. | |
| static async Task< string > | Download (string url, bool lora=false, bool log=false, string label=null) |
| Downloads a model and adds a model entry to the model manager. | |
| static string | Load (string path, bool lora=false, bool log=false, string label=null) |
| Loads a model from disk and adds a model entry to the model manager. | |
| static async Task< string > | DownloadModel (string url, bool log=false, string label=null) |
| Downloads a LLM model from disk and adds a model entry to the model manager. | |
| static async Task< string > | DownloadLora (string url, bool log=false, string label=null) |
| Downloads a Lora model from disk and adds a model entry to the model manager. | |
| static string | LoadModel (string path, bool log=false, string label=null) |
| Loads a LLM model from disk and adds a model entry to the model manager. | |
| static string | LoadLora (string path, bool log=false, string label=null) |
| Loads a LORA model from disk and adds a model entry to the model manager. | |
| static void | SetURL (string filename, string url) |
| Sets the URL for a model. | |
| static void | SetURL (ModelEntry entry, string url) |
| Sets the URL for a model. | |
| static void | SetIncludeInBuild (string filename, bool includeInBuild) |
| Sets whether to include a model to the build. | |
| static void | SetIncludeInBuild (ModelEntry entry, bool includeInBuild) |
| Sets whether to include a model to the build. | |
| static void | SetDownloadOnStart (bool value) |
| Sets whether to download files on start. | |
| static void | Remove (string filename) |
| Removes a model from the model manager. | |
| static void | Remove (ModelEntry entry) |
| Removes a model from the model manager. | |
| static void | SetModelProgress (float progress) |
| Sets the LLM download progress. | |
| static void | SetLoraProgress (float progress) |
| Sets the LORA download progress. | |
| static void | Save () |
| Serialises and saves the model manager. | |
| static void | Load () |
| Deserialises and loads the model manager. | |
| static void | SaveToDisk () |
| Saves the model manager to disk for the build. | |
| static void | Build (Action< string, string > copyCallback) |
| Saves the model manager to disk along with models that are not (or can't) be downloaded for the build. | |
Static Public Attributes | |
| static bool | downloadOnStart = false |
| static List< ModelEntry > | modelEntries = new List<ModelEntry>() |
| static float | downloadProgress = 1 |
| static List< Action< float > > | downloadProgressCallbacks = new List<Action<float>>() |
| static float | modelProgress = 1 |
| static float | loraProgress = 1 |
Class implementing the LLM model manager.
Definition at line 106 of file LLMManager.cs.
|
inlinestatic |
Adds a model entry to the model manager.
| entry | model entry |
Definition at line 317 of file LLMManager.cs.
|
inlinestatic |
Creates and adds a model entry to the model manager.
| path | model path |
| lora | if it is a LORA or LLM |
| label | label to show in the model manager in the Editor |
| url | model url |
Definition at line 348 of file LLMManager.cs.
|
inlinestatic |
Saves the model manager to disk along with models that are not (or can't) be downloaded for the build.
| copyCallback | copy function |
Definition at line 629 of file LLMManager.cs.
|
inlinestatic |
Downloads a model and adds a model entry to the model manager.
| url | model url |
| lora | if it is a LORA or LLM |
| log | whether to log |
| label | model label |
Definition at line 361 of file LLMManager.cs.
|
inlinestatic |
Downloads a Lora model from disk and adds a model entry to the model manager.
| url | model url |
| log | whether to log |
| label | model label |
Definition at line 444 of file LLMManager.cs.
|
inlinestatic |
Downloads a LLM model from disk and adds a model entry to the model manager.
| url | model url |
| log | whether to log |
| label | model label |
Definition at line 432 of file LLMManager.cs.
|
inlinestatic |
Gets the model entry for a model path.
| path | model path |
Definition at line 210 of file LLMManager.cs.
|
inlinestatic |
Gets the asset path based on whether the application runs locally in the editor or in a build.
| filename | model filename or relative path |
Definition at line 226 of file LLMManager.cs.
|
inlinestatic |
Deserialises and loads the model manager.
Definition at line 596 of file LLMManager.cs.
|
inlinestatic |
Loads a model from disk and adds a model entry to the model manager.
| path | model path |
| lora | if it is a LORA or LLM |
| log | whether to log |
| label | model label |
Definition at line 414 of file LLMManager.cs.
|
inlinestatic |
Loads the model manager from a file.
Definition at line 291 of file LLMManager.cs.
|
inlinestatic |
Loads a LORA model from disk and adds a model entry to the model manager.
| path | model path |
| log | whether to log |
| label | model label |
Definition at line 468 of file LLMManager.cs.
|
inlinestatic |
Loads a LLM model from disk and adds a model entry to the model manager.
| path | model path |
| log | whether to log |
| label | model label |
Definition at line 456 of file LLMManager.cs.
|
inlinestatic |
Returns the number of LLM/LORA models.
| lora | whether to return number of LORA or LLM models |
Definition at line 242 of file LLMManager.cs.
|
inlinestatic |
Returns the number of LORA models.
Definition at line 265 of file LLMManager.cs.
|
inlinestatic |
Returns the number of LLM models.
Definition at line 256 of file LLMManager.cs.
|
inlinestatic |
Registers a LLM to the model manager.
| llm | LLM |
Definition at line 274 of file LLMManager.cs.
|
inlinestatic |
Removes a model from the model manager.
| filename | model entry |
Definition at line 549 of file LLMManager.cs.
|
inlinestatic |
Removes a model from the model manager.
| filename | model filename |
Definition at line 540 of file LLMManager.cs.
|
inlinestatic |
Serialises and saves the model manager.
Definition at line 582 of file LLMManager.cs.
|
inlinestatic |
Saves the model manager to disk for the build.
Definition at line 608 of file LLMManager.cs.
|
inlinestatic |
Sets whether to download files on start.
| value | whether to download files |
Definition at line 521 of file LLMManager.cs.
|
inlinestatic |
Sets the model download progress in all registered callbacks.
| progress | model download progress |
Definition at line 124 of file LLMManager.cs.
|
inlinestatic |
Sets whether to include a model to the build.
| entry | model entry |
| includeInBuild | whether to include it |
Definition at line 510 of file LLMManager.cs.
|
inlinestatic |
Sets whether to include a model to the build.
| filename | model filename |
| includeInBuild | whether to include it |
Definition at line 500 of file LLMManager.cs.
|
inlinestatic |
Sets the LORA download progress.
| progress | download progress |
Definition at line 574 of file LLMManager.cs.
|
inlinestatic |
Sets the LLM download progress.
| progress | download progress |
Definition at line 565 of file LLMManager.cs.
|
inlinestatic |
Setup of the models.
Definition at line 134 of file LLMManager.cs.
|
inlinestatic |
Task performing the setup of the models.
Definition at line 147 of file LLMManager.cs.
|
inlinestatic |
Sets the URL for a model.
| entry | model entry |
| url | model URL |
Definition at line 488 of file LLMManager.cs.
|
inlinestatic |
Sets the URL for a model.
| filename | model filename |
| url | model URL |
Definition at line 478 of file LLMManager.cs.
|
inlinestatic |
Removes a LLM from the model manager.
| llm | LLM |
Definition at line 283 of file LLMManager.cs.
|
static |
Definition at line 108 of file LLMManager.cs.
|
static |
Definition at line 112 of file LLMManager.cs.
|
static |
Definition at line 113 of file LLMManager.cs.
|
static |
Definition at line 304 of file LLMManager.cs.
|
static |
Definition at line 109 of file LLMManager.cs.
|
static |
Definition at line 303 of file LLMManager.cs.