SShortSingh.
Back to feed

Deterministic Context Batching Cuts LLM Token Usage by 81.7% for OpenAPI Testing

0
·1 views

A developer built an agentic API testing prototype that reads OpenAPI specifications, generates test plans, executes them via a headless Dart runner, and reasons about failures. The core challenge was that large OpenAPI specs, often containing hundreds of endpoints and nested schemas, were too token-heavy to send repeatedly to a language model. To solve this, the developer created a deterministic Dart algorithm called OpenAPI Context Batching, which splits endpoints by root domain and recursively resolves only the schema references relevant to a given request. This approach reduced approximate token usage from around 50,000 to 9,200 tokens across a five-interaction workflow, an 81.7% reduction. The project was originally developed as part of a GSoC 2026 proposal for foss42, and though the developer was not selected, the working prototype was completed independently.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Overhauls Portfolio, Purges 16,000 Lines in Weekly Coding Sprint

A developer spent the week overhauling their personal portfolio's blog layout, merging a pull request focused on typographic hierarchy and removing decorative UI elements in favour of cleaner, server-rendered content. The changes touched over 200 files and introduced accessibility improvements such as keyboard-friendly focus rings. Separately, the developer deleted nearly 10,000 lines from their Obsidian note-taking vault, removing entire topic directories deemed outdated or incomplete. On the open-source front, they submitted a pull request to py-libp2p addressing flaky DHT routing-table tests by introducing a bounded polling mechanism. Across all four projects, the week's work totalled 36 commits, more than 23,000 line additions, and nearly 16,000 deletions.

0
ProgrammingDEV Community ·

Gubernator v2.13.0 Brings Google SRE SLOs, CoreDNS, and Caddy Ingress to Docker Compose

Gubernator, an open-source container orchestration tool, has released version 2.13.0 with three major feature suites integrated into a single binary. The update introduces a Google SRE-compliant multi-burn-rate SLO engine, enabling Docker Compose users to define Service Level Objectives and track error budgets without Kubernetes or costly SaaS platforms. A native CoreDNS management suite and a Caddy-based zero-trust reverse proxy ingress system are also included in the release. Users can manage SLOs dynamically through a Flutter Web dashboard or REST API, with support for composite user journeys and deployment correlation timelines. The entire codebase was reportedly built using Google DeepMind's agentic AI coding assistant, Google Antigravity.

0
ProgrammingDEV Community ·

Developer builds quiz-based gift recommender using Next.js and Cloudflare Pages

A developer has launched GiftHive, a quiz-driven gift recommendation tool that ranks Amazon products based on the recipient's personality rather than simple keyword matching. Users answer a 30-second quiz covering relationship, interests, occasion, and budget, receiving a ranked shortlist with explanations for each suggestion. The app is built with Next.js, Tailwind CSS, and deployed on Cloudflare Pages, with revenue generated through Amazon Associates affiliate links. A weighted scoring algorithm matches quiz answers to product tags without requiring any machine learning model. The project is live at gifthive.pages.dev, with planned features including A/B testing, non-US market support, and a saved recipient profile option.

0
ProgrammingDEV Community ·

Four Modern CSS Features That Can Replace Most Layout JavaScript

A developer has documented how four CSS features — container queries, :has(), subgrid, and cascade layers — can eliminate much of the JavaScript traditionally used for layout and conditional styling. Container queries allow components to adapt based on their container's width rather than the viewport, removing the need for ResizeObserver-based JavaScript workarounds. The :has() selector enables parent elements to be styled based on their children, replacing scripts that manually toggled classes on parent elements. Subgrid lets nested grids align to a parent grid's track lines, while cascade layers make style-override order explicit without relying on selector specificity. All four features are now supported across Chrome, Safari, and Firefox, though newer additions like CSS anchor positioning remain Chromium-only and should be used only as progressive enhancement.

Deterministic Context Batching Cuts LLM Token Usage by 81.7% for OpenAPI Testing · ShortSingh