SShortSingh.
Back to feed

Spring AI 2.0 Offers 10 Controls to Cut LLM Token Costs for Developers

0
·1 views

Spring AI 2.0, which reached general availability on 12 June 2026, introduces a range of controls aimed at reducing the token costs developers incur when running large language model features. A DEV Community article highlights how default settings can silently inflate bills — for example, a 2,000-token system prompt called 100,000 times a month generates 200 million input tokens before any user interaction. The piece identifies ten cost drivers, numbered #0 to #9, spanning areas such as conversation history resending, RAG document retrieval, tool schema inclusion, and output length limits. Part 1 of the series is already live and focuses on measuring per-feature token usage, matching models to tasks, and leveraging provider-level prompt caching. Parts 2 through 4, covering retrieval optimization, tool schema management, and embedding strategies, are scheduled for release in August 2026.

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 ·

Supply Chain Attacks: How Hackers Compromise Code Before It Reaches You

Supply chain attacks target the building blocks of software — libraries, container images, and firmware — rather than end products directly, allowing attackers to execute malicious code across millions of projects at once. A notable example involved a compromised npm package that silently exfiltrated Bitcoin wallet data from countless dependent projects after a single malicious pull request. Attackers exploit three main vectors: package repository manipulation on platforms like npm and PyPI, tampering with official container base images, and injecting malware through unsecured firmware update mechanisms. A 2023 incident involving the widely used Docker Hub image node:14-alpine saw a reverse shell script embedded that connected compromised containers to an attacker-controlled server within hours of deployment. Security experts warn that protecting only one's own codebase is no longer sufficient, as every third-party dependency and automated CI/CD pipeline integration expands the potential attack surface exponentially.

0
ProgrammingDEV Community ·

Three MCP Servers That Extend Claude Desktop With Files, GitHub, and Postgres

A developer has shared three Model Context Protocol (MCP) servers they actively use with Claude Desktop to enhance productivity. The filesystem server allows Claude to read project files directly, eliminating the need to manually copy-paste code into the chat. The GitHub server enables Claude to review pull requests, check issues, and browse repositories within the same conversation. A PostgreSQL server grants Claude direct database query access, letting users retrieve data without switching tools. Each server can be installed via the mcp-hub CLI in roughly two minutes, though users are cautioned to restrict filesystem paths carefully to avoid exposing their entire disk.

0
ProgrammingDEV Community ·

Bun Outperforms Node.js on High-Throughput SQLite JSON API in Real-World Test

ViralVidVault, a European viral video tracking platform, ran a week-long benchmark comparing Bun and Node.js on a batch video metadata API that processes up to 200 video IDs per request. The existing Node.js service had a p99 latency of 40ms, with profiling revealing that only 2ms was spent on SQLite reads while the remaining 38ms came from JSON serialization, HTTP framing, and garbage-collection pauses. The test used a single POST endpoint querying a 350,000-row SQLite database in WAL mode, deliberately stripped of framework overhead to isolate runtime and SQLite driver performance. Node.js relied on the better-sqlite3 driver, while Bun used its built-in bun:sqlite module, eliminating native compilation dependencies entirely. The benchmark aimed to provide measured, infrastructure-based data rather than relying on vendor launch-day performance claims.

0
ProgrammingDEV Community ·

Developer builds self-hosted MCP mail server giving each AI agent its own inbox

A developer has built openagent.email, an open-source self-hosted mail server designed to give AI agents dedicated email identities without routing sensitive messages through third-party servers. The system runs on two Docker containers — a Postfix/Dovecot catch-all mailbox and a Node/Hono API — with an MCP layer allowing compatibility with AI clients like Claude Code, Cursor, and Windsurf. Rather than provisioning a separate mailbox per agent, the architecture uses a single catch-all inbox where logical identities are filtered by exact recipient-header matching, preventing one agent from accessing another's mail. The design deliberately avoids substring matching, untrusted sender-supplied dates, and display-name spoofing to close common security gaps in multi-tenant email handling. The full stack consumes around 190 MB of RAM in production and is backed by 268 automated tests.

Spring AI 2.0 Offers 10 Controls to Cut LLM Token Costs for Developers · ShortSingh