The fastest way to give your local LLM web search superpowers
Stop running heavy SearXNG containers. BeamXNG is a zero-dependency Rust gateway that beams your queries to public SearXNG instances from searx.space with intelligent load balancing and automatic failover.
Perfect for: Ollama Β· LM Studio Β· Open WebUI Β· MCP Servers Β· Any LLM Stack
- πΈ Smart routing across 100+ public SearXNG instances
- β‘ Ultra-lightweight: 5.1MB binary, ~7.4MB idle RAM (measured β see BENCHMARKS.md)
- π Auto-failover with health checks and retry logic
- π― Multiple load balancing strategies: Round-robin, latency-based, random
- π Drop-in replacement for localhost:8080 SearXNG
- π¦ Blazingly fast - built with Rust and async I/O
- π Health monitoring - real-time instance status
- π Zero configuration - works out of the box
Grab the archive for your platform from the latest release, then:
# Linux/macOS example (adjust filename to the asset you downloaded)
tar -xzf beamxng-x86_64-unknown-linux-gnu.tar.gz
chmod +x beamxng
./beamxngPrebuilt archives are published for Linux (x86_64), macOS (x86_64, Apple Silicon) and Windows (x86_64) on every tagged release.
# Clone repository
git clone https://github.com/xonoxitron/beamxng.git
cd beamxng
# Build release binary
cargo build --release
# Run
./target/release/beamxngBeamXNG will start on http://127.0.0.1:8080 by default.
curl "http://localhost:8080/search?q=rust+programming&format=json"curl "http://localhost:8080/search?q=machine+learning&format=json&categories=science&engines=google,duckduckgo&language=en"curl "http://localhost:8080/health"curl "http://localhost:8080/instances"Configure via environment variables:
# Listen address and port
export BEAMXNG_ADDR="0.0.0.0"
export BEAMXNG_PORT=8080
# Load balancing strategy: roundrobin, latency, random
export BEAMXNG_STRATEGY="latency"
# Run
./beamxng- Start BeamXNG:
./beamxng-
Configure Open WebUI to use
http://localhost:8080as SearXNG URL -
Enable web search in your chat
{
"mcpServers": {
"searxng": {
"command": "npx",
"args": ["-y", "mcp-searxng"],
"env": {
"SEARXNG_URL": "http://localhost:8080"
}
}
}
}- Start BeamXNG
- Configure web search tool with URL:
http://localhost:8080 - Enable web search in your model
import requests
def search(query: str) -> dict:
response = requests.get(
"http://localhost:8080/search",
params={"q": query, "format": "json"}
)
return response.json()
results = search("artificial intelligence news")| Before (Self-hosted SearXNG) | After (BeamXNG) |
|---|---|
| β Docker + Redis + uwsgi | β Single binary |
| β ~200MB memory | β ~7-9MB memory |
| β Manual configuration | β Zero config |
| β Single point of failure | β Auto-failover |
| β Maintain instance updates | β Always up-to-date |
/searchlatency: 200-500ms typical (dominated by the selected public instance's response time β not measured in a fixed lab setup, see BENCHMARKS.md)/healthlatency: ~2.4ms mean, ~20,700 req/s, 0 failures under load (measured)- Memory usage: ~7.4MB idle, ~8.6MB under load (measured)
- Binary size: 5.1MB (release build, measured)
- Startup time: ~140ms to ready (measured)
See BENCHMARKS.md for detailed performance analysis and comparison.
cd benchmarks
./quick-bench.shBeamXNG supports three load balancing strategies:
- Latency-based (default): Selects fastest responding instance
- Round-robin: Cycles through instances sequentially
- Random: Randomly selects from healthy instances
export BEAMXNG_STRATEGY="roundrobin"
./beamxngBeamXNG automatically:
- Fetches instance list from searx.space every 5 minutes
- Health checks all instances every 60 seconds
- Marks instances unhealthy after 3 consecutive failures
- Automatically recovers instances when they come back online
Search endpoint compatible with SearXNG API.
Query Parameters:
q(required): Search queryformat: Response format (default:json)categories: Search categories (e.g.,general,science)engines: Search engines (e.g.,google,duckduckgo)language: Language code (e.g.,en)pageno: Page numbertime_range: Time filter (day,month,year)
Returns gateway health status and instance statistics.
Response:
{
"status": "healthy",
"healthy_instances": 87,
"total_instances": 102
}Lists all healthy instances with response times.
Response:
[
{
"url": "https://search.example.com",
"response_time_ms": 245
}
]Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
- SearXNG - Privacy-respecting metasearch engine
- searx.space - Public instance directory
Made with π¦ and πΈ by the BeamXNG community