Skip to main content
Luis de la Rosa

Week in Review: 2025-05-09

Continuing my weekly series where I share what I learned, what I did, and what I found interesting this week.


🧠 What I Learned #

Something I learned this week was that Vercel's AI SDK can produce structured outputs, but that I dug into the source code and found that how it is implemented depends upon the model. I think the best support is Open AI's latest, which uses json_schema. Claude and some others utilize tool calling to create the JSON and then just doesn't call the tool. Another caveat is that Zod schemas are converted into JSON schema, which may be lossy.

I think this is still an improvement so that you can make structured outputs without having to adopt different SDKs per model, but I think Vercel's AI SDK could be improved if it could carry the Zod schema through to the model.

Also it might be good to return back to the client what system prompt was used and other details about how the structured output was generated. This would help with debugging and understanding the model's behavior.

I think we are still relatively early on in the development of structured outputs. I expect Anthropic to put more work into this. Google looks like it supports structured outputs well.

I had some fun coding up examples and benchmarks of generating structured outputs with the AI SDK and utilizing a variety of models. (BTW how did they land the "ai" NPM package name?)

In general though, I think structured outputs are a critical technique to learn when utilizing LLMs. It makes the output more predictable by limiting it to a known schema. That can then be used to either extract the information about what the user wants, or to further make a call to a tool or API to get to the user's desired result.


💪 What I Did #

It's been a busy week with family. Four of my kids were in a play and they all did a great job. They got to perform on a big stage with an audience and they didn't look nervous at all. I really enjoyed them singing, dancing, narrating, projecting their voices and inhabiting their respective roles. I come from a family of drama folks, which somehow skipped me, but it was great to see my kids carry on the tradition!

One of my kids had a birthday, so we went out to eat as a family at Hard Times Cafe and then went to Whole Foods afterward for some ice cream to go along with cake.

BTW one interesting thing that Hard Times has is you can pay via QR code and Toast. It seems pretty futuristic - you don't need to tap, dip, or swipe. Just scan, choose tip and you're done.

Actually now that I think about it, I pay with QR code at Whole Foods too, but it is backwards - I bring up the QR code in the Amazon app and scan it via the Whole Foods register. Then you tap on Pay with Linked Card.


📚 Interesting Stuff #

I've been working on improving my memory by learning two more kpop groups: Ifeye, who just debuted, and NMIXX, whose music I didn't really get when I first started getting into kpop last year, but now their music just clicks in my brain. I realize now that they're this generation's f(x), whom I loved. Their song "High Horse" hits me in the feels just like f(x)'s "Airplane" did. Ifeye only has one song, but it's NERDY, so of course I had to watch it. It still makes me smile that when I was younger, being nerdy was worthy of scorn and now being nerdy is way more positive.

On the biohacking side, I've been taking a new supplement called "Naked Gut" (no relation to the movie with Leslie Nielsen). I was originally hesitant to take it because it is a blend and my thing recently is to be minimalist, drink single origin coffee, and take single ingredient supplements like creatine. But let's face it - our food environment in the USA isn't great. This adds not just the normal probiotics, but also prebiotic fibers, soluble fiber, and a few other gut-friendly ingredients. I definitely have felt much better since taking it. The only problem is that it is hard to mix into liquids, so recently I have been mixing it into some yogurt. Extra bonus is my allergies have improved, which I did not expect. I think the thing they say about gut health being linked to immune health has some truthiness to it.


Editor's Note: Only minimal AI help for this post. Prompt was: "please improve the formatting of this post, but do not delete any content." Something I realized I don't like is when AI rewrites my content. I feel like it loses my voice.


See you next week!