Instructions to use gorilla-llm/gorilla-openfunctions-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gorilla-llm/gorilla-openfunctions-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gorilla-llm/gorilla-openfunctions-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gorilla-llm/gorilla-openfunctions-v2") model = AutoModelForCausalLM.from_pretrained("gorilla-llm/gorilla-openfunctions-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gorilla-llm/gorilla-openfunctions-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gorilla-llm/gorilla-openfunctions-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gorilla-llm/gorilla-openfunctions-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gorilla-llm/gorilla-openfunctions-v2
- SGLang
How to use gorilla-llm/gorilla-openfunctions-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "gorilla-llm/gorilla-openfunctions-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gorilla-llm/gorilla-openfunctions-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "gorilla-llm/gorilla-openfunctions-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gorilla-llm/gorilla-openfunctions-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gorilla-llm/gorilla-openfunctions-v2 with Docker Model Runner:
docker model run hf.co/gorilla-llm/gorilla-openfunctions-v2
Commit History
-
Update tokenizer_config.json, correcting DeepSeek to Gorilla LLM
Verified signature- Update tokenizer_config.json, correcting DeepSeek to Gorilla LLM - Credit https://huggingface.co/gorilla-llm/gorilla-openfunctions-v2/discussions/2, spotted by @CISCai1f6ac3b
-
Update README.md
Verified signature0f91d70
-
Update README.md
Verified signaturea37bc6d -
Update README.md
Verified signatureeedf71a -
Update README.md
Verified signature436f19e
-
Update README.md
Verified signature0383bee -
Update README.md
Verified signature040ab93 -
Update README.md
Verified signature1deaa30
-
Update README with the local inference update
Verified signaturebb0fe27
-
Update README.md
Verified signature3fd971c -
Upload 2 files
Verified signatureAdded merges.txt, vocab.json (derived from `tokenizer.json`), useful for GGUF quantization procedures.ceff6f1
-
fixed README \n issue
21354e3 -
update README
37d1cd9 -
[add] README instruction on file dependencies, linked to github
68a6ac1
-
Update README.md
Verified signatureUpdate the format of the model chatting673a424
-
model upload
Shishir Patilmerge rm6225f84 -
initial commit
Verified signature0302bf4