aiqbench analysis
This paper evaluates the reliability of Java LLM integration frameworks (Spring AI and LangChain4j) against a six-clause contract for handling provider failures, retries, and streaming integrity. By introducing a shared HTTP boundary layer, the authors demonstrate that consistent behavior across different clients can be achieved with negligible latency overhead, addressing critical robustness issues in production AI applications.
Consistent LLM Call Handling Across Java Frameworks: A Reference Implementation and Benchmark
arXiv:2610.25480v1 Announce Type: new Abstract: Java applications reach large language models (LLMs) through an integration framework, and rely on it to handle a failing provider: to retry what can be retried and nothing else, to wait as long as the provider asks, never to present a truncated answer as complete, and to record each failure in the application's metrics. We state these expectations as a six-clause reliability contract and measure Spring AI 2.0.1 and LangChain4j 1.21.0 against it with a scripted OpenAI-compatible provider: fifteen failure scenarios, synchronous and streaming, three repetitions. LangChain4j meets it in 47 of 77 applicable cases with its defaults and in 51 of 83 when configured explicitly, Spring AI in 72 of 77 and 76 of 83; both deliver a stream that ended without its terminator as a complete answer. We then place one implementation of the contract beneath both frameworks, at the HTTP boundary - an OkHttp interceptor for Spring AI, an HttpClient for LangChain4j, and a java.net.http transport for code without a framework - sharing a 725-line core that depends only on the JDK and the Micrometer Observation API. With it, all three clients behave identically and meet the contract in 90 of 91 cases; the remaining case is a policy trade-off between retrying a hung provider and waiting for a slow first token. Against a local model server the layer rejected none of 700 calls, and it adds a median of 32-217 microseconds to a call.
Abstract:Java applications reach large language models (LLMs) through an integration framework, and rely on it to handle a failing provider: to retry what can be retried and nothing else, to wait as long as the provider asks, never to present a truncated answer as complete, and to record each failure in the application's metrics. We state these expectations as a six-clause reliability contract and measure Spring AI 2.0.1 and LangChain4j 1.21.0 against it with a scripted OpenAI-compatible provider: fifteen failure scenarios, synchronous and streaming, three repetitions. LangChain4j meets it in 47 of 77 applicable cases with its defaults and in 51 of 83 when configured explicitly, Spring AI in 72 of 77 and 76 of 83; both deliver a stream that ended without its terminator as a complete answer. We then place one implementation of the contract beneath both frameworks, at the HTTP boundary - an OkHttp interceptor for Spring AI, an HttpClient for LangChain4j, and a this http URL transport for code without a framework - sharing a 725-line core that depends only on the JDK and the Micrometer Observation API. With it, all three clients behave identically and meet the contract in 90 of 91 cases; the remaining case is a policy trade-off between retrying a hung provider and waiting for a slow first token. Against a local model server the layer rejected none of 700 calls, and it adds a median of 32-217 microseconds to a call.
7 pages, 2 figures, 3 tables, 1 listing. Code and data: this https URL
Machine Learning (cs.LG)
arXiv:2610.25480 [cs.LG]
(or arXiv:2610.25480v1 [cs.LG] for this version)
https://doi.org/10.48550/arXiv.2610.25480 Focus to learn more arXiv-issued DOI via DataCite (pending registration)
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.
Full text under the publisher's open licence · 348 words
Related coverage
LangChoiceBench: Measuring and Explaining Programming-Language Choice in LLMs
arXiv · Aug 7, 2026
Equivariant Filter Transformations for Consistent and Efficient Visual--Inertial Navigation
arXiv · Sep 3, 2026
Beyond the Text: Verifying That Agent-Written Papers Are Backed by Their Artifacts
arXiv · Sep 22, 2026

Post-Quantum’s Algorithm Meets ISO Standard to Thwart HNDL Attacks
Quantum Zeitgeist · Jul 15, 2026