[GH-ISSUE #20330] duckduckgo web_search gives: KeyError('lite') - backend is not exist or disabled. #57820

Closed
opened 2026-05-05 21:42:00 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @aikomastboom on GitHub (Jan 2, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20330

a7271532f8/backend/open_webui/retrieval/web/duckduckgo.py (L35)

logs:
open_webui.routers.retrieval:process_web_search:2114 - trying to web search with ('duckduckgo', ['my search'])
ddgs.ddgs:_get_engines:119 - KeyError('lite') - backend is not exist or disabled. Available: brave, duckduckgo, google, grokipedia, mojeek, wikipedia, yahoo, yandex. Using 'auto'

ddgs source code reference:
https://github.com/deedy5/ddgs/blob/main/ddgs/ddgs.py#L119

resolution:
change "lite" to "duckduckgo"

Originally created by @aikomastboom on GitHub (Jan 2, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20330 https://github.com/open-webui/open-webui/blob/a7271532f8a38da46785afcaa7e65f9a45e7d753/backend/open_webui/retrieval/web/duckduckgo.py#L35 logs: open_webui.routers.retrieval:process_web_search:2114 - trying to web search with ('duckduckgo', ['my search']) ddgs.ddgs:_get_engines:119 - KeyError('lite') - backend is not exist or disabled. Available: brave, duckduckgo, google, grokipedia, mojeek, wikipedia, yahoo, yandex. Using 'auto' ddgs source code reference: https://github.com/deedy5/ddgs/blob/main/ddgs/ddgs.py#L119 resolution: change "lite" to "duckduckgo"
Author
Owner

@owui-terminator[bot] commented on GitHub (Jan 2, 2026):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #12099 issue: fastapi.exceptions.HTTPException: 400: https://html.duckduckgo.com/html 202 Ratelimit
    by matthew777777 • Mar 26, 2025 • bug

💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3705487996 --> @owui-terminator[bot] commented on GitHub (Jan 2, 2026): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#12099](https://github.com/open-webui/open-webui/issues/12099) **issue: fastapi.exceptions.HTTPException: 400: https://html.duckduckgo.com/html 202 Ratelimit** *by matthew777777 • Mar 26, 2025 • `bug`* --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@frenzybiscuit commented on GitHub (Jan 2, 2026):

Cannot reproduce.

Images attached.

Image Image
<!-- gh-comment-id:3706086243 --> @frenzybiscuit commented on GitHub (Jan 2, 2026): Cannot reproduce. Images attached. <img width="1105" height="571" alt="Image" src="https://github.com/user-attachments/assets/04f62c99-89ed-4e9a-a1ac-9aa5e0f8561c" /> <img width="1465" height="603" alt="Image" src="https://github.com/user-attachments/assets/a0de5214-31a4-48b5-8f95-9d6de4b8507c" />
Author
Owner

@aikomastboom commented on GitHub (Jan 3, 2026):

I did not mention it does not provide results.

It does... instead due to the given lite argument, it falls back to auto mode.
Which means it randomly picks any of the "Available" providers.
lite has never been a valid backend provider for the ddgs package (AFAICT from git blame). cli help https://github.com/deedy5/ddgs/blob/main/ddgs/cli.py#L190

For me.. when I choose to use duckduckgo. I do not want it to call google.

My log information came from the container output, configured as follows:

docker-compose.yml snipped:

services:
  webui:
    image: ghcr.io/open-webui/open-webui:main
    restart: unless-stopped
    ports:
      - "3000:8080"
    extra_hosts: ["host.docker.internal:host-gateway"]
    environment:
      GLOBAL_LOG_LEVEL: DEBUG
    volumes:
      - ./webui:/app/backend/data

<!-- gh-comment-id:3706933899 --> @aikomastboom commented on GitHub (Jan 3, 2026): I did not mention it does not provide results. It does... instead due to the given `lite` argument, it falls back to `auto` mode. Which means it randomly picks any of the "Available" providers. `lite` has never been a valid backend provider for the ddgs package (AFAICT from git blame). cli help https://github.com/deedy5/ddgs/blob/main/ddgs/cli.py#L190 For me.. when I choose to use duckduckgo. I do not want it to call google. My log information came from the container output, configured as follows: docker-compose.yml snipped: ```yml services: webui: image: ghcr.io/open-webui/open-webui:main restart: unless-stopped ports: - "3000:8080" extra_hosts: ["host.docker.internal:host-gateway"] environment: GLOBAL_LOG_LEVEL: DEBUG volumes: - ./webui:/app/backend/data ```
Author
Owner

@Classic298 commented on GitHub (Jan 3, 2026):

but why would it call google if you didn't configure it?

<!-- gh-comment-id:3707173790 --> @Classic298 commented on GitHub (Jan 3, 2026): but why would it call google if you didn't configure it?
Author
Owner

@aikomastboom commented on GitHub (Jan 4, 2026):

Well I think there is a little misunderstanding about what the DDGS library does.
DDGS does not refer to duckduckgo alone.. but

DDGS | Dux Distributed Global Search
A metasearch library that aggregates results from diverse web search services.

Where duckduckgo is one of the available backends.
When giving the code an invalid (lite) backend specifier it will default to auto mode.
auto will pick a random backend from the supported ones by DDGS (https://github.com/deedy5/ddgs/blob/main/ddgs/ddgs.py#L117)

So if that (random) is intended behaviour for the DDGS option in the "Web search engine" selection. I have two questions:

  1. Please change "lite" to "auto" to remove the unneeded warning from the logs.
  2. Please provide a dedicated "duckduckgo" selection in the dropdown that only queries duckduckgo (it can reuse the same code, just specify "duckduckgo" in stead of "auto" in the call to DDGS library).
<!-- gh-comment-id:3707890574 --> @aikomastboom commented on GitHub (Jan 4, 2026): Well I think there is a little misunderstanding about what the [DDGS](https://github.com/deedy5/ddgs/) library does. DDGS does not refer to duckduckgo alone.. but > DDGS | Dux Distributed Global Search > A metasearch library that aggregates results from diverse web search services. Where duckduckgo is one of the available backends. When giving the code an invalid (`lite`) backend specifier it will default to `auto` mode. `auto` will pick a random backend from the supported ones by DDGS (https://github.com/deedy5/ddgs/blob/main/ddgs/ddgs.py#L117) So if that (random) is intended behaviour for the DDGS option in the "Web search engine" selection. I have two questions: 1. Please change "lite" to "auto" to remove the unneeded warning from the logs. 2. Please provide a dedicated "duckduckgo" selection in the dropdown that only queries duckduckgo (it can reuse the same code, just specify "duckduckgo" in stead of "auto" in the call to DDGS library).
Author
Owner

@aikomastboom commented on GitHub (Jan 4, 2026):

I found this in the changelog.md, it seems relevant to this issue:
https://github.com/open-webui/open-webui/blob/main/CHANGELOG.md?plain=1#L844C1-L844C151

  • 🔍 Clarified Web Search Engine Label for DDGS: Addressed user confusion and inaccurate labeling by renaming "duckduckgo" to "DDGS" (Dux Distributed Global Search) in the web search engine selector. This clarifies that the system utilizes DDGS, a metasearch library that aggregates results from various search providers, accurately reflecting its underlying functionality rather than implying exclusive use of DuckDuckGo's search engine.
<!-- gh-comment-id:3707943359 --> @aikomastboom commented on GitHub (Jan 4, 2026): I found this in the changelog.md, it seems relevant to this issue: https://github.com/open-webui/open-webui/blob/main/CHANGELOG.md?plain=1#L844C1-L844C151 > - 🔍 **Clarified Web Search Engine Label for DDGS**: Addressed user confusion and inaccurate labeling by renaming "duckduckgo" to "DDGS" (Dux Distributed Global Search) in the web search engine selector. This clarifies that the system utilizes DDGS, a metasearch library that aggregates results from various search providers, accurately reflecting its underlying functionality rather than implying exclusive use of DuckDuckGo's search engine.
Author
Owner

@Classic298 commented on GitHub (Jan 4, 2026):

Yes i know that ddgs is more than just duckduckgo

Ok thanks for your explanation

I don't see many scenarios where one would configure google in ddgs instead of open webui directly BUT i can understand where you're coming from.

PR welcome and I'll probably try to whip up a PR as well

<!-- gh-comment-id:3707985545 --> @Classic298 commented on GitHub (Jan 4, 2026): Yes i know that ddgs is more than just duckduckgo Ok thanks for your explanation I don't see many scenarios where one would configure google in ddgs instead of open webui directly BUT i can understand where you're coming from. PR welcome and I'll probably try to whip up a PR as well
Author
Owner

@aikomastboom commented on GitHub (Jan 4, 2026):

I turned to building my own image with the following changes, that reflect the issue.

Index: backend/open_webui/retrieval/web/duckduckgo.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/backend/open_webui/retrieval/web/duckduckgo.py b/backend/open_webui/retrieval/web/duckduckgo.py
--- a/backend/open_webui/retrieval/web/duckduckgo.py	(revision a7271532f8a38da46785afcaa7e65f9a45e7d753)
+++ b/backend/open_webui/retrieval/web/duckduckgo.py	(date 1767524133596)
@@ -13,6 +13,7 @@
     count: int,
     filter_list: Optional[list[str]] = None,
     concurrent_requests: Optional[int] = None,
+    backend: Optional[str] = "auto"
 ) -> list[SearchResult]:
     """
     Search using DuckDuckGo's Search API and return the results as a list of SearchResult objects.
@@ -32,7 +33,7 @@
         # Use the ddgs.text() method to perform the search
         try:
             search_results = ddgs.text(
-                query, safesearch="moderate", max_results=count, backend="lite"
+                query, safesearch="moderate", max_results=count, backend=backend
             )
         except RatelimitException as e:
             log.error(f"RatelimitException: {e}")
Index: src/lib/components/admin/Settings/WebSearch.svelte
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/lib/components/admin/Settings/WebSearch.svelte b/src/lib/components/admin/Settings/WebSearch.svelte
--- a/src/lib/components/admin/Settings/WebSearch.svelte	(revision a7271532f8a38da46785afcaa7e65f9a45e7d753)
+++ b/src/lib/components/admin/Settings/WebSearch.svelte	(date 1767522305478)
@@ -28,6 +28,7 @@
 		'searchapi',
 		'serpapi',
 		'duckduckgo',
+		'ddgs',
 		'tavily',
 		'jina',
 		'bing',
@@ -121,8 +122,8 @@
 							>
 								<option disabled selected value="">{$i18n.t('Select a engine')}</option>
 								{#each webSearchEngines as engine}
-									{#if engine === 'duckduckgo' || engine === 'ddgs'}
-										<option value={engine}>DDGS</option>
+									{#if engine === 'ddgs'}
+										<option value={engine}>DDGS (metasearch)</option>
 									{:else}
 										<option value={engine}>{engine}</option>
 									{/if}
Index: backend/open_webui/routers/retrieval.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py
--- a/backend/open_webui/routers/retrieval.py	(revision a7271532f8a38da46785afcaa7e65f9a45e7d753)
+++ b/backend/open_webui/routers/retrieval.py	(date 1767524133623)
@@ -1972,6 +1972,15 @@
             request.app.state.config.WEB_SEARCH_RESULT_COUNT,
             request.app.state.config.WEB_SEARCH_DOMAIN_FILTER_LIST,
             concurrent_requests=request.app.state.config.WEB_SEARCH_CONCURRENT_REQUESTS,
+            backend="duckduckgo"
+        )
+    elif engine == "ddgs":
+        return search_duckduckgo(
+            query,
+            request.app.state.config.WEB_SEARCH_RESULT_COUNT,
+            request.app.state.config.WEB_SEARCH_DOMAIN_FILTER_LIST,
+            concurrent_requests=request.app.state.config.WEB_SEARCH_CONCURRENT_REQUESTS,
+            backend="auto"
         )
     elif engine == "tavily":
         if request.app.state.config.TAVILY_API_KEY:

<!-- gh-comment-id:3707991375 --> @aikomastboom commented on GitHub (Jan 4, 2026): I turned to building my own image with the following changes, that reflect the issue. ```patch Index: backend/open_webui/retrieval/web/duckduckgo.py IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/backend/open_webui/retrieval/web/duckduckgo.py b/backend/open_webui/retrieval/web/duckduckgo.py --- a/backend/open_webui/retrieval/web/duckduckgo.py (revision a7271532f8a38da46785afcaa7e65f9a45e7d753) +++ b/backend/open_webui/retrieval/web/duckduckgo.py (date 1767524133596) @@ -13,6 +13,7 @@ count: int, filter_list: Optional[list[str]] = None, concurrent_requests: Optional[int] = None, + backend: Optional[str] = "auto" ) -> list[SearchResult]: """ Search using DuckDuckGo's Search API and return the results as a list of SearchResult objects. @@ -32,7 +33,7 @@ # Use the ddgs.text() method to perform the search try: search_results = ddgs.text( - query, safesearch="moderate", max_results=count, backend="lite" + query, safesearch="moderate", max_results=count, backend=backend ) except RatelimitException as e: log.error(f"RatelimitException: {e}") Index: src/lib/components/admin/Settings/WebSearch.svelte IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/src/lib/components/admin/Settings/WebSearch.svelte b/src/lib/components/admin/Settings/WebSearch.svelte --- a/src/lib/components/admin/Settings/WebSearch.svelte (revision a7271532f8a38da46785afcaa7e65f9a45e7d753) +++ b/src/lib/components/admin/Settings/WebSearch.svelte (date 1767522305478) @@ -28,6 +28,7 @@ 'searchapi', 'serpapi', 'duckduckgo', + 'ddgs', 'tavily', 'jina', 'bing', @@ -121,8 +122,8 @@ > <option disabled selected value="">{$i18n.t('Select a engine')}</option> {#each webSearchEngines as engine} - {#if engine === 'duckduckgo' || engine === 'ddgs'} - <option value={engine}>DDGS</option> + {#if engine === 'ddgs'} + <option value={engine}>DDGS (metasearch)</option> {:else} <option value={engine}>{engine}</option> {/if} Index: backend/open_webui/routers/retrieval.py IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py --- a/backend/open_webui/routers/retrieval.py (revision a7271532f8a38da46785afcaa7e65f9a45e7d753) +++ b/backend/open_webui/routers/retrieval.py (date 1767524133623) @@ -1972,6 +1972,15 @@ request.app.state.config.WEB_SEARCH_RESULT_COUNT, request.app.state.config.WEB_SEARCH_DOMAIN_FILTER_LIST, concurrent_requests=request.app.state.config.WEB_SEARCH_CONCURRENT_REQUESTS, + backend="duckduckgo" + ) + elif engine == "ddgs": + return search_duckduckgo( + query, + request.app.state.config.WEB_SEARCH_RESULT_COUNT, + request.app.state.config.WEB_SEARCH_DOMAIN_FILTER_LIST, + concurrent_requests=request.app.state.config.WEB_SEARCH_CONCURRENT_REQUESTS, + backend="auto" ) elif engine == "tavily": if request.app.state.config.TAVILY_API_KEY: ```
Author
Owner

@Classic298 commented on GitHub (Jan 4, 2026):

Thanks, I'll try to make it a more comprehensive fix

<!-- gh-comment-id:3707995804 --> @Classic298 commented on GitHub (Jan 4, 2026): Thanks, I'll try to make it a more comprehensive fix
Author
Owner

@Classic298 commented on GitHub (Jan 4, 2026):

fixed in dev

<!-- gh-comment-id:3708512142 --> @Classic298 commented on GitHub (Jan 4, 2026): fixed in dev
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#57820