Skip to content

feat: Settings UX should let you remove a model provider#1062

Merged
mpawlow merged 3 commits into
mainfrom
mp/feat/GH-833-ability-to-remove-ollama-model-provider
Mar 10, 2026
Merged

feat: Settings UX should let you remove a model provider#1062
mpawlow merged 3 commits into
mainfrom
mp/feat/GH-833-ability-to-remove-ollama-model-provider

Conversation

@mpawlow

@mpawlow mpawlow commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

Issues

Summary

  • Adds the ability for users to remove a configured model provider (OpenAI, Anthropic, IBM watsonx.ai, Ollama) from the Settings UI, with backend validation and automatic fallback to another configured provider.
  • Polished settings dialogs: form reset on open, autocomplete suppression, and label cleanup
  • Extracted duplicated dialog footer logic into a shared ModelProviderDialogFooter component across all four provider settings dialogs.

Frontend – Settings Dialogs

  • Added a "Remove" button to the Ollama, OpenAI, Anthropic, and watsonx settings dialogs, each gated by a tooltip explaining when removal is disabled
  • Added an inline confirmation footer (with animated slide-in) that appears before executing a destructive remove action, replacing the dialog close behavior
  • Disabled the remove action when no other provider is configured (prevents being locked out), with a tooltip explaining the reason
  • Displayed an inline error message from the mutation if the remove request fails

Frontend – Mutation Layer

  • Extended useUpdateSettingsMutation to support the new remove_*_config boolean fields (remove_ollama_config, remove_openai_config, remove_anthropic_config, remove_watsonx_config)

Backend – Settings API

  • Added remove_ollama_config, remove_openai_config, remove_anthropic_config, remove_watsonx_config optional boolean fields to SettingsUpdateBody
  • Implemented removal logic for each provider: clears credentials/endpoint, marks configured = False, and rejects the request with a 400 if no other provider is available
  • Added _first_configured_llm_provider and _first_configured_embedding_provider helpers to auto-select a fallback provider/model when the active LLM or embedding provider is removed
  • Ensured Langflow global variables and model values are refreshed after a provider removal (same as a provider update)

Form State & UX Fixes

  • Added useEffect to reset form state whenever a settings dialog is opened, preventing stale values from persisting across dialog sessions (Anthropic, OpenAI, Ollama, WatsonX)

Password Field Improvements

  • Added autoComplete="new-password" to API key inputs in Anthropic, OpenAI, and WatsonX settings forms to suppress unwanted browser autofill suggestions

Button Label Cleanup

  • Shortened the remove confirmation button label from "Confirm Remove" to "Remove" across all four provider dialogs (Anthropic, OpenAI, Ollama, WatsonX)

Refactor: Shared Dialog Footer Component

  • Created model-provider-dialog-footer.tsx — a new reusable ModelProviderDialogFooter component that encapsulates both the remove-confirmation footer state and the standard save/cancel footer with optional
    "Remove" button
  • Defined a typed ModelProviderDialogFooterProps interface covering all props needed to drive both footer states (pending flags, configured/canRemove guards, tooltip text, and all action callbacks)

Refactored: Provider Settings Dialogs

  • Replaced the duplicated inline DialogFooter JSX (including Tooltip/TooltipProvider wrappers) in anthropic-settings-dialog.tsx, ollama-settings-dialog.tsx, openai-settings-dialog.tsx, and
    watsonx-settings-dialog.tsx with a single usage each
  • Removed per-dialog imports of DialogFooter, Tooltip, TooltipContent, TooltipProvider, and TooltipTrigger that were no longer needed after extraction

Screenshots

Image Image

Screencaps

OpenRAG.and.3.more.pages.-.Work.-.Microsoft.Edge.2026-03-06.15-41-07.mp4

