Bug in Xcode AI coding assistant

I've been experimenting with using local LLMs in place of ChatGPT in coding assistant. I was able to do this using LM Studio. I found that switching LLMs was a little clunky, but eventually, I was able to make it work. However, none of the LLMs I tried were able to generate error free Swift code. Not surprising at this stage.

I decided to train an LLM (Llama3.1-8b) with Apple's Swift Programming language reference, using Open WebUI, and this worked. I was able to get the LLM to generate working Swift Code that I was able to test in Playgrounds.

The problem I'm having now is that Xcode is locked up on the last LLM I tried out. I've tried deleting all the LLM providers in Settings, leaving only ChatGPT, but Xcode still defaults to the local LLM, even though it throws errors if you try to ask it a question.

I've tried reinstalling Xcode, downloading new versions of sample Xcode projects, and deleting various data files, all to no avail.

I would really like to test the new LLM I've trained in coding assistant, but right now, Xcode won't let me. It won't even let me revert to ChatGPT.

Just some additional configuration info. I’m running macOS 26 beta 2 and Xcode 26 beta 2. I had the problem in beta 1 and installed the beta 2 versions but it didn’t help. Platform is the MacBook Pro with M4 Max 48GB.

For anyone having the same issue, I got a "fix". Quit Xcode-beta and open terminal. Enter the following:

defaults write com.apple.dt.Xcode IDEChatChatGPTEnabled 0

This will reset the settings for ChatGPT. Open Xcode-beta again and switch to Coding Assistant. Now the button for setting up should appear again. I was able to reproduce this a couple of times.

If it still doesn't work, you can reset all the defaults for Xcode by calling

defaults delete com.apple.dt.Xcode

This deletes and rewrites the defaults for Xcode entirely.

Bug in Xcode AI coding assistant
 
 
Q