Native Claude web search vs self-hosted SearXNG for local LLMs
Anthropic’s native web_search tool is the baseline everyone compares against — and it is the one option you cannot use the moment your model stops running on Anthropic’s servers. The same web_search_20250305 request answered by the API server-side can be answered, on-box, by a load balancer in front of a local model. Here is cost, context and quality, side by side.
Series — web search for local LLMs: Overview · Native Claude vs self-hosted · Search quality · Output formats & token cost · Next stage: Web scrapers for local LLMs
The mechanism
Claude Code’s WebSearch is server-side: the client fires a nested POST /v1/messages carrying a web_search_20250305 tool block, and the endpoint is expected to do the searching, returning server_tool_use + web_search_tool_result blocks. On api.anthropic.com the API searches. In front of a local model, our load balancer intercepts that identical block before any model sees it and answers it from a self-hosted SearXNG — same wire shape, different performer.
Worked example: the query robertz.co
Run locally on my fleet.
| query | warm | cold | results | injected tok | raw JSON tok |
|---|---|---|---|---|---|
robertz.co | 1,163 ms | 3,643 ms | 10 | 530 | 1,057 |
| mean of 3 robertz.co queries | 894 ms | 4,022 ms | 10 | 556 | 1,197 |
Ours — real response (all 10 results)
{"type": "server_tool_use",
"id": "srvtoolu_70eca560776d4a4bb4886528",
"name": "web_search",
"input": {"query": "robertz.co"}},
{"type": "web_search_tool_result",
"tool_use_id": "srvtoolu_70eca560776d4a4bb4886528",
"content": [
{"type": "web_search_result",
"title": "simulators — robertz.co — 22 interactive simulators you can run in the browser: digital logic and CPUs, networking and radio, databases, auth flows and algorithm complexity. No install, no sign-up.",
"url": "https://robertz.co/simulators/",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "www.Robertz.com - Welcome to RobertZ Web Site — In the United Kingdom, Robertz.com is ranked 18,301,672, with an estimated 4,536 monthly visitors a month. Click to view other data about this site.",
"url": "http://urlm.co.uk/www.robertz.com",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "Robert Zieliński — software engineer · robertz.co — Robert Zieliński — software engineer behind robertz.co, leometeo.com, and dobrapogoda24. Notes on infra, deploys, Python, and Ruby on Rails.",
"url": "https://robertz.co/",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "Roberts Co — Roberts Co is a boutique tier one construction company. We're here to build a better way.",
"url": "https://roberts.co/",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "www.Robertz.com - Welcome to RobertZ Web Site — In the United States, Robertz.com is ranked 37,782,615, with an estimated 10,206 monthly visitors a month. Click to view other data about this site.",
"url": "http://urlm.co/www.robertz.com",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "www.Robertzandco.com - Robertz & Co. — In België, Robertzandco.com heeft 530.064 in de rangschikking met een geschatte < 300 bezoekers per maand. Klik om andere gegevens over deze site te bekijken.",
"url": "http://urlmetrics.be/www.robertzandco.com",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "Link to instagram.com — The site owner hides the web page description.",
"url": "https://www.instagram.com/robertz.co/",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "Home - The Roberts Company — Safety, reliability, responsiveness, expertise and innovation. These are the drivers behind the products and services provided by...",
"url": "https://www.robertscompany.com/",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "robertz | robzlog — Hello and welcome. Who am I? Robert Zarywacz I'm a real person who lives in Ilfracombe in North Devon, England on the coast of the Bristol Channel.",
"url": "https://www.robzlog.co.uk/robertz",
"encrypted_content": "", "page_age": null},
{"type": "web_search_result",
"title": "Robertz and Co – Stratégie – Organisation – Management – Marketing — Cabinet de Conseil en Stratégie, Organisation et Management. Robertz & Co accompagne les organisations dans la réalisation de leurs projets stratégiques afin d’améliorer leurs...",
"url": "https://robertzandco.com/",
"encrypted_content": "", "page_age": null}
]}
Native Claude — documented raw format; results below captured via Claude Code’s native WebSearch
{"type": "server_tool_use",
"id": "<id>",
"name": "web_search",
"input": {"query": "robertz.co"}},
{"type": "web_search_tool_result",
"tool_use_id": "<id>",
"content": [
{"type": "web_search_result",
"title": "<title>",
"url": "<url>",
"encrypted_content": "<encrypted_content>",
"page_age": "<page_age>"},
…
]}
- Same block types and field names; our
encrypted_contentis empty,page_agenull. - q1 hits: 2 on target (
robertz.co/,robertz.co/simulators/), 8 off-target (urlm.co.uk/robertz.com, instagram.com/robertz.co, robertzandco.com, …). - Native q1 hits: 0 on target of 10 — every result a look-alike (auditregister.org.uk ×5, finmag.cz ×2, ltds.uk, officer.com, thewaternetwork.com).
Native vs SearXNG — the same 3 queries
Run locally on my fleet. Native = Anthropic’s server-side search, invoked through Claude Code’s WebSearch tool (the result list as the tool returns it, not the raw API blocks). Native latency = wall clock around the tool call, 2 runs each — includes Claude Code tool overhead (the tool’s own nested model turn).
| query | SearXNG on-target | native on-target | target found (SearXNG / native) | SearXNG warm · cold | native run 1 · run 2 |
|---|---|---|---|---|---|
q1 robertz.co | 2 / 10 | 0 / 10 | homepage #3 / ✗ | 1.16 s · 3.64 s | 5.36 s · 5.10 s |
q2 robertz.co authentication methods battle | 3 / 10 | 0 / 9 | ✓ #2 / ✗ | 0.85 s · 3.38 s | 5.26 s · 5.73 s |
q3 robertz.co broker_parrot self-hosted job fleet | 2 / 10 (+ own GitHub repo) | 0 / 10 | ✓ #1 / ✗ | 0.67 s · 5.04 s | 5.70 s · 6.59 s |
| mean | 2.3 / 10 | 0 / 10 | 3/3 / 0/3 | 0.89 s · 4.02 s | 5.62 s |
Native results, as returned:
| query | native results (title → domain) |
|---|---|
| q1 | Firm Details → auditregister.org.uk ×5 · ltds.uk / companies / 10653973 → robert-r-co-ltd.ltds.uk · officer.com → officer.com · ROBERTS s.r.o. → finmag.cz · Robert Scholz → finmag.cz · Robert Benz, Account Manager → thewaternetwork.com — identical on all 3 calls |
| q2 | Modern Authentication Methods A Comprehensive Survey → academia.edu · strong authentication technologies survey white paper → thalesgroup.com · Unlocking the World of Authentication Methods → payatu.com · Authentication → scribd.com ×3 · secureauth.com · Chapter 4. Authentication → oreilly.com · Hacker News → news.ycombinator.com — identical on both calls |
| q3 run 1 | jobd → pypi.org · jobd → socket.dev · glama.ai ×2 · musharna jobd → enterprisedna.co · Cenvero Fleet → producthunt.com · crabbox.sh · Self Hosted installation → docs.nextgraph.org · PyPI Stats → pypistats.org · Fleet → fleetdm.com |
| q3 run 2 | jobd → pypi.org · jobd → socket.dev · Cenvero Fleet → producthunt.com ×3 · Self Hosted installation → docs.nextgraph.org · Karshipta fleet console → discuss.ardupilot.org · PyPI Stats → pypistats.org · Broker Fleet → memclaw.net · sideplane → gitblind.noratr.app |
Side by side
| Native Claude | SearXNG + LB (ours) | Hosted APIs (Tavily/Brave/Exa) | |
|---|---|---|---|
| $ / 1,000 searches | $10 + result tokens (failed searches free) | $0 marginal | ~$5–16 |
| Quality evidence | dynamic filtering: BrowseComp 45.3→61.6% (Opus 4.6), DeepsearchQA F1 69.8→77.3%, input tok −24% avg; no plain SimpleQA; index undisclosed (Brave reported, unconfirmed); robertz.co spot check: 0/3 targets found | ≈ upstream engines (Brave + Google CSE); robertz.co spot check: 3/3 targets found | vendor-reported, answer-tuned snippets |
| Context / search | ~6,000 tok (from docs); encrypted blocks are heavy | 556 tok/search, 10 results (measured) | varies by API |
| Latency / search | ~5.6 s via Claude Code WebSearch (incl. tool overhead; measured) | ~0.9 s warm · ~4 s cold (measured) | not run |
| Runs with a local model | ✗ no — Anthropic-hosted endpoints only | ✓ yes | ✓ yes (client calls it) |
| Data leaves the box | ✗ yes, to Anthropic | conversation local; query → Brave/Google | ✗ yes, to the vendor |
| Controls | max_uses cap, domain allow/block filters, citations built in | self-hosted engine config; named-failure contract | per-vendor API params |
↔ scroll the table sideways to see every column. Native runs on the Claude API, Claude on AWS's platform and Foundry on Anthropic-hosted deployments — not Bedrock; Google Cloud carries only the basic version. The newer tool versions add dynamic filtering (web_search_20260209) and response-inclusion (web_search_20260318).
Cost per search
Verdict
- Native Claude — when you’re already on Anthropic’s API, want the best answers with zero build, and accept the per-search fee and the context weight. Irrelevant the instant your model is local.
- Self-hosted (SearXNG + LB) — when the model is local, the conversation must stay on-box, and you want zero marginal cost per search; every
:8010client gets native WebSearch with no config. - Hosted API — when the model is remote anyway but you don’t want to run a search engine; query and data leave for a third party.