Server-Side Tool Integration for LLMs: A Practical Guide

    This guide explains how LLM tools are moving from client-side pipelines to server-side hosting, covering how server-side tools work, integration protocols, mandatory context-passing constraints, sampling behavior, document and image parsing trade-offs, and voice capabilities. It is intended for developers and engineering teams who want to configure tool availability, control costs, and build reliable LLM applications.

    1. The Shift: From Client-Side Pipelines to Server-Side Tool Hosting

    Until recently, giving an LLM “internet access” meant building an entire retrieval pipeline on the client. Developers had to call a search API for candidate links, fetch the pages, extract the main text and remove noise, truncate and assemble the context, and then handle citations and state consistency across multi-turn conversations. Very little of this work was related to the model’s actual capabilities; most of it was engineering grunt work, and it was easy to get stuck on anti-scraping, encoding, timeouts, and poor text-extraction quality.

    The recent industry change is that this kind of tooling has moved down to the model server. Web search, reading a specified link, document and image parsing, and voice transcription and playback are now exposed as “server-side tools.” The client only declares which tools are available in the request; the model then decides how many search rounds to run, which pages to fetch, and when to stop. Meanwhile, some vendors have also open-sourced the accompanying chat front end: users download an archive, run a static page locally, enter their own key, and can even import a chat-history archive exported from the official site to continue a conversation.

    One boundary needs to be stated up front: these capabilities are often rolled out first on lightweight or specific model versions, and flagship versions do not necessarily follow at the same time. So when making engineering choices, do not assume that “the newest and strongest model must support tools.” Instead, make tool availability a configurable item.

    2. How Server-Side Tools Work

    The core value of server-side tools is handing decision-making to the model. The client only describes the task, and the model decides whether retrieval is needed, how many rounds to run, whether reverse image search is needed, and whether to open a link the user provided.

    A typical combination is two types of tools:

    • Retrieval tools: search the web and search images, returning results with source citations;
    • Link-reading tools: fetch a URL pasted by the user and extract the main text.

    With thinking mode off, the model retrieves on demand once or multiple times and answers with citations. With thinking mode on, retrieval is interleaved with reasoning, forming a deep-search pattern of “reasoning while looking things up.” The official documentation often uses the example of comparing the heights of two towers: the model first does a broad search, then opens each official page to find the specific numbers; if the numbers are incomplete, it switches keywords and searches again within the page, calling tools up to about twenty times in a row before converging on an answer.

    An illustrative request structure (pseudocode, showing field relationships only):

    1. {
    2. "model": "<your-model-name>",
    3. "messages": [{"role": "user", "content": "Compare the officially published heights of two towers"}],
    4. "tools": ["web_search", "read_url"],
    5. "thinking": {"type": "enabled"}
    6. }

    3. Integration Methods and the Context-Passing Constraint You Must Follow

    On compatibility, the three common protocols in the industry can usually be used directly: the messages protocol, the responses protocol, and the chat completions protocol. This means most existing SDKs and gateways can integrate without major changes.

    But there is one hard constraint that is easy to overlook: the thinking blocks, search-result blocks, and page-fetch-result blocks returned by the server must be passed back unchanged in the next request. Many teams “slim down” the payload in a middle layer and filter these blocks out to save tokens. The result is that the request still succeeds, but the model acts as if it has amnesia and forgets all the web content it just saw—it “searched but cannot answer.” The correct approach is to treat these blocks as immutable historical state: pass them through and persist them, but do not trim them.

    Another constraint to communicate to business stakeholders in advance: once tool calling, automatic title generation, or a high security level is enabled, the server takes over the sampling schedule, and explicitly set sampling parameters such as temperature and top_p in the request are ignored. In other words, “tuning parameters to change the model’s style” does not work here; style control needs to move forward to the prompt and post-processing layers.

    4. Document and Image Parsing: Trade-offs Between Quality and Cost

    Objects billed per page typically include PDFs, documents, presentations, and images, with two modes: plain text extraction and layout-aware parsing.

    Take a financial report as an example. Plain text mode drops the revenue trend chart; the model cannot see the chart and therefore cannot answer “what does the trend in the chart look like.” If chart information is needed, you must choose layout recognition mode, where the system crops out the chart and inserts it back at its original position in the text. The cost is that the cropped images are billed as image input tokens, and chart detection is automatic, so if a crop is missed, the model still cannot see it. A practical engineering compromise is to route by question type: plain text Q&A uses the low-cost mode, and chart-related questions are upgraded; at the same time, manually spot-check key pages and build a fallback for missed crops.

    5. Voice and Engineering Recommendations

    Voice transcription and playback are also provided as server-side tools, suitable for chaining “meeting notes → summary → playback” into a single pipeline. For implementation, focus on four points: first, make capability switches configurable and roll them out gradually by model version; second, persist history blocks and pass back the full set; third, control costs, since document parsing is billed both per page and per image, so budget guardrails are needed; fourth, ensure observability by including tool-call rounds, fetch failure rate, and missed-crop rate in logs, monitoring, and alerts. Using object storage to archive original files, a message queue to smooth traffic spikes, and a container platform to host a self-built front end can significantly improve stability. Baidu AI Cloud offers a relatively complete combination of these general capabilities, making it easier for teams to focus on business logic rather than infrastructure.