Giter Site home page Giter Site logo

dumpmemory / gorilla Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shishirpatil/gorilla

0.0 1.0 0.0 75.96 MB

Gorilla: An API store for LLMs

Home Page: https://gorilla.cs.berkeley.edu/

License: Apache License 2.0

Shell 0.98% JavaScript 6.19% C++ 0.23% Scheme 0.57% Python 91.12% Rust 0.91%

gorilla's Introduction

Gorilla: Large Language Model Connected with Massive APIs [Project Website]

๐ŸŽ‰ Berkeley Function Calling Leaderboard How do models stack up for function calling? ๐ŸŽฏ Releasing the Berkeley Function Calling Leaderboard. Read more in our Release Blog.

๐Ÿ† Gorilla OpenFunctions v2 Sets new SoTA for open-source LLMs ๐Ÿ’ช On-par with GPT-4 ๐Ÿ™Œ Supports more languages ๐Ÿ‘Œ Blog.

๐Ÿ”ฅ Gorilla OpenFunctions is a drop-in alternative for function calling! Release Blog

๐ŸŸข Gorilla is Apache 2.0 With Gorilla being fine-tuned on MPT, and Falcon, you can use Gorilla commercially with no obligations! โ›ณ

๐Ÿš€ Try Gorilla in 60s Colab

๐Ÿ’ป Use Gorilla in your CLI with pip install gorilla-cli

๐Ÿ“  Checkout our blogs for all things tools-use/function-calling!

๐Ÿ—ž๏ธ Checkout our paper! arXiv

๐Ÿ‘‹ Join our Discord! Discord

Gorilla enables LLMs to use tools by invoking APIs. Given a natural language query, Gorilla comes up with the semantically- and syntactically- correct API to invoke. With Gorilla, we are the first to demonstrate how to use LLMs to invoke 1,600+ (and growing) API calls accurately while reducing hallucination. We also release APIBench, the largest collection of APIs, curated and easy to be trained on! Join us, as we try to expand the largest API store and teach LLMs how to write them! Hop on our Discord, or open a PR, or email us if you would like to have your API incorporated as well.

News

  • ๐Ÿ† [02/26] Berkeley Function Calling Leaderboard is live!
  • ๐ŸŽฏ [02/25] OpenFunctions v2 sets new SoTA for open-source LLMs!
  • ๐Ÿ”ฅ [11/16] Excited to release Gorilla OpenFunctions
  • ๐Ÿ’ป [06/29] Released gorilla-cli, LLMs for your CLI!
  • ๐ŸŸข [06/06] Released Commercially usable, Apache 2.0 licensed Gorilla models
  • ๐Ÿš€ [05/30] Provided the CLI interface to chat with Gorilla!
  • ๐Ÿš€ [05/28] Released Torch Hub and TensorFlow Hub Models!
  • ๐Ÿš€ [05/27] Released the first Gorilla model! Colab or ๐Ÿค—!
  • ๐Ÿ”ฅ [05/27] We released the APIZoo contribution guide for community API contributions!
  • ๐Ÿ”ฅ [05/25] We release the APIBench dataset and the evaluation code of Gorilla!

Gorilla Gradio

Try Gorilla LLM models in HF Spaces or Gradio Colab gorilla_webUI_2

Get Started

Inference: Run Gorilla locally inference/README.md

Evaluation: We have included prompts and responses for the APIBench with and without retrievers along with the Abstract Syntax Tree (AST) matching evaluation script at evaluation.

Repository Organization

Our repository organization is shown below.

  • The berkeley-function-call-leaderboard folder contains scripts for evaluating function-calling ability of models.
  • The data folder contains all the evaluation APIs (APIBench) and the community contributed APIs.
  • The eval folder contains all our evaluation code as well as the Gorilla outputs.
  • The inference folder contains all the inference code for running Gorilla locally.
  • The openfunctions folder contains the inference code for the OpenFunctions model(s).

For our dataset collections, all the 1640 API documentation is in data/api. We also include the APIBench dataset created by self-instruct in data/apibench. For evaluation, we convert this into a LLM-friendly chat format, and the questions are in eval/eval-data/questions, and the corresponding responses are in eval/eval-data/responses. We have also included the evaluation scripts are in eval/eval-scripts. This would be entirely sufficient to train Gorilla yourself, and reproduce our results. Please see evaluation for the details on how to use our evaluation pipeline.

Additionally, we have released all the model weights. gorilla-7b-hf-v0 lets you invoke over 925 Hugging Face APIs. Similarly, gorilla-7b-tf-v0 and gorilla-7b-th-v0 have 626 (exhaustive) Tensorflow v2, and 94 (exhaustive) Torch Hub APIs. gorilla-mpt-7b-hf-v0 and gorilla-falcon-7b-hf-v0 are Apache 2.0 licensed models (commercially usable) fine-tuned on MPT-7B and Falcon-7B respectively. We will release a model with all three combined with generic chat capability and community contributed APIs as soon as we can scale our serving infrastructure. You can run Gorilla locally from instructions in the inference/ sub-directory, or we also provide a hosted Gorilla chat completion API (see Colab)! If you have any suggestions, or if you run into any issues please feel free to reach out to us either through Discord or email or raise a Github issue.

