Show HN: Structured Outputs with Deepseek R1

This is our interactive playground that uses our framework (BAML https://github.com/BoundaryML/baml) to do structured outputs with R1, without the use of tool-calling APIs or fine-tuning required.

We have a more fleshed out playground at https://promptfiddle.com as well.

BAML is a DSL for prompts, where prompts are modeled as functions. Our compiler transforms your LLM function declaration into the relevant API call, and will also parse the output for you.

We serialize using "type definitions" instead of using json schemas, since they are more efficient and easier to understand for models. We talk more about why here: https://www.boundaryml.com/blog/type-definition-prompting-ba...

We ran the Berkeley Function Calling Benchmark some months ago on our approach and achieved really good results https://www.boundaryml.com/blog/sota-function-calling?q=0

boundaryml.com

7 points

aaronvg

2 days ago


2 comments

huevosabio a day ago

Is there a reason for why you wouldn't use something like Outlines or Xgrammar to force a grammar on the output?

  • aaronvg a day ago

    Sometimes you don't have access to a model, so this approach still works in that scenario.

    We also have several users that have anecdotally told us they get worse results using constrained grammar solutions.