标签:#r
找到 22304 篇相关文章
Stop Begging Your LLM for Valid JSON: Self-Correcting Structured Output in Spring AI 2.0
Every developer who has worked with LLMs has been there. You ask the model for JSON. You describe the schema. You say "please only respond with valid JSON." And sometimes, it still breaks. Your application crashes because the model returned a string where you expected an integer. Or it wrapped the JSON in markdown code blocks. Or it omitted a required field. Spring AI 2.0 has a solution that treats this like a real engineering problem instead of a prayer. The Problem When you use structured output in Spring AI, the workflow goes like this: You define a Java type (a record, class, or enum) Spring AI generates a JSON schema from that type The schema gets appended to the prompt sent to the LLM The model returns a response Spring AI attempts to deserialize the response into your type This works well with frontier models like Claude and GPT-4. But smaller open-source models, like Llama 3.2 1B running locally via Ollama, fail more often. They might return null for a primitive field, omit required fields, or produce malformed JSON. When it fails, you get a deserialization exception. Your endpoint returns a 500 error. Spring AI provides no built-in recovery mechanism. The Old Approach: Hope Consider a conference talk submission system. Speakers submit messy, unstructured abstracts. You want to extract structured data: public record TalkSubmission ( String title , String abstractText , Level level , // BEGINNER, INTERMEDIATE, ADVANCED Track track , int duration , List < String > tags , String speakerHandle ) {} Here is what the basic typed response looks like: @PostMapping ( "/typed" ) public TalkSubmission typed ( @RequestBody String rawSubmission ) { return chatClient . prompt () . system ( systemPrompt ) . user ( spec -> spec . text ( "Extract the talk submission: {submission}" ) . param ( "submission" , rawSubmission )) . call () . entity ( TalkSubmission . class ); } You define your type. Spring AI generates the schema and appends it to the prompt. The model gets the in
The Economics of Self-Hosting vs. Managed Monitoring
The "Obvious" Math That's Wrong Engineer A: "Datadog is $15K/month. Prometheus is free. We should self-host." Engineer B: "But we'd need to pay an SRE to run it. That's $150K/year." Engineer A: "Prometheus doesn't need a full SRE. It's easy." Engineer B: "Famous last words." This conversation happens at every company. Both sides have points. The real math is more complex. The Total Cost Breakdown Managed (Datadog, New Relic, Dynatrace) : Licensing: $X/month (scales with hosts, events, logs) Integration time: 1-2 weeks per service Training: 1 day per new hire Ongoing: minimal Self-hosted (Prometheus + Grafana + Loki + Alertmanager) : Infrastructure: hosting costs (~$500-$5000/month depending on scale) Initial setup: 2-4 weeks of engineering time Ongoing maintenance: 10-20% of 1 FTE Upgrade costs: quarterly, each upgrade ~1 week Storage growth: ~20% per year Expertise: junior → senior SRE hire required The honest answer: managed is cheaper for teams under 50 engineers. Self-hosted becomes cheaper around 200+ engineers if you can run it well . The Real Variables It's not just licensing cost vs. hosting cost. These factors matter more: 1. Data volume growth Managed tools charge per GB ingested or per metric. If your logs 10x, your bill 10x's. Self-hosted scales linearly with compute. You control the growth. 2. Retention requirements Managed tools often charge extra for long retention. Self-hosted you store as much as your disk allows. 3. Cardinality Prometheus dies at high cardinality. Datadog handles it but charges more. High-cardinality metrics are where self-hosted breaks. 4. Incident rate Heavy incident load means heavy query load on your monitoring tools. Self-hosted needs bigger compute for this. 5. Team expertise If your team has never run Prometheus, you'll spend 6 months in the pit learning cardinality mistakes, retention tuning, and HA setups. That's not free. The Break-Even Calculation Rough calculation for a 50-engineer startup: Managed (Datadog) : - Licensi
Credit Card Points Are a Transfer from the Broke to the Comfortable
Why X Is Not Our Ideal Window System
A Functional Taxonomy of World Models by Fei-Fei Li
Claude Code(Fable) refused my slow down instruction
The Birth of Prolog (1996)
The Isomorphic Labs Drug Design Engine unlocks a new frontier beyond AlphaFold
The Largest Vocabulary in Hip Hop (2017)
Show HN: Qwen3.6-35B-A3B on a 16 GB M1 Pro with SSD-streamed MoE
NASA Taps SpaceX's Starlink to Deliver Artemis III Imagery from Orion
LG monitors installing adware on Windows PCs
Applications close in 48 hours — here’s everything Australian founders need to know about Stripe x Startup Battlefield
The window is almost shut. On August 19, eight startups will take the stage at Stripe Tour Sydney in front of investors, global press, and the Australian tech community. One startup walks away with automatic entry into TechCrunch Disrupt in San Francisco — no application, no further competition, a guaranteed spot on the world’s most […]
Sensing warm and cool: how the body detects temperature changes
Vertu wants executives to pay $6,880 for an AI agent — here’s how it actually performs
From AI workflows to battery life and security, here's what it's really like to live with Vertu's luxury foldable every day.
What surprised an engineer after spending 13 years on SQL Server and then working on Postgres? on the Talking Postgres podcast
I host a Postgres podcast, and I recently recorded a conversation with Panos Antonopoulos, a Distinguished Engineer at Microsoft who spent 13 years working on SQL Server before moving onto Postgres and HorizonDB. Panos told me that at a high level, Postgres felt very familiar as he started to work on it, that the concepts are very similar. Transactions, storage, & more—the fundamentals transfer surprisingly well. We also covered: The cleanliness of the Postgres codebase. How LLMs are making it easier to digest years of Postgres design discussions that are publicly available on the mailing lists. Why Postgres has become the default answer for so many workloads, and why more people seem to be asking, "Why not Postgres?" Shared-storage architectures and some of the work he's doing in Azure HorizonDB. One quote that stuck with me: "That was a shocking experience for me. I could understand new areas in Postgres much faster than I could for SQL." For people who have worked across multiple database systems (Oracle, SQL Server, MySQL, Postgres, etc.), I'm curious whether you've had a similar experience—or a completely different one. Podcast/transcript here if anyone is interested: https://talkingpostgres.com/episodes/working-on-postgres-after-13-years-on-sql-server-with-panagiotis-antonopoulos submitted by /u/clairegiordano [link] [留言]
Texas wins court order to suspend domain name for violating age-verification law
Kaiser nurses say AI, workplace surveillance are making their jobs, care worse
Databricks hits $188B valuation, extending its run as AI’s favorite second act
Databricks has remade its image into an AI company and has published research on the cost savings of open weight AI models for coding.