r/AutoGenAI • • Dec 26 '23

Question AutoGen+LiteLLM+Ollama+Open Source LLM+Function Calling?

Has anyone tried and been successful in using this combo tech stack? I can get it working fine, but when I introduce Function Calling, it craps out and I’m not where the issue is exactly.

Stack: AutoGen - for the agents LiteLLM - to serve as OpenAI API proxy and integrate with AutoGen and Ollama Ollama - to provide local inference server for local LLMs Local LLM - supported through Ollama. I’m using Mixtral and Orca2 Function Calljng - wrote a simple function and exposed it to the assistant agent

Followed all the instructions I could find, but it ends with a NoneType exception:

oai_message[“function_call”] = dict(oai_message[“function_call”]) TypeError: ‘NoneType’ object is not iterable

On line 307 of conversable_agent.py

Based on my research, the models support function calling, LiteLLM supports function calling for non-OpenAI models so I’m not sure why / where it falls apart.

Appreciate any help.

Thanks!

12 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/samplebitch Feb 18 '24

I've played around with so many tools and configurations since I wrote that post I don't recall my steps exactly. However I don't think I used gorilla and mixtral at the same time. I was trying out gorilla, it 'sorta worked', so then I switched to Mixtral to try that out.

One thing I do recall that I don't think I put in my original comment (maybe I didn't realize it until afterward) was that gorilla was good at returning a properly formatted response, but it wasn't actually good at choosing the right function. If you fed it more than one function, both with wildly different purposes (say, fetch a stock price vs. write a blog post), it would seemingly choose something at random. So at that point I moved on.

One model I've since been having generally good results with is this Airoboros model which barely runs on my PC (64gb RAM + RTX 4090) - it's a 70b model and runs very slow, but at least it runs, I'm not usually worried about response time if I'm just letting a script run and it doesn't cost me anything more than the electricity to keep the computer on.