Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does OpenFunction fit into the context of the OG Gorilla paper? #388

Open
sreenivasmrpivot opened this issue Apr 26, 2024 · 2 comments

Comments

@sreenivasmrpivot
Copy link

The OG Gorilla paper talks about multiple steps listed below.

  1. API Collection
  2. Hand-generate Instruction-API pairs
  3. Choose Instruction-API pairs
  4. Generate Instruction-API pairs corpus
  5. Convert Instruction-API pairs to user-agent chat style conversations
  6. Instruction Fine-tune LLaMA 2

How does OpenFunctions V2 fit in the above context?

How can we fine tune the Gorilla Model for our custom API? Is this (https://gorilla.cs.berkeley.edu/blogs/5_how_to_gorilla.html) the way to train?

@ShishirPatil
Copy link
Owner

Hey @sreenivasmrpivot, thanks for your interest.

The OG Gorilla paper looked at how do you train (fine-tine) an LLM that can retrieve the right API with the right arguments. This can be used in 0-shot (ChatGPT Style) and with retriever setting!

Now Openfunctions series of models are models that we train and you don't need to train any further. Here, the input is basically a prompt and a set of functions, the output from the LLM is a properly formatted json of the right arguments filled in.

Hope this helps. Another way to understand this is to look at the two colab examples:
Gorilla demo: https://colab.research.google.com/drive/1DEBPsccVLF_aUnmD0FwPeHFrtdC0QIUP?usp=sharing
OpenFunctions demo: https://gorilla.cs.berkeley.edu/leaderboard.html#api-explorer

@sreenivasmrpivot
Copy link
Author

@ShishirPatil Thanks for your kind response. This really helps in our journey of adopting Gorilla at work.

I have a followup query to you and would like to get your expert advice on it.

Scenario:
We have a lot of internal enterprise REST APIs which we expect to integrate with Gorilla style LLM (either classic OG Gorilla implementation or Open Functions).

So based on your above response, what is the best path for this scenario? OpenFunctions or OG Gorilla with Retriever setting or RAFT?

If we opt to go with OpenFunctions, is my understanding with required steps correct?

  1. Add all your enterprise REST APIs to the apizoo folder in the required format (is this step required for using OpenFunctions or should we just be injecting all possible functions in the invocation each time?)
  2. Then you may run the one of the inference modes here from repo(gorilla/openfunctions), based on your hosting

If we opt to go with RAFT, is my understanding with required steps correct?

  1. Add all your enterprise REST APIs to the apizoo folder in the required format
  2. Then you may run the RAFT as per instruction here from repo (gorilla/raft/README.md)
  3. This fine-tunes the OpenFunctions based model and helps it to perform better for a specific domain as per (https://gorilla.cs.berkeley.edu/blogs/9_raft.html)

Given the above options, can we safely say that the OG Gorilla paper instructions can be ignored by any average users of Gorilla repo for the above mentioned scenarios?

If my understanding above is correct, then how does anyone adopt or train a new Gorilla LLM based on some new OpenSource model such as Llama 3 or Mixtral etc? Is there a training procedure doc or .py script for that available in the github repo?

I sincerely appreciate your efforts and time here. Clarifying my above queries would help a lot more new users of Gorilla and increase adoption in-turn.

Thanks a lot in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants