Darash
Darash is a provider-neutral async Rust client for a local or remote SearxNG instance. It builds SearxNG JSON search requests, bounds response sizes, and projects results into citations without requiring an API key.
Local SearxNG
The official SearxNG Docker Compose setup is the quickest local instance. It requires Docker with Compose:
SearxNG is then available at http://localhost:8080. Stop it with
docker compose down. See the SearxNG container documentation
for configuration and maintenance.
Use the crate
Darash is not yet published on crates.io. Depend on the public repository for now:
[]
= { = "https://github.com/tschk/darash", = "main" }
= { = "1", = ["macros", "rt-multi-thread"] }
Create a client, build a query, and search asynchronously:
use ;
async
SearchResponse also exposes the raw SearxNG query, result count, results,
answers, corrections, and suggestions. Its optional answer is a backend
answer when one is supplied; Darash does not call an AI provider. sources and
cited_sources() expose the cited Citation values for host-owned synthesis.
Each SearchResult includes its title, URL, snippet, engines, category,
publication date, and score.
The Vane-compatible request contract carries a search mode and source selection without adding provider credentials:
use ;
async
SearchMode supports Speed, Balanced (the default), and Quality.
SearchSource supports Web (the default), Academic, and Discussions.
JSON requests may omit mode and sources; they default to balanced and
web.
The host can synthesize an answer from the returned sources with its own model.
CLI
The native CLI uses http://localhost:8080 by default and does not require an
environment variable. Pass --url only when using another SearxNG endpoint:
The CLI prints any backend answer and the cited sources. AI synthesis remains a host responsibility; no MCP server is needed for this in-process tool.
Use SearchConfig when the endpoint needs a custom timeout:
use Duration;
use ;
Limits and errors
- Requests time out after 15 seconds by default; configure this with
SearchConfig::with_timeout. - Response bodies are capped at 256 KiB, including streamed responses.
- Queries must contain non-whitespace text, and page numbers start at 1.
- Endpoints must use
httporhttpsand cannot contain embedded credentials. - Redirects are disabled. Point the client at the final SearxNG endpoint.
Errordistinguishes invalid configuration, request failures, non-success HTTP responses, oversized or invalid responses, and JSON decode failures.
Native quality checks
Run these commands from the crate root:
Darash is licensed under MPL-2.0.