Server-Side Tool Hosting for LLMs: Moving from Self-Built Pipelines to Declarative Integration
Server-side tool hosting lets large language models autonomously decide when to search, fetch, and parse content during inference, replacing hand-built retrieval pipelines. This article covers the key capabilities, protocol compatibility, and critical engineering pitfalls—including the requirement to pass intermediate blocks back unchanged, sampling parameter overrides, page-based billing, and current capability limits.
Why Server-Side Tool Hosting Is the Way Forward
Over the past two years, nearly every team building “internet-connected chat” has had to assemble its own pipeline: after a user asks a question, the application calls a search API, fetches web pages, extracts and cleans the text, chunks it, feeds it back into the model’s context, and finally generates a cited answer. The pipeline looks simple but involves plenty of tedious engineering—deduplicating and ranking search results, extracting main content from web pages, truncating oversized pages, and aligning citations with sources.
The pain points of this self-built approach are obvious:
- High maintenance cost: Search engine policy changes and shifts in page structure force frequent rework.
- Unpredictable latency: The client serially calls search, fetching, and the model, creating a long chain and high time-to-first-token.
- Split between inference and tools: The model cannot dynamically decide mid-reasoning whether to run another search round—that logic is hardcoded in external orchestration.
The idea behind server-side tool hosting is to push search, fetching, and parsing capabilities down into the inference service itself. The client only forwards the user’s question, and whether to search, how many rounds to run, and what to search for is decided autonomously by the model during inference. In essence, orchestration logic moves from application code into the model’s reasoning loop—a direction the industry is converging on as agents mature.
Capability Overview: One API Covering Multimodal Tools
The newly opened toolchain covers the core capabilities of typical chat applications, roughly in four categories:
- Web search: Web and image search, with on-demand retrieval in non-thinking mode and “search-while-reasoning” support when thinking mode is enabled.
- Content reading: Parsing links provided by users to fetch page content, and parsing uploaded documents (PDF, Word, PPT) and images—typically billed per page.
- Speech: Speech-to-text (dictation input) and text-to-speech (synthesized spoken output).
- Frontend interaction: The official chat frontend is open-sourced as well—download it, plug in your API key, and it runs, including the ability to import conversation history exported from the official site and continue chatting.
For developers, the value comes down to two things: first, integration cost drops dramatically—a few parameters can replace a pipeline that took weeks to build; second, behavioral consistency is guaranteed, because server-side tools and the model are co-optimized, delivering more stable results than a hand-assembled pipeline.
Protocol Compatibility and Integration
The API is designed with strong compatibility in mind. Three common chat protocols work out of the box: the Anthropic-style Messages protocol, the OpenAI-style Responses protocol, and the widely used Chat Completions protocol. This means migration cost for existing applications is low, with changes concentrated mainly in tool declarations.
In the Chat Completions style, declaring server-side tools looks roughly like this:
{"model": "your-model","messages": [{"role": "user", "content": "Compare the heights of two famous towers"}],"tools": [{"type": "web_search", "name": "deepseek_web_search"},{"type": "read_url", "name": "deepseek_read_url"}]}
Here the search tool handles web and image retrieval, while the read tool parses specific links attached to user messages. Tool execution is fully transparent to the client; the response returns the reasoning process, search calls, and fetched results as structured blocks.
The Most Critical Rule: Intermediate Blocks Must Be Passed Back Unchanged
The documentation emphasizes a rule that’s easy to overlook: the reasoning blocks, search result blocks, and web fetch result blocks returned by the server must be passed back unchanged in the next turn of the conversation.
The reason is architectural: tool calls happen on the server side, and the web content the model “saw” exists only inside these intermediate blocks. If the client—or an intermediate gateway or proxy layer you built—filters these blocks out, the request will still succeed, but the retrieved information is gone from the model’s context. The model effectively “forgets” what it just found, answer quality degrades noticeably, and the problem is very hard to debug because no error surfaces at the API level.
Practical recommendations:
- When your gateway forwards requests, preserve non-standard content block types instead of trimming fields against a whitelist.
- When persisting conversation history, serialize intermediate blocks along with everything else—don’t store only the final text answer.
- During integration testing, compare token counts across turns to confirm intermediate blocks are being carried correctly.
Parameter Override Pitfall: Sampling Settings May Be Ignored
Another limitation to know upfront: when features such as tool calling, automatic title generation, or high security mode are enabled, the server takes over the sampling schedule, and request-level parameters like temperature and top_p are ignored outright.
This matters for teams accustomed to fine-tuning. If your business depends on specific temperature settings to control output style—low temperature for strict structured extraction, high temperature for creative writing—you’ll need to reassess: either accept the server’s default sampling strategy, or disable the relevant features in scenarios that require precise sampling control. Run a comparison test before launch to confirm that output style with tools enabled still meets your expectations.
Billing and Cost Considerations
Multimodal parsing capabilities are typically billed per page, covering PDF, Word, PPT, and images. For cost control, keep in mind:
- Preprocess to save: For text-based (non-scanned) PDFs, consider extracting text on the client side to avoid the per-page parsing channel.
- Control page counts: Trim irrelevant pages before uploading—don’t pay for blank pages.
- Caching strategy: When the same document is referenced repeatedly across turns, cache parsed results locally to avoid resubmitting.
Capability Boundaries to Keep in Mind
Currently this server-side toolchain covers only the lightweight model tier; higher-spec flagship models are not yet supported. If your business demands deep reasoning, confirm whether your target model has full server-side tool capabilities before making architectural decisions. Also note that in deep search mode, the model may invoke tools up to roughly twenty times in a row, so end-to-end latency is significantly higher than ordinary chat—latency-sensitive scenarios need sensible timeout and fallback strategies.
Conclusion
Moving from “self-built tool pipelines” to “declarative integration of server-side tools” is a genuine simplification of how LLM applications are built. Developers should focus on three things: the context rule of passing intermediate blocks back unchanged, the behavioral change of sampling parameters being overridden, and cost design under per-page billing. Bake these three into your architecture, and you can get stable, reliable web-connected and multimodal conversational capabilities at minimal integration cost.
