Articles
AI articles
Free, practical articles on Java, Spring, SQL and AI for backend developers.
-
AI code editing: show a diff, let the user apply it
Let an LLM edit code safely: choose an edit format, validate the proposal, show a diff, apply it on click and reject stale changes. With a tested example.
-
Track LLM token usage and cost per user in your app
Track LLM token usage and cost per user: one event row per model call, a dated price table, budgets checked before the call, and three SQL queries.
-
Spring AI structured output: call an LLM from Java
Get a typed Java record from an LLM with Spring AI ChatClient and .entity(). The schema it sends, native mode, failure cases and tests on Spring AI 2.1.