Closed DePasqualeOrg closed 3 months ago
Yes, should be easy enough!
I tried adding Sendable
to LLMModel
, but then I get this error and warning on the classes that implement it:
'Sendable' class 'LlamaModel' cannot inherit from another class other than 'NSObject'
Non-final class 'LlamaModel' cannot conform to 'Sendable'; use '@unchecked Sendable'
I think the tricky one here is LLMModel -- MLXArray is mutable and very much not thread safe. Should LLMModel be thread safe? We would need to make sure it never exposed bare MLXArrays, which it certainly does now.
After setting "Strict Concurrency Checking" to "Complete" in my app's build settings in preparation for migrating to Swift 6, I get warnings about
LLMModel
,GenerateResult
,GenerateParameters
, andGenerateDisposition
frommlx-libraries
, which don't currently conform to theSendable
protocol. Is it possible to make these conform toSendable
?