Skip to content

Failed to create LLM service: Failed LLMService construction with all available libraries. Last error: LLMService construction returned null pointer #392

@hlibr

Description

@hlibr

Platform: MacOS
Unity: 6000.2.12f1, Unity 6.3 LTS

After updating to 3.0.2 from one of the previous versions - I'm now unable to run any LLM inference in Editor.

My setup looks like LLM -> LLMAgent

Upon calling llmAgent.Chat I get this error:

Failed to create LLM service: Failed LLMService construction with all available libraries. Last error: LLMService construction returned null pointer UnityEngine.Debug:LogError (object) LLMUnity.LLMUnitySetup:LogError (string,bool) (at Assets/LLMUnity/Runtime/LLMUnitySetup.cs:199) LLMUnity.LLM/<StartServiceAsync>d__107:MoveNext () (at Assets/LLMUnity/Runtime/LLM.cs:439) System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetException (System.Exception) LLMUnity.LLM/<CreateServiceAsync>d__111:MoveNext () (at Assets/LLMUnity/Runtime/LLM.cs:504) UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)

Further launches, the error in different:

Failed to create LLM service: LlamaLib error -1: Error loading the model! UnityEngine.Debug:LogError (object) LLMUnity.LLMUnitySetup:LogError (string,bool) (at Assets/LLMUnity/Runtime/LLMUnitySetup.cs:199) LLMUnity.LLM/<StartServiceAsync>d__107:MoveNext () (at Assets/LLMUnity/Runtime/LLM.cs:439) System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetException (System.Exception) LLMUnity.LLM/<CreateServiceAsync>d__111:MoveNext () (at Assets/LLMUnity/Runtime/LLM.cs:504) UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)

and further errors:

LLM failed to start
UnityEngine.Debug:LogError (object)
LLMUnity.LLMUnitySetup:LogError (string,bool) (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMUnitySetup.cs:199)
LLMUnity.LLM/<WaitUntilReady>d__112:MoveNext () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLM.cs:551)
UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)


LLM failed to start
UnityEngine.Debug:LogError (object)
LLMUnity.LLMUnitySetup:LogError (string,bool) (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMUnitySetup.cs:199)
LLMUnity.LLMClient/<SetupCallerObject>d__53:MoveNext () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMClient.cs:290)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetException (System.Exception)
LLMUnity.LLM/<WaitUntilReady>d__112:MoveNext () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLM.cs:551)
UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)


llmClient not initialized, error: LLM failed to start
UnityEngine.Debug:LogError (object)
LLMUnity.LLMUnitySetup:LogError (string,bool) (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMUnitySetup.cs:199)
LLMUnity.LLMClient/<SetupCallerObject>d__53:MoveNext () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMClient.cs:302)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetException (System.Exception)
LLMUnity.LLM/<WaitUntilReady>d__112:MoveNext () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLM.cs:551)
UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)


LLM caller not initialized
UnityEngine.Debug:LogError (object)
LLMUnity.LLMUnitySetup:LogError (string,bool) (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMUnitySetup.cs:199)
LLMUnity.LLMClient/<CheckCaller>d__51:MoveNext () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMClient.cs:247)
UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)


LLMUnityException: llmClient not initialized, error: LLM failed to start
LLMUnity.LLMUnitySetup.LogError (System.String message, System.Boolean throwException) (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMUnitySetup.cs:202)
LLMUnity.LLMClient.SetupCallerObject () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMClient.cs:302)
LLMUnity.LLMAgent.SetupCallerObject () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMAgent.cs:120)
LLMUnity.LLMClient.SetupCaller () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMClient.cs:263)
LLMUnity.LLMClient.Start () (at ./Library/PackageCache/ai.undream.llm@63b79c5674bf/Runtime/LLMClient.cs:226)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <3c470575843b432e876313222d20c5ed>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:156)
UnityEngine.UnitySynchronizationContext.Exec () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:84)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)
Image Image

(note that I've tried with the pre-supplied qwen 3 0.6b as well)

What I've tried so far:

  • Deleting the Library folder, letting it rebuild
  • Reimporting the package (including full removal -> reimport)
  • Reimporting the package from git
  • Assets -> Reimport All

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions