Enhance UI, centralize theme colors, and add SearXNG backend - #264
Merged
Conversation
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
marked this pull request as ready for review
July 29, 2026 11:44
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch Sync