@mpawlow mpawlow self-assigned this Mar 3, 2026
@github-actions github-actions Bot added frontend 🟨 Issues related to the UI/UX backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) enhancement 🔵 New feature or request labels Mar 3, 2026
@mpawlow mpawlow linked an issue Mar 3, 2026 that may be closed by this pull request
2 tasks
@mpawlow mpawlow force-pushed the mp/feat/GH-833-ability-to-remove-ollama-model-provider branch from a67c97b to dc67467 Compare March 5, 2026 18:44
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 5, 2026
@mpawlow mpawlow force-pushed the mp/feat/GH-833-ability-to-remove-ollama-model-provider branch from dc67467 to cdf9e8b Compare March 5, 2026 23:21
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 5, 2026
@mpawlow mpawlow force-pushed the mp/feat/GH-833-ability-to-remove-ollama-model-provider branch from cdf9e8b to 0c6d72c Compare March 6, 2026 20:10
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 6, 2026
</DialogFooter>

{showRemoveConfirm ? (
<DialogFooter className="mt-4 flex items-center gap-2 rounded-lg border border-red-500/10 bg-red-500/5 px-4 py-3 animate-in fade-in-0 slide-in-from-bottom-2 duration-150">

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(a) Implementation Note: Used standard animation found elsewhere in the OpenRAG application

  • Question for Reviewer: Does the selected animation effect & properties align with expectations?

@mfortman11 mfortman11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small issue after removing the connector the api key is "remembered" i the api key field

Image

One other small thing "confirm remove" sound right? vs just "remove" or "confirm removal"?

@mpawlow

mpawlow commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator Author

@mfortman11

Small issue after removing the connector the api key is "remembered" i the api key field

  • This is great feedback
  • I observed this too; but, I figured that was by design
    • e.g. Assumption: If the value was defined in .env, then that value is "remembered" / preloaded in the relevant field
    • I will verify whether this is true

One other small thing "confirm remove" sound right? vs just "remove" or "confirm removal"?

  • My preference is for your suggested Confirm Removal text; however, I'll defer to others in terms of what is best in terms of pre-established design patterns / best practices

@aimurphy

  • Question: Do you have a preference in this matter?
Image

@mpawlow

mpawlow commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator Author

@mfortman11

Small issue after removing the connector the api key is "remembered" i the api key field

I observed this too; but, I figured that was by design
e.g. Assumption: If the value was defined in .env, then that value is "remembered" / preloaded in the relevant field

  • Based on my research, it looks like this is indeed by design rather than a bug
  • The architecture has a two-layer config system
    • Layer 1: .env: Infrastructure/secrets (env vars like OLLAMA_ENDPOINT).
      • These represent operator-level configuration of what services are available.
    • Layer 2: YAML (via ConfigManager): Runtime settings (what's actively configured and in use)
  • When a model provider is removed via the UI, the YAML layer is updated (endpoint = "", configured = false).
    • But every time the config is loaded, ConfigManager applies env vars on top of the YAML
  • e.g. Ollama Base URL
  if os.getenv("OLLAMA_ENDPOINT"):
      config_data["providers"]["ollama"]["endpoint"] = os.getenv("OLLAMA_ENDPOINT")
  • As a result, the endpoint from .env is always re-injected on load, even after removal.
  • The frontend then sees isOllamaConfigured = false (so the provider isn't active), but the endpoint value is still present, which is why it pre-populates the "Configure" form.
  • Arguably, this is the desired UX (for user convenience)
    • i.e. User can easily add back a removed model provider without having to re-type everything
    • Since, configured = false, the provider is inactive (no models served from it, not used for chat/embedding)

@aimurphy

aimurphy commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

I think the usual pattern is just "Remove".

Like "Are you sure you want to delete?" and the choices are "Cancel" or "Delete".

@mpawlow mpawlow force-pushed the mp/feat/GH-833-ability-to-remove-ollama-model-provider branch from 0c6d72c to 57938ca Compare March 9, 2026 20:29
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 9, 2026
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 10, 2026
@mpawlow

mpawlow commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator Author

Status Update

  • ✅ Polished settings dialogs: form reset on open, autocomplete suppression, and label cleanup

@mfortman11

  • Ready for Code Review 2 👍

mpawlow added 2 commits March 10, 2026 05:48
Issues:

- #833

Summary

Adds the ability for users to remove a configured model provider (OpenAI, Anthropic, IBM watsonx.ai, Ollama) from the Settings UI, with backend validation and automatic fallback to another configured provider.

Frontend – Settings Dialogs

- Added a "Remove" button to the Ollama, OpenAI, Anthropic, and watsonx settings dialogs, each gated by a tooltip explaining when removal is disabled
- Added an inline confirmation footer (with animated slide-in) that appears before executing a destructive remove action, replacing the dialog close behavior
- Disabled the remove action when no other provider is configured (prevents being locked out), with a tooltip explaining the reason
- Displayed an inline error message from the mutation if the remove request fails

Frontend – Mutation Layer

- Extended useUpdateSettingsMutation to support the new remove_*_config boolean fields (remove_ollama_config, remove_openai_config, remove_anthropic_config, remove_watsonx_config)

Backend – Settings API

- Added remove_ollama_config, remove_openai_config, remove_anthropic_config, remove_watsonx_config optional boolean fields to SettingsUpdateBody
- Implemented removal logic for each provider: clears credentials/endpoint, marks configured = False, and rejects the request with a 400 if no other provider is available
- Added _first_configured_llm_provider and _first_configured_embedding_provider helpers to auto-select a fallback provider/model when the active LLM or embedding provider is removed
- Ensured Langflow global variables and model values are refreshed after a provider removal (same as a provider update)
Issues:

- #833

Summary

Polished settings dialogs: form reset on open, autocomplete suppression, and label cleanup

Form State & UX Fixes

- Added useEffect to reset form state whenever a settings dialog is opened, preventing stale values from persisting across dialog sessions (Anthropic, OpenAI, Ollama, WatsonX)

Password Field Improvements

- Added autoComplete="new-password" to API key inputs in Anthropic, OpenAI, and WatsonX settings forms to suppress unwanted browser autofill suggestions

Button Label Cleanup

- Shortened the remove confirmation button label from "Confirm Remove" to "Remove" across all four provider dialogs (Anthropic, OpenAI, Ollama, WatsonX)
@mpawlow mpawlow force-pushed the mp/feat/GH-833-ability-to-remove-ollama-model-provider branch from 2aeb6f6 to cc9e953 Compare March 10, 2026 12:48
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 10, 2026

@mfortman11 mfortman11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nicely done!

Comment thread frontend/app/settings/_components/ollama-settings-dialog.tsx
@github-actions github-actions Bot added the lgtm label Mar 10, 2026
Issues:

- #833

Summary

- Extracted duplicated dialog footer logic into a shared ModelProviderDialogFooter component across all four provider settings dialogs.

Refactor: Shared Dialog Footer Component

- Created model-provider-dialog-footer.tsx — a new reusable ModelProviderDialogFooter component that encapsulates both the remove-confirmation footer state and the standard save/cancel footer with optional
"Remove" button
- Defined a typed ModelProviderDialogFooterProps interface covering all props needed to drive both footer states (pending flags, configured/canRemove guards, tooltip text, and all action callbacks)

Refactored: Provider Settings Dialogs

- Replaced the duplicated inline DialogFooter JSX (including Tooltip/TooltipProvider wrappers) in anthropic-settings-dialog.tsx, ollama-settings-dialog.tsx, openai-settings-dialog.tsx, and
watsonx-settings-dialog.tsx with a single <ModelProviderDialogFooter /> usage each
- Removed per-dialog imports of DialogFooter, Tooltip, TooltipContent, TooltipProvider, and TooltipTrigger that were no longer needed after extraction
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Mar 10, 2026
@mpawlow

mpawlow commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator Author

Status Update

Implemented additional feedback from @mfortman11

  • ✅ Extracted duplicated dialog footer logic into a shared ModelProviderDialogFooter component across all four provider settings dialogs.
  • For full details, see: a578776

@mpawlow mpawlow merged commit c006d45 into main Mar 10, 2026
13 checks passed
@github-actions github-actions Bot deleted the mp/feat/GH-833-ability-to-remove-ollama-model-provider branch March 10, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) enhancement 🔵 New feature or request frontend 🟨 Issues related to the UI/UX lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Settings UX should let you remove a model provider

3 participants