-11

Today I found the weirdest bug in my life. I was making a chatbot for Signal using Ollama in Rust. I finished a basic demo and tried it. For any message I would get { }, {}, {} or { } .

Do you know how hard is to debug something like this???

What was the problem? Not my program. Ollama bug combined with ollama-rs bug (rust library for ollama). And both bugs are not even bugs if you don't combine them.

Ollama released a new feature yesterday called "Structured outputs". Basically you can specify a format of the output using format field in json request. Format field already existes for something but I don't know for what. In ollama-rs you can specify the format to json or leave it empty. By default its empty. Where is the bug?

There is a difference betwen "format": null and not specifying the format at all. Ollama-rs will set format to null if you dont specify it. Ollama will interpret null as a valid format. What happens? LLM WILL ACTUALLY GIVE YOU FORMAT OF OUTPUT AS NULL - { }!

you are viewing a single comment's thread
view the rest of the comments
[-] HeckGazer@programming.dev 11 points 3 weeks ago

And both bugs are not even bugs if you don't combine them.

There is a difference betwen "format": null and not specifying the format at all.

Hmmmmm, that sure does sound like a bug

this post was submitted on 07 Dec 2024
-11 points (34.3% liked)

Programming

17701 readers
113 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS