Drop-in proxy that lets your LLM decide when to search
It sits between your LLM client and its API, injecting live search only when the model decides it needs fresh data.

What it does
search2ai is a middleware proxy that wraps popular LLM APIs—OpenAI, Azure OpenAI, Gemini, Groq, and Moonshot—and gives them the ability to search the web, read news, and summarize specific URLs. You point your existing client at the proxy’s URL instead of the provider’s, and the model itself judges whether a query needs up-to-date information. If it does, the proxy fetches results from a configured search service and feeds them back into the conversation. The README emphasizes that this does not break other features like image generation or voice.
The interesting bit
The clever part is the drop-in transparency: you do not install a plugin, swap API keys, or modify your client beyond changing the base URL. The project is essentially well-organized glue code—JavaScript Workers and Node scripts—that intercepts chat requests, appends search context when the model asks for it, and returns responses in both streaming and non-streaming modes where supported.
Key highlights
- Supports multiple LLM backends (OpenAI, Azure OpenAI, Groq, Gemini, Moonshot) and search providers (Google, Bing, DuckDuckGo, SearXNG, SerpApi, Search1API, Serper).
- Deploys as a Cloudflare Worker, on Zeabur/Vercel, or self-hosted locally; the Worker version requires zero code changes to deploy.
- The model decides per-request whether to search, so simple prompts do not pay the latency penalty of a web round-trip.
- Does not interfere with unrelated API capabilities such as image generation or voice, according to the README.
- Optional authorization keys let you issue custom request keys to users rather than exposing the provider’s master key.
Caveats
- Vercel deployments currently lack streaming support and carry a 10-second response limit, which the author admits makes for poor real-world experience.
- Moonshot streaming support is partial and described as “lossy” in the version history.
- Deep crawling to retrieve full web-page text is restricted to Search1API and is explicitly flagged as slow.
Verdict
If you run a third-party LLM client that lacks native web search and want a quick, provider-agnostic proxy, this is a pragmatic fit. If you need reliable deep crawling across multiple search backends or high-performance streaming on serverless platforms, you may want to wait for the promised improvements or look elsewhere.
Frequently asked
- What is fatwang2/search2ai?
- It sits between your LLM client and its API, injecting live search only when the model decides it needs fresh data.
- Is search2ai open source?
- Yes — fatwang2/search2ai is open source, released under the MIT license.
- What language is search2ai written in?
- fatwang2/search2ai is primarily written in JavaScript.
- How popular is search2ai?
- fatwang2/search2ai has 1.3k stars on GitHub.
- Where can I find search2ai?
- fatwang2/search2ai is on GitHub at https://github.com/fatwang2/search2ai.