Skip to content

Enhance UI, centralize theme colors, and add SearXNG backend - #264

Merged
thomas9120 merged 10 commits into
betafrom
main
Jul 29, 2026
Merged

Enhance UI, centralize theme colors, and add SearXNG backend#264
thomas9120 merged 10 commits into
betafrom
main

Conversation

@thomas9120

Copy link
Copy Markdown
Owner

Branch Sync

thomas9120 and others added 10 commits July 26, 2026 12:26
Enhance documentation and improve application UI and routing
Centralize theme surface colors using CSS tokens
Refactor theme colors and shadows for improved light theme support
Refactor theme switcher to dropdown and expand theme system
Web search previously used DuckDuckGo (ddgs) exclusively. Add an optional SearXNG metasearch backend: when LLAMA_GUI_SEARXNG_URL is set (e.g. http://127.0.0.1:8888) it is queried first and ddgs is used as a fallback whenever SearXNG is unset, unreachable, or returns no results. The default is empty, so existing installs keep using ddgs only with no behaviour change.

The dispatch is refactored so web_search() now selects the backend, the previous ddgs implementation moves unchanged into ddgs_search(), and searxng_search() queries the JSON API directly (bypassing any environment proxy, since SearXNG is expected to be local/trusted). Public callers still use web_search() with the same signature and result shape.
Implement submenu ordering and sampling grouping features
Create pull_request_template.md
List models recursively and normalize model paths
Web search was hard-wired to DuckDuckGo (ddgs). Add an opt-in SearXNG backend:
set LLAMA_GUI_SEARXNG_URL (e.g. http://127.0.0.1:8888) and SearXNG is queried
first, with ddgs as the fallback whenever SearXNG is unset, unreachable, or
returns no usable results. The default is empty, so existing installs keep
using ddgs only with no behaviour change. The instance must expose the JSON
format (settings.yml must include "json" under search.formats).

web_search() becomes a small dispatcher; the previous ddgs implementation moves
unchanged into ddgs_search(), and searxng_search() queries the JSON API directly
(empty ProxyHandler, since SearXNG is expected to be a local/trusted host).

searxng_search() is defensive so any misconfiguration or hostile response falls
back to ddgs instead of raising: endpoint parsing and http(s)+hostname
validation, request construction, I/O, JSON decoding, and normalization all run
inside the guarded block (so inputs like "http://[bad" that make urlparse raise
are caught too). The response must be a JSON object with a results list; rows
must be objects whose url is a non-empty http(s) string with a hostname, and
non-string title/snippet fields are dropped (a non-string title falls back to
the url). safesearch is not overridden, so the instance's policy applies. The
real error is logged to stderr and a generic failure is returned.

Adds tests for parsing, max_results, not-configured, network failure, malformed
URLs (including an invalid bracketed URL), non-object JSON, a non-list results
field, malformed and wrong-typed rows, safesearch omission, and guaranteed ddgs
fallback. README and docs/directory.md now describe the optional SearXNG backend.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add optional SearXNG search backend with ddgs fallback
@thomas9120
thomas9120 marked this pull request as ready for review July 29, 2026 11:44
@thomas9120
thomas9120 merged commit 50dd0dc into beta Jul 29, 2026
5 checks passed
@thomas9120

Copy link
Copy Markdown
Owner Author

This will be in a release soon, but it's in the main repo now so a git clone will bring it in.

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