icwhatudidthere
macrumors 6502a
It's actually really simple. If you have XCode, you can just create a Playground and paste the following:That sounds kind of cool. How did you do that or are there instructions on how to do it?
import FoundationModels
let session = LanguageModelSession()
let response = try await session.respond(
to: "Write a sonnet about Macs."
)
print(response.content)
Or in terminal, you can also just paste this into a file named llm.swift (or anything .swift) and enter swiftc llm.swift. You can then run ./llm and it'll write the sonnet.