Instructions to use PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
Use Docker
docker model run hf.co/PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf with Ollama:
ollama run hf.co/PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
- Unsloth Studio
How to use PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf to start chatting
- Docker Model Runner
How to use PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf with Docker Model Runner:
docker model run hf.co/PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
- Lemonade
How to use PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull PsiPi/gorilla-llm_gorilla-openfunctions-v1-gguf:Q4_K_M
Run and chat with the model
lemonade run user.gorilla-llm_gorilla-openfunctions-v1-gguf-Q4_K_M
List all available models
lemonade list
- Atomic Chat
ggufs for the following
🚀 Try it out on Colab
📣 Read more in our OpenFunctions blog release
Introduction
Gorilla OpenFunctions extends Large Language Model(LLM) Chat Completion feature to formulate executable APIs call given natural language instructions and API context.
Models Available
| model | functionality |
|---|---|
| gorilla-openfunctions-v0 | Given a function, and user intent, returns properly formatted json with the right arguments |
| gorilla-openfunctions-v1 | + Parallel functions, and can choose between functions |
Example Usage
- OpenFunctions is compatible with OpenAI Functions
!pip install openai==0.28.1
- Point to Gorilla hosted servers
import openai
def get_gorilla_response(prompt="Call me an Uber ride type \"Plus\" in Berkeley at zipcode 94704 in 10 minutes", model="gorilla-openfunctions-v0", functions=[]):
openai.api_key = "EMPTY"
openai.api_base = "http://luigi.millennium.berkeley.edu:8000/v1"
try:
completion = openai.ChatCompletion.create(
model="gorilla-openfunctions-v1",
temperature=0.0,
messages=[{"role": "user", "content": prompt}],
functions=functions,
)
return completion.choices[0].message.content
except Exception as e:
print(e, model, prompt)
- Pass the user argument and set of functions, Gorilla OpenFunctions returns a fully formatted json
query = "Call me an Uber ride type \"Plus\" in Berkeley at zipcode 94704 in 10 minutes"
functions = [
{
"name": "Uber Carpool",
"api_name": "uber.ride",
"description": "Find suitable ride for customers given the location, type of ride, and the amount of time the customer is willing to wait as parameters",
"parameters": [{"name": "loc", "description": "location of the starting place of the uber ride"}, {"name":"type", "enum": ["plus", "comfort", "black"], "description": "types of uber ride user is ordering"}, {"name": "time", "description": "the amount of time in minutes the customer is willing to wait"}]
}
]
get_gorilla_response(query, functions=functions)
- Expected output
uber.ride(loc="berkeley", type="plus", time=10)
Contributing
All the models, and data used to train the models is released under Apache 2.0. Gorilla is an open source effort from UC Berkeley and we welcome contributors. Please email us your comments, criticism, and questions. More information about the project can be found at https://gorilla.cs.berkeley.edu/
- Downloads last month
- 16
3-bit
4-bit
5-bit
6-bit