Native Claude web search vs self-hosted SearXNG for local LLMs — article mark

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.

Native search runs inside Anthropic's API; our load balancer intercepts the identical request and answers it from a local SearXNG The same web_search_20250305 request, two endpoints Native — on Anthropic's API client api.anthropic.com performs the search itself web $10 / 1,000 searches, billed per search; results count as input tokens — this turn and every later one. Ours — load balancer in front of local models client :8010 Claude Code · Hermes LB intercepts the block no model sees it; not lease demand SearXNG local metasearch Brave Google CSE The LB synthesises the same two blocks the client reads — so native WebSearch works with zero client config. $0 per query, conversation stays local — but the query itself still travels to Brave / Google.
Same wire shape, different performer. Native search is a feature of Anthropic's servers; our load balancer impersonates that feature and answers from a self-hosted metasearch engine. The client cannot tell the difference.

Worked example: the query robertz.co

Run locally on my fleet.

querywarmcoldresultsinjected tokraw JSON tok
robertz.co1,163 ms3,643 ms105301,057
mean of 3 robertz.co queries894 ms4,022 ms105561,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>"},
  …
 ]}

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).

querySearXNG on-targetnative on-targettarget found (SearXNG / native)SearXNG warm · coldnative run 1 · run 2
q1 robertz.co2 / 100 / 10homepage #3 / ✗1.16 s · 3.64 s5.36 s · 5.10 s
q2 robertz.co authentication methods battle3 / 100 / 9✓ #2 / ✗0.85 s · 3.38 s5.26 s · 5.73 s
q3 robertz.co broker_parrot self-hosted job fleet2 / 10 (+ own GitHub repo)0 / 10✓ #1 / ✗0.67 s · 5.04 s5.70 s · 6.59 s
mean2.3 / 100 / 103/3 / 0/30.89 s · 4.02 s5.62 s

Native results, as returned:

querynative results (title → domain)
q1Firm 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
q2Modern 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 1jobd → 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 2jobd → 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 ClaudeSearXNG + LB (ours)Hosted APIs (Tavily/Brave/Exa)
$ / 1,000 searches$10 + result tokens (failed searches free)$0 marginal~$5–16
Quality evidencedynamic 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 foundvendor-reported, answer-tuned snippets
Context / search~6,000 tok (from docs); encrypted blocks are heavy556 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 Anthropicconversation local; query → Brave/Google✗ yes, to the vendor
Controlsmax_uses cap, domain allow/block filters, citations built inself-hosted engine config; named-failure contractper-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).

Marginal cost per thousand searches: $10 plus result tokens for native Claude, zero for self-hosted SearXNG, roughly five to sixteen dollars for a hosted API Marginal cost per 1,000 searches $10 + ~6k result tok (from docs) Native Claude $0 marginal · 556 tok/search SearXNG + LB (ours) ~$5–16 data off-box Hosted APIs
Native: metered per search plus ~6k result tokens (from docs), re-read every later turn. Ours: $0 marginal, 556 tokens and ~0.9 s warm per search (measured, robertz.co queries). A hosted API trades on-box privacy for a search index you don't run.

Verdict

Questions? Let's Chat :)

ai llm engineering