Hi guys,
I'm testing the Foundation Models Framework with the on-device model in iOS 27 (beta 4) and macOS 27 (beta 4) and is completely failing to respond.
There are many errors. For starters, the model doesn't respond to prompts directly, you need to specify instructions, otherwise it refuses to provide an answer. It is always looking for tools, even when no tool has been provided, and returns an error saying that it couldn't find the tool. Then, when it produces a response, it shows all the thinking process first, which completely ruins the response. Most of the time, the response begins with all the JSON code. And when I try to have a long conversation, it just says "I cannot write content or generate text."
I wonder if someone is experiencing the same issues or maybe the way to implement this model changed and I'm missing something?
Here is a screenshot of one of my interactions when I asked the model to describe a unicorn. It tried to access a tool that doesn't exist. (the app just prints the value of the content property)
Here is the code. It is performing a simple request.
struct ContentView: View {
@State private var response = ""
var body: some View {
VStack {
Button("Send") {
let prompt = "Write a paragraph describing a unicorn"
let session = LanguageModelSession {
"Respond to the user's request. Never acknowledge the request, add preamble, or comment on what you are about to write."
}
if !session.isResponding {
Task {
do {
let answer = try await session.respond(to: prompt)
response = answer.content
} catch {
response = "Error accessing the model: \(error)"
}
}
}
}
.buttonStyle(.borderedProminent)
Text(response)
.font(Font.system(size: 18))
.padding()
Spacer()
}
.padding()
}
}
Hi all!
This is a known model issue in Beta 4 that we are actively working on.
See mention in Release Notes > Known Issues, search "Foundation Models"
We greatly appreciate any and all Feedback bug reports while we work on these issues. Please include your device model including which M-chip it has e.g. "iPad Air M2" or "Mac M4" in any Beta 4 report so we can determine which model precisely is misbehaving. Thanks!
Temporary workarounds
- Give the model a
@Generablestructure to produce, even just a dummyUnicornstruct that contains a single string fielddescription. This will go-along with the model's hunger to produce JSON - Add a line to your Instructions that explicitly tells the model something like "DO NOT call any tools to fulfil a request" to dissuade it from making up fake tools