Skip to content

Conversation

@tidely
Copy link
Contributor

@tidely tidely commented Sep 15, 2025

Closes #17524

This PR adds a button to the bottom right corner of the ollama settings ui. It resets the available ollama models, also resets the "Connected" state in the process. This means it can be used to check if the connection is still valid as well. It's a question whether we should clear the available models on ALL fetch_models calls, since these only happen during auth anyway.

Ollama is a local model provider which means clicking the refresh button often only flashes the "not connected" state because the latency of the request is so low. This accentuates changes in the UI, however I don't think there's a way around this without adding some rather cumbersome deferred ui updates.

I've attached the refresh button to the "Connected" ButtonLike, since I don't think automatic UI spacing should separate these elements. I think this is okay because the "Connected" isn't actually something that the user can interact with.

Before:
image

After:
image

Alternative approach: There was also a suggestion to simply add a entry to the command palette, however none of the other providers have this ability currently either so I went with this approach. The current approach also makes it more discoverable to the user.

Release Notes:

  • Added a button for refreshing available ollama models
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 15, 2025
@tidely
Copy link
Contributor Author

tidely commented Sep 16, 2025

Another approach would be to update models everytime the menu is opened. However the /api/tags endpoint is currently coupled with fetching model capabilities individually, possibly creating tens of requests each time (roundtrips scale with model count).

Only fetching capabilities for new models is likely something we want to implement regardless, but I can include it here incase we want to take the "fetch on every open" approach.

@MrSubidubi MrSubidubi added the area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Sep 17, 2025
@mgsloan mgsloan self-assigned this Sep 29, 2025
@bennetbo bennetbo assigned bennetbo and unassigned mgsloan Oct 31, 2025
Copy link
Member

@bennetbo bennetbo left a comment

Choose a reason for hiding this comment

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

Thank you! I think this is good to get in, even though there might be more elegant solutions to this.

@bennetbo bennetbo enabled auto-merge (squash) October 31, 2025 18:00
@bennetbo bennetbo merged commit 12d71b3 into zed-industries:main Oct 31, 2025
24 checks passed
tomatitito pushed a commit to tomatitito/zed that referenced this pull request Nov 7, 2025
)

Closes zed-industries#17524

This PR adds a button to the bottom right corner of the ollama settings
ui. It resets the available ollama models, also resets the "Connected"
state in the process. This means it can be used to check if the
connection is still valid as well. It's a question whether we should
clear the available models on ALL `fetch_models` calls, since these only
happen during auth anyway.

Ollama is a local model provider which means clicking the refresh button
often only flashes the "not connected" state because the latency of the
request is so low. This accentuates changes in the UI, however I don't
think there's a way around this without adding some rather cumbersome
deferred ui updates.

I've attached the refresh button to the "Connected" `ButtonLike`, since
I don't think automatic UI spacing should separate these elements. I
think this is okay because the "Connected" isn't actually something that
the user can interact with.

Before: 
<img width="211" height="245" alt="image"
src="https://github.com/user-attachments/assets/ea90e24a-b603-4ee2-9212-2917e1695774"
/>

After: 
<img width="211" height="250" alt="image"
src="https://github.com/user-attachments/assets/be9af950-86a2-4067-87a0-52034a80a823"
/>


Alternative approach: There was also a suggestion to simply add a entry
to the command palette, however none of the other providers have this
ability currently either so I went with this approach. The current
approach also makes it more discoverable to the user.

Release Notes:

- Added a button for refreshing available ollama models

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

4 participants