How to reduce the token, when my tools(functions) list is huge?

Hey guys,

I m now working on a project that using OpenAI tool(function call) feature and My tool(function) list keep growing to a huge list, which lead to repeated huge token usage per api invoke.

Let say my tool(function) list is stable and fixed in a long period of time, Can I fine-tuning a model with function-calling samples (large dataset with every tool(function) in my list), then After that, Can I invoke the fine-tuned model without providing the tool(function) list ?

My use of functions is limited so far (working on other projects), but I don’t think fine-tuning would work?

You need to try to narrow down the functions. Can any be combined? Are all absolutely necessary?

Can you get it working on a cheaper 3.5 model?

I have try other way, that is to embedding all my tool(function), one vector per tool(function),then use RAG way to dynamic retrieve relevant tool(function) to compose the tools para, but actually not working quite well. So I m looking for some ways by using fine-tuning.

I usually create one function that has two parameters. One is the function that I want to call, and the other is the object that I want to pass to that function as arguments.

The function to call is usually enum.

This works fine if you don’t want to run multiple functions in one call.

If using this way, how do you let the LLM know all of your supported functions, write them as part of the prompt ?

Yes, as a part of the prompt.