Home Knowledge Base Gorilla

Gorilla is a fine-tuned large language model specifically trained to generate accurate API calls, solving the critical problem of LLM hallucination when generating code for complex APIs — trained on a comprehensive dataset of API documentation from thousands of machine learning APIs (Hugging Face, PyTorch Hub, TensorFlow Hub), Gorilla generates syntactically correct function calls with proper parameters, types, and constraints that can be executed directly without the hallucinated arguments and invented parameters that plague general-purpose models.

What Is Gorilla?

How Gorilla Works

StepProcessBenefit
1. User prompt"Load a text-to-image model that runs on single GPU"Natural language intent
2. API retrievalFetch relevant documentationCurrent parameter info
3. Constraint matchingFilter by hardware/license requirementsPractical constraints
4. Code generationGenerate exact API call with correct paramsExecutable output
5. ValidationVerify against API schemaNo hallucinated args

Performance

MetricGorillaGPT-4ClaudeLLaMA-7B
API Call Accuracy90.1%72.8%68.5%32.1%
Hallucination Rate4.2%24.7%28.1%61.3%
Executable Output88.3%65.1%59.2%18.4%
Correct Parameters92.7%71.3%67.8%28.9%

Key Innovation: Gorilla achieves nearly 6× lower hallucination rate than GPT-4 on API generation tasks — the difference between code that runs and code that crashes with "argument not found" errors.

Significance

Gorilla is the pioneering API-specialized LLM that proved language models can be trained to generate reliable, executable code for complex APIs — reducing hallucination rates by 6× compared to general-purpose models and establishing the foundation for autonomous AI agents that interact with real-world software systems.

gorillaapicalling

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.