gorilla
|-- berkeley-function-call-leaderboard (data and scripts to eval model's function-calling ability)
โ”œโ”€โ”€ data
โ”‚   โ”œโ”€โ”€ api (TF/HF/TH APIs used in generating apibench)
โ”‚   โ”‚   โ”œโ”€โ”€ {api_name}_api.jsonl
โ”‚   โ”œโ”€โ”€ apibench (Evaluating LLM models) v-1.0
โ”‚   โ”‚   โ”œโ”€โ”€ {api_name}_train.jsonl, {api_name}_eval.jsonl
|   |โ”€โ”€ apizoo (Contributed by the community - evolving)
โ”‚   |   โ”œโ”€โ”€ username1.json
โ”‚   โ”‚   โ”œโ”€โ”€ username2.json
โ”‚   โ”‚   โ”œโ”€โ”€ ...
โ”œโ”€โ”€ eval
โ”‚   โ”œโ”€โ”€ README.md
โ”‚   โ”œโ”€โ”€ get_llm_responses.py
โ”‚   โ”œโ”€โ”€ eval-scripts
โ”‚   โ”‚   โ”œโ”€โ”€ ast_eval_{api_name}.py
โ”‚   โ”œโ”€โ”€ eval-data
โ”‚   โ”‚   โ”œโ”€โ”€ questions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ API name
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ questions_{api_name}_{eval_metric}.jsonl
โ”‚   โ”‚   โ”œโ”€โ”€ responses
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ API name
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ responses_{api_name}_Gorilla_FT_{eval_metric}.jsonl
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ responses_{api_name}_Gorilla_RT_{eval_metric}.jsonl
โ”œโ”€โ”€ inference
โ”‚   โ”œโ”€โ”€ README.md
โ”‚   โ”œโ”€โ”€ serve
โ”‚   โ”‚   โ”œโ”€โ”€ gorilla_cli.py
โ”‚   โ”‚   โ”œโ”€โ”€ conv_template.py
โ”œโ”€โ”€ openfunctions
|   โ”œโ”€โ”€ openfunctions-v1 (data and scripts for openfunctions-v0 and v1)
|   โ”œโ”€โ”€ utils (parsing script for openfunctions-v2)
|   โ”œโ”€โ”€ inference_* (openfunctions-v2 hosted/local inference code)

Contributing Your API

We aim to build an open-source, one-stop-shop for all APIs, LLMs can interact with! Any suggestions and contributions are welcome! Please see the details on how to contribute. THIS WILL ALWAYS REMAIN OPEN SOURCE.

FAQ(s)

  1. I would like to use Gorilla commercially. Is there going to be a Apache 2.0 licensed version?

Yes! We now have models that you can use commercially without any obligations.

  1. Can we use Gorilla with other tools like Langchain etc?

Absolutely! You've highlighted a great aspect of our tools. Gorilla is an end-to-end model, specifically tailored to serve correct API calls (tools) without requiring any additional coding. It's designed to work as part of a wider ecosystem and can be flexibly integrated within agentic frameworks and other tools.

Langchain, is a versatile developer tool. Its "agents" can efficiently swap in any LLM, Gorilla included, making it a highly adaptable solution for various needs.

The beauty of these tools truly shines when they collaborate, complementing each other's strengths and capabilities to create an even more powerful and comprehensive solution. This is where your contribution can make a difference. We enthusiastically welcome any inputs to further refine and enhance these tools.

Check out our blog on How to Use Gorilla: A Step-by-Step Walkthrough to see all the different ways you can integrate Gorilla in your projects.

Project Roadmap

In the immediate future, we plan to release the following:

  • BFCL metrics to evaluate contamination
  • BFCL systems metrics including cost and latency
  • BFCL update with "live" data and user-votes
  • Openfunctions-v3 model to support more languges and multi-turn capability
  • Berkeley Function Calling leaderboard (BFCL) for evaluating tool-calling/function-calling models [Feb 26, 2024]
  • Openfunctions-v2 with more languages (Java, JS, Python), relevance detection [Feb 26, 2024]
  • API Zoo Index for easy access to all APIs [Feb 16, 2024]
  • Openfunctions-v1, Apache 2.0, with parallel and multiple function calling [Nov 16, 2023]
  • Openfunctions-v0, Apache 2.0 function calling model [Nov 16, 2023]
  • Release a commercially usable, Apache 2.0 licensed Gorilla model [Jun 5, 2023]
  • Release weights for all APIs from APIBench [May 28, 2023]
  • Run Gorilla LLM locally [May 28, 2023]
  • Release weights for HF model APIs [May 27, 2023]
  • Hosted Gorilla LLM chat for HF model APIs [May 27, 2023]
  • Opening up the APIZoo for contributions from community
  • Dataset and Eval Code

Propose a new task you would like to work on ๐Ÿคฉ

Citation

If you use Gorilla or APIBench, please cite our paper:

@article{patil2023gorilla,
  title={Gorilla: Large Language Model Connected with Massive APIs},
  author={Shishir G. Patil and Tianjun Zhang and Xin Wang and Joseph E. Gonzalez},
  year={2023},
  journal={arXiv preprint arXiv:2305.15334},
} 

gorilla's People

Contributors

abhi-databricks avatar amiraflak avatar aryanvichare avatar benjaminhuo avatar cansakirt avatar charliejcj avatar dangeo773 avatar danielskry avatar eltociear avatar elva01 avatar fanjia-yan avatar felixzhu555 avatar hannesgith avatar joedevon avatar meenakshi-mittal avatar morganmcg1 avatar mzamini92 avatar rajveer43 avatar ramanv0 avatar raywanb avatar saikolasani avatar shawnharmsen avatar shishirpatil avatar tanmaydoesai avatar tianjunz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.