How to obtain more value out of a generic "FoundationModels.LanguageModelError error -1"

I created a tiny sample: provided a session with a tiny tool to tell the date and time to the model. Asked the model to stream response to "What time is it" and just get this error:

The operation couldn’t be completed. (FoundationModels.LanguageModelError error -1.)

There is no relevant output on Xcode console.

And profiling with the new Foundation Models instrument brings zero more insight into the issue.

I know it could be many things, but it there may be more information the tools could surface in debug?

Answered by Apple Designer in 892198022

Thanks for the issue! Please see my reply in your other issue https://developer.apple.com/forums/thread/831404

We'll definitely investigate to see if we can figure out a fix with the OS layer, but until then, updating a device is your best bet.

This is just trying to find a needle on a haystack, but the device logs don't seem to log anything helpful either to debug.

After the "Sending execute streaming request for" the failing requests don't go through much steps and just rapidly see a "Sending InferenceProvider EndOfStream message for"

Instead, in any requests that don't ask about the time (e.g. just a "Hello") I see logs for "StringResponseSanitizerRunner", and "Sending execute request".

So, not even in the detailed logs I can debug what's up. Would be nice to know more.

Thanks! Sorry this looks like a bug to me.

Could you please file a report with Feedback Assistant including your OS version number, Xcode version number, and the sample?

If you're able to post your Feedback Assistant issue # back here we can help triage the issue and get back to you more quickly. Thanks!

Looking a bit further, the issue seems isolated to the Simulator, hopefully is not less of a priority: FB23060822

Accepted Answer

Thanks for the issue! Please see my reply in your other issue https://developer.apple.com/forums/thread/831404

We'll definitely investigate to see if we can figure out a fix with the OS layer, but until then, updating a device is your best bet.

How to obtain more value out of a generic "FoundationModels.LanguageModelError error -1"
 
 
Q