Who Executes Web Search and File Reading in LLM Applications: Client-Side Orchestration vs. Server-Side Tools
This article explains who actually executes web search and file reading when a large language model answers a question: the application or the server. It compares client-side orchestration with server-side hosted tools, clarifies that declaring a web tool does not force it to run, outlines the pipeline that turns raw files into usable context, and offers observability and engineering practices for verifying whether external actions really happened.
1. Starting Point: From “Answering” to “Search First, Then Answer”
Letting a model answer directly and letting it retrieve information before answering have long been two different engineering tasks. The former can be started by sending a single message. The latter requires wiring up a retrieval service, fetching web pages, extracting the main text, cleaning up noise, and stitching the usable material back into the conversation context. It gets more complicated when the model returns a tool-call intent: the application usually has to catch the result, judge whether it succeeded, and decide whether to run another round.
A platform recently opened up a set of capabilities aimed at the application side. The focus is not on adding more endpoints, but on moving some execution steps to the server: retrieval, link reading, and context assembly can now be coordinated within the same request semantics as model inference. Developers still need to build applications, but they no longer have to implement every web action as a loop inside the client.
2. Two Paths: Client-Side Orchestration vs. Server-Side Hosting
Imagine a “product update comparison assistant”: a user provides a link to an official website and asks which issues the latest update fixed. This example only illustrates the flow and does not represent any measured conclusion.
Path A: The Application Orchestrates Everything
- The application detects the link in the message.
- The application issues the fetch and handles timeouts, retries, and anti-scraping limits.
- The application extracts the main text, removing ads and navigation while keeping titles and paragraphs.
- The application feeds the cleaned material back to the model.
- If the model decides the information is insufficient, the application calls the retrieval endpoint again, catches the result, and enters the next round.
The defining feature of this path: the model makes the judgment, and the application makes the tools actually run.
Path B: The Server Hosts the Tools
The client declares which capabilities are allowed in the request, and the server handles execution and material insertion. Model judgment and tool execution are still two distinct steps; the difference is that developers no longer have to shuttle intermediate results between them by hand.
The official documentation usually distinguishes two types of entry points: if you want the model to decide on its own when to go online, use the server-side tools inside the conversation; if the application needs to control the query terms itself and get retrieval or fetch results directly, use the standalone retrieval and fetch endpoints. Which path to choose essentially comes down to “who controls the flow.”
3. Declaring a Capability Does Not Force It to Trigger
Web tools must be explicitly declared in the request. The common semantics are: one for search, and one for reading links in the user message. If you only want to read a specific link, you can declare only the reading capability.
Note that although these tools look like ordinary functions, you cannot simply apply all the control methods of custom tools to them:
- They usually do not support forcing a specific one through a forced-selection parameter; doing so returns a parameter error.
- Whether retrieval or link reading actually happens is decided by the model based on the question.
- If the tool-choice policy is set to “none,” these capabilities are turned off as well.
This leads to an important product conclusion: a UI showing “web access enabled” only means the capability is available; it does not prove that this particular answer actually consulted external sources. The application should rely on signals such as returned tool events and cited sources, and should not slap on a “verified” label just because the answer sounds confident.
Thinking mode also affects behavior. Without thinking enabled, the model retrieves as needed and provides citations. With thinking enabled, the model may repeatedly search, open pages, and locate content across multiple reasoning steps. A multi-step flow creates opportunities for further verification, but it does not guarantee that every conclusion is automatically correct.
4. Reading Files: First Turn Files into Usable Material
File input does not end with “sending the file name to the model.” Documents, spreadsheets, presentations, and images need text extraction or layout parsing before they enter the conversation context. The engineering typically involves these layers:
raw file -> parsing/extraction -> structured fragments -> context assembly -> model inference
Key design points:
- Make parsing failures observable: log the failure reason, file type, and time spent per stage.
- Chunk long documents: split by heading hierarchy and semantic boundaries instead of hard truncation.
- Make citations traceable: keep page numbers, paragraphs, or coordinates so answers can include sources.
- Validate permissions up front: complete access control before parsing to avoid unauthorized reads.
5. Observability and Engineering Recommendations
Whichever path you choose, it is a good idea to make “whether an external action actually ran” an observable metric:
- Log tool-call events, return statuses, and latency.
- Log the number and types of cited sources.
- Sample-audit cases where the model gives a definitive conclusion without retrieving.
- Run a canary comparison between client-side and server-side hosting to evaluate stability and cost.
If you need to handle large volumes of file parsing and retrieval caching, you can combine general cloud capabilities, such as using object storage to keep raw files, message queues to smooth out spikes, and logging and monitoring with alerting to track failure rates, turning “who executes” into a verifiable, operable engineering fact.
