LLM Web Search and File Reading: Who Executes the Workflow
This article examines the shift from letting a large language model answer directly to having it retrieve external material first, focusing on where the workflow is executed. It compares client-side orchestration with server-side hosting, explains how built-in web tools differ from custom functions in control granularity, and clarifies why declaring a tool does not guarantee a search actually happened. It also covers the file input pipeline, from parsing and chunking to citations, and closes with practical guidance on control, observability, failure semantics, cost, and security.
1. Background: From “Answering” to “Retrieve, Then Answer”
Letting a model answer directly and letting it fetch external material before answering are two tasks with very different engineering complexity. The first only requires sending a message and waiting for the generated result. The second requires connecting a retrieval service, fetching pages, extracting the main text, chunking and reranking, and stitching the material back into the context—and a failure at any step affects the final answer. In the past, almost all of this work was handled on the application side: the model only decided whether a lookup was needed, while the actual execution was carried out by a client-side loop.
A cloud vendor recently opened up a set of application-side API capabilities that move part of the work in search, link reading, and context assembly to the server side, where it is completed in coordination with the inference process. For developers, the significance is not the number of new endpoints but a change in the boundary of responsibilities: you still build the application, but you no longer have to implement every web action as a multi-turn client loop.
2. Two Paths: Client-Side Orchestration and Server-Side Hosting
Consider a typical scenario: a user sends a link to a product’s official website and asks which issues the latest update resolved. This example only illustrates the flow and does not represent any measured result.
2.1 Client-Side Orchestration
The application first detects the link in the message and issues a fetch request. It handles timeouts, download failures, and main-text extraction, then passes the cleaned material to the model. If the model decides the information is insufficient, the application must also call the retrieval endpoint, catch the results, and start another round. Here the model makes the decisions and the application makes the tools actually run; the developer maintains all the data movement between the two.
2.2 Server-Side Hosting
The client declares which capabilities are allowed in the request, and the server performs the execution and fills the material back in. Model judgment and tool execution are still two separate steps; the difference is that developers no longer need to pass intermediate results back and forth between them.
The official documentation usually distinguishes two types of entry points: use the server-side tools inside the conversation when you want the model to decide on its own when to go online; use the standalone retrieval and fetch endpoints when you want the application to fully control the query terms and receive the retrieval or fetch results directly. There is only one selection criterion—who holds control of the workflow.
3. Declaring a Tool Does Not Mean Mandatory Retrieval
Web capabilities must be explicitly declared in the request, for example one tool for search and one for reading links in the user message. If you only want to read a specified link, declare only the latter.
The key difference between these built-in tools and custom functions is the granularity of control: generally you cannot use the tool selection parameter to force one specific tool, or the request will be rejected (commonly with a 400); whether a search or link read actually happens is decided by the model; and if tool selection is set to “none,” these capabilities are turned off together.
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 material. Whether verification happened should be judged from the returned tool events and citation information, not from a confident tone in the answer that earns an “already verified” label.
Thinking mode also affects behavior. Without thinking enabled, the model retrieves on demand and provides citations. With it enabled, the model can search repeatedly, open pages, and locate content across multiple reasoning steps. A multi-step flow offers more chances to keep verifying, but it does not guarantee that every conclusion is automatically correct.
4. File Input: Turn It into Usable Material Before the Conversation
File capability does not end with “sending the file name to the model.” Documents, spreadsheets, presentations, and images must go through text extraction or layout parsing, identifying heading levels, paragraphs, table structures, and image positions, then be chunked into segments suitable for retrieval, and only then enter the conversation context.
Three engineering points are worth attention:
- Have a fallback strategy for parsing failures, for example reverting to plain text extraction with a confidence annotation;
- Long documents must be chunked and reranked so the context is not crowded out by irrelevant segments;
- Citations must resolve to a location in the original text so users can trace back.
Illustrative request structure (pseudocode, expressing field relationships only):
{"model": "<model identifier>","messages": [{"role": "user", "content": "Summarize the changes in this document"}],"tools": [{"type": "web_search"}, {"type": "read_url"}],"tool_choice": "auto"}
5. Practical Recommendations
- Choose by control: use the standalone endpoints when you need fixed query terms, bulk fetching, or strict auditing; leave the decision to the model when you want natural interaction.
- Build observability: log tool call events, latency, failure reasons, and citation sources to form a traceable chain.
- Define failure semantics: distinguish “no retrieval,” “retrieval returned no results,” and “retrieval succeeded but the material was insufficient,” and avoid using one fallback script for all of them.
- Control cost and latency: limit the number of tool calls per round, the material length, and the scale of concurrent fetching, and introduce caching when necessary.
- Security and compliance: protect against prompt injection in external content, and declare the fetching scope and data retention policy in advance.
6. Conclusion
The core tension in web access and file reading is how workflow control and engineering cost are allocated. Server-side hosting lowers the cost of moving data; client-side orchestration preserves fine-grained control. Only by understanding the relationship among tool declaration, thinking mode, and citation information can you tell whether an answer actually “looked it up” or merely “looked like it did.”
