Skip to content

Improve MLXChatExample app - #474

Closed
DePasqualeOrg wants to merge 5 commits into
ml-explore:mainfrom
DePasqualeOrg:improve-chat-example
Closed

DePasqualeOrg wants to merge 5 commits into
ml-explore:mainfrom
DePasqualeOrg:improve-chat-example

Conversation

@DePasqualeOrg

Copy link
Copy Markdown
Contributor

In preparation for a subsequent PR demonstrating the model output parsing and Open Responses streaming enabled by Swift LM Response Parser, I've fixed many issues in the MLXChatExample app. In order to keep the diff relatively small, I'm deliberately not solving every issue and not covering every edge case, since this is an example app and not meant for production. But these changes represent a significant improvement:

  • Fixes for various bugs related to the toolbar buttons
  • Download sizes are properly formatted, but download progress is still not shown due to a longstanding bug in Swift Hugging Face (this works properly in my fork, Swift HF API, which is not used here).
  • Chats can be continued after switching models.
  • Many other quality-of-life improvements

@davidkoski

Copy link
Copy Markdown
Member

this works properly in my fork, Swift HF API, which is not used here

It is unfortunate that the examples has to pick only one provider. Ugh.

container,
instructions: Self.systemPrompt,
history: history,
generateParameters: generateParameters,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea!

INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
IPHONEOS_DEPLOYMENT_TARGET = 26.0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is a problem to update the targets for the examples, but is it required?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is due to an issue with Liquid Glass: you need .sharedBackgroundVisibility(.hidden) to remove the glass background from indicators in the toolbar. It also allows for using Liquid Glass in the tool call/results view in the subsequent PR.

@DePasqualeOrg
DePasqualeOrg deleted the improve-chat-example branch May 10, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants