Using Pydantic with Qwen3 Coder Plus on OpenRouter
This tutorial explains how to use a Pydantic schema to extract structured data using Qwen3 Coder Plus. Please read this tutorial first to understand the basic setup Code: LLM Response: Metrics
This tutorial explains how to use a Pydantic schema to extract structured data using Qwen3 Coder Plus. Please read this tutorial first to understand the basic setup Code: LLM Response: Metrics
This tutorial explains how to use a Pydantic schema to extract structured data using Qwen3 Coder Flash. Please read this tutorial first to understand the basic setup Code: LLM Response: Metrics
This tutorial explains how to use a Pydantic schema to extract structured data using xAI Grok 4 Fast. The code uses the free model, but you can just change the model name to the paid one once it becomes available. Please read this tutorial first to understand the basic setup Code: LLM Response: Metrics
Cogito V2 Preview Llama 109B is less expensive than Deep Cogito Created Sep 2, 202532,767 context$0.18/M input tokens$0.59/M output tokens And in fact, it was able to provide schema compatible JSON for 84 out of the 99 test VAERS reports. One file did not return a response, and I had to stop the program after…
Deep Cogito V2 Preview Deepseek 671B is an interesting LLM simply because it is as expensive as GPT5-Full for input token pricing Created Sep 2, 2025163,840 context$1.25/M input tokens$1.25/M output tokens Current prices for GPT-5 Full: Created Aug 7, 2025400,000 context$1.25/M input tokens$10/M output tokens However, when I tried to get it to extract structured…
I have been calling the OpenRouter API directly from my code recently. Earlier my code used to look a bit like this And now they look more like this The second option makes a lot more sense for my use case – extracting structured outputs. Here are some reasons why The direct API call is…
We use Gemma 3N 4B model for the task of extracting the NUMDAYS field when both VAX_DATE and ONSET_DATE are specified, but the NUMDAYS field is empty in the VAERS CSV file. The code has some extra steps for caching previous results and validating schema and such, but you should be able to paste this…
You can add a “thinking budget” to make Google Gemini Flash 2.5 spend some time and resources thinking about the answer it provided. This usually provides a better answer than if you do not enable the thinking budget, and can be quite handy for tasks which do require some thinking. Python code for adding thinking…
This task will extract information about whether a VAERS death report was for someone who was in a nursing home or in some kind of senior care. died due to cardiac arrest; This is a spontaneous report received from a contactable physician via regulatory authority with Regulatory authority report number CH-SM-2021-10701. A 94-year-old female patient…
Sundar Pichai mentioned a few interesting things in a recent interview on the All In Podcast About a year back, Google Gemini was simply not very good when compared to ChatGPT. But the LLM competition has now intensified, and you can see that Gemini has improved tremendously when compared to a year back. And this…
Click here to learn about the system I used for this comparison Model Accuracy Comparison Model Accuracy Comparison Comparison gemini-2.0-flash gemini-2.5-flash-preview-05-20 Age 100 100 Onset Date 100 100 Vaccination Date 100 100 Number of Vaccine Doses 100 100 Vaccine Manufacturer 100 100 Vaccine Lot Number 100 100 Had COVID-19 100 100 Was Healthy 66 99…
Click here to learn about the system I used for this comparison Model Accuracy Comparison Model Accuracy Comparison Comparison gemini-2.0-flash-lite gemini-2.5-flash-preview-05-20 Age 100 100 Onset Date 98 100 Vaccination Date 100 100 Number of Vaccine Doses 100 100 Vaccine Manufacturer 100 100 Vaccine Lot Number 100 100 Had COVID-19 100 100 Was Healthy 90 99…