Hacker News new | ask | show | jobs
Show HN: RΞASON – Open-source TypeScript framework for LLM apps (github.com)
7 points by inaciom 921 days ago
Hi HN! RΞASON is an OSS Typescript framework for developing LLM apps that uses Typescript's interfaces to get structured output from an LLM.

While there are other TS LLM frameworks, I think RΞASON fills a unique space in the market: it's laser-focused on only three areas and, most importantly, actively stays away from pre-made prompting & retrieval.

I've been in the LLM space since GPT-3 originally came out, and I've always had problems with other frameworks, such as LangChain. I dislike that they focus a ton on out-of-the-box prompting & pre-made agents — I, as the dev, should be the one in charge of it.

My belief is that LLMs are a new primitive that programmers can use — not a new way to program; it's still up to the programmer to do the right thing & create the right abstractions. Therefore, it's the developer's job to learn the new concepts that come from this new primitive, such as prompting & retrieval. I see a similar analogy here with ORMs & SQL.

What RΞASON helps with is in areas that don't differentiate your app: getting structured outputs, handling streaming, and observability.

The goal of RΞASON is to make creating great LLM experiences easier. We try to accomplish this by simplifying the hard stuff & maximizing performance — decreasing as much as possible the TTUB.

RΞASON is OpenTelemetry compatible — which allows observability in almost any tool (Zipkin, Jaeger, paid solutions, etc.).

I'd really love to hear feedback about RΞASON! It has been a hobby project for the last months and I'm super curious to what y'all will think.

By the way, contributions welcome!

3 comments

Is the type returned guaranteed to be correct, or are you relying on non-hallucinations?

To be specific - to guarantee correctness you can reject logits for tokens that when used would produce an invalid JSON value returned from the LLM. For example if the string so far is

    { rating: 
If the suggested token is something like "3

Then you can reject, because the next character needs to be 0-9, and re-sample from the distribution.

Great question!

The return value is not guaranteed to be correct. REASON uses function calling to force the model to return a valid JSON object; however, sometimes models hallucinate.

For OpenAI models that have JSON mode, REASON uses that instead.

However, it has an internal validation step where it checks the return value, and if it's not correct, it'll throw an error (this behavior can be disabled though).

Here's more info about it: https://docs.tryreason.dev/docs/essentials/reason#will-the-l...

Your suggestion to use logits is super interesting, though! And it sparked this line of thinking: since REASON uses function calling, it has been somewhat difficult to integrate with OSS models — however, if under-the-hood we use Jsonformer, that might be the missing key for incredible OSS model support (?). What do you think?

I took a very quick glance at Jsonformer - it looks like the right tool here. If you are looking for a PR, I can help, but might take me a bit of time to get oriented.

I am considering using RΞASON for a side project so interested in it.

Awesome! That'd actually be great — just a warning that the repo is a complete mess right now.

If you need any help, feel free to contact me either on Github or in my email (inacio@hey.com).

I like how automated it seems to be working. Small issues, but this has a lot of potential!

  * demo video, but sound would help me follow along (unless my computer is failing)
  * Ξ bugs me a bit, but since that's not in the actual code I'm ok :)
Give me some ideas on what else it can help do
Thanks for the feedback! :)

Yeah, adding audio to the video would help — I'll try do record something later today and update it.

When building LLM apps a good chunk of the workflow is testing new stuff and seeing what works or not, and one of the most useful features of RΞASON to me is that its OpenTEL compatible. Which allows for things for you to inspect your LLM at a close level with ease (see: https://docs.tryreason.dev/docs/essentials/observability#usi...).

The website has a video demo in case you guys want to check it out: https://tryreason.dev
Looks like tryreason.dev is down now or is it just me?
To me https://tryreason.dev is working. Which browser are you on?
Firefox and chrome. I'm getting a timedout error.
That's weird. Can you access using this URL https://tryreason-www.vercel.app/ ?

EDIT: if that also doesn't work, there is the documentation — which is where 99% of the info is: https://docs.tryreason.dev/