ANN: fun: call your LLMs like they are just a function

239 views
Skip to first unread message

Mitar

unread,
Aug 4, 2024, 4:52:29 AM8/4/24
to golang-nuts
Hi!

I made a small library which allows using AI models like they were
just a Go function, but that Go function can be:

- defined with natural language description
- example inputs with expected outputs
- or both

Internally, it then calls into an LLM to get the answer. So it is not
fast, but it is an interesting new way to define your functions. Check
it out, any feedback welcome:

https://gitlab.com/tozd/go/fun

Caveat: Current LLMs available still randomly return trash for some
inputs, even if they work great for very similar other inputs. But
hopefully that will improve through time. And there are some ways to
check for this (using JSON Schema to validate outputs, comparing
outputs of multiple models, etc.).


Mitar

--
https://mitar.tnode.com/
https://twitter.com/mitar_m
https://noc.social/@mitar

Michael Oguidan

unread,
Aug 4, 2024, 8:33:27 AM8/4/24
to golang-nuts
Thank you @Mitar for sharing this knowledge with us.

Mitar

unread,
Aug 19, 2024, 6:49:00 AM8/19/24
to golang-nuts
Hi!

I released a new version which now also allows tool calling into Go
code. So you can now both call LLM models and they can call back into
Go. Magic. It really shows how powerful Go is without all the "async"
mess from other languages, and useful context.Context.


Mitar
Reply all
Reply to author
Forward
0 new messages