Who Executes Web Search and File Reading in LLM APIs: Client-Side Orchestration vs. Server-Side Tools
This article examines who actually performs web search and file reading in large language model APIs: the client application or the server. It compares two implementation paths for a research-style query, explains how to choose based on control over the workflow, and clarifies that enabling a web tool does not guarantee a live search occurred. It also covers key engineering considerations for file inputs—parsing quality, length management, traceable citations, and visible failures—along with a practical checklist for building reliable retrieval-augmented applications.
1. Where the Problem Starts: From “Answering” to “Search First, Then Answer”
Letting a model answer a question directly and letting it look up information before answering have long been two different things in engineering. The former only requires sending a message to get started. The latter requires connecting search capabilities, downloading web pages, extracting the main text, cleaning up noise, and then stitching the organized material back into the conversation context. What makes it harder is that when the model returns a tool-call intent, the application usually has to keep executing the next step, forming a multi-turn loop.
A cloud provider recently opened up a set of application-layer API capabilities. The point worth noting is not the increase in the number of interfaces, but that some of the work has been moved to the server side: search, link reading, and context assembly can be coordinated with model inference within the same request chain. Developers still need to build the application, but they no longer have to implement every web action as a client-side loop.
This article discusses this change from a general technical perspective and does not evaluate any specific vendor’s product.
2. Two Implementation Paths for a “Look It Up” Question
Suppose you want to build an assistant that helps readers compare product version updates. A user sends a link to an official site and asks what problem this update solved. The following example is only meant to illustrate the flow and does not represent any measured conclusions.
Path A: Client-Side Orchestration
- The application identifies the link in the user message;
- The application issues the web request and handles timeouts, download failures, and redirects;
- The application extracts the main text, removes ads and navigation, and trims the length;
- The application passes the organized material to the model as context;
- If the model judges that the information is insufficient and requests additional retrieval, the application calls the search capability again, catches the result, and enters the next round.
The core feature of this path is: the model is responsible for judgment, and the application is responsible for actually running the tools. The responsibilities of the two are clear, but the intermediate handling cost is entirely borne by the developer.
Path B: Server-Side Tool Coordination
The client declares the allowed capabilities in the request, and the server is responsible for the related execution and material backfilling. Model judgment and tool execution are still two distinct stages; the difference is that developers no longer have to repeatedly shuttle results between the two themselves.
A sample request structure is as follows (field names are generic illustrations, not a specific interface specification):
{"model": "chat-model","messages": [{"role": "user", "content": "What problem does this update solve? https://example.com/changelog"}],"tools": ["web_search", "read_url"],"tool_choice": "auto"}
Selection Criteria: Who Controls the Flow
General practice usually distinguishes two types of entry points: if you want the model to decide on its own when to go online, you can use server-side tools embedded in the conversation; if the application needs to control the query terms itself and directly obtain retrieval or crawling results, use standalone retrieval and crawling interfaces. Which path to choose essentially depends on who holds control over the flow.
| Dimension | Client-Side Orchestration | Server-Side Tools |
|---|---|---|
| Flow control | Fully controlled by the application | Model participates in decisions |
| Query-term control | Precisely controllable | Generated by the model |
| Engineering cost | High (loop maintenance required) | Lower |
| Observability | Requires self-built instrumentation | Relies on returned events |
| Failure retry | Designed by the application | Constrained by server-side policy |
3. Enabling Search Does Not Mean Every Search Actually Runs
Web tools need to be explicitly declared in the request: one for search, and one for reading links in the user message. If you only want to read a specified link, you can declare only the reading capability.
Although these tools look like ordinary functions, you cannot simply apply all the control methods of custom tools to them. Common constraints include:
- You cannot force a specific one of them via the tool-choice parameter, or the request will be rejected (typically returning 400);
- Whether a search or link read is actually initiated is decided by the model based on the question;
- Setting tool choice to “none” will also disable these web capabilities.
This leads to an important product conclusion: a UI showing “web enabled” only means the capability is available; it does not prove that this answer actually retrieved external material. The application should judge based on returned tool events and citation information, and should not label something as “verified” just because the tone of the answer sounds confident.
With search enabled, thinking mode also affects behavior. Without thinking enabled, the model retrieves as needed for the question and provides citations. With thinking enabled, the model can repeatedly search, open pages, and locate content across multiple reasoning steps. The multi-step flow provides opportunities for further verification, but it does not guarantee that every conclusion is automatically correct.
4. File Reading: First Turn the File into Usable Material
File input is also not finished once you “send the file name to the model.” Materials such as documents, spreadsheets, presentations, and images usually need text extraction or layout parsing before entering the conversation context. Engineering practice suggests focusing on four points:
- Parsing quality: scanned documents need optical recognition, and complex layouts need structured reconstruction;
- Length management: overly long material needs chunking, summarization, and recall to avoid context overflow;
- Traceable citations: retain page or paragraph locations to make it easy to annotate sources in answers;
- Visible failures: parsing failures should be explicitly reported rather than silently returning empty content.
5. Engineering Practice Checklist
- Define boundaries: first decide who owns flow control, then choose the entry point;
- Prioritize observability: record tool events, citation lists, and latency to form an auditable chain;
- Validate results: double-check the “web-enabled” status to avoid misleading users;
- Control costs: distinguish question types that “must be retrieved in real time” from those that “can be cached”;
- Security and compliance: sanitize crawled content to guard against prompt injection and unauthorized instructions;
- Fallback strategy: when a tool is unavailable, clearly inform the user rather than fabricating an answer.
6. Conclusion
Who executes web search and file reading determines the application’s complexity, controllability, and observability. Understanding the layering of “model judgment” and “tool execution” is what allows you to make a reasonable trade-off between client-side orchestration and server-side coordination, and to build retrieval-augmented applications that are both intelligent and reliable.
