Registry / llm-agents / llama-index-llms-groq

llama-index-llms-groq

JSON →
library0.5.0pypypi✓ verified 84d ago

LlamaIndex integration for Groq LLMs, providing high-speed inference via Groq's hardware-accelerated API. Version 0.5.0 requires Python 3.10+ and supports LlamaIndex v0.11+ with the new import structure. Released on PyPI; updates follow LlamaIndex releases.

pip install llama-index-llms-groq
INSTALL
IMPORT
SIG · LLAMA-INDEX-LLMS-G
L
llama-index-llms-groq
llm-agentspythonv0.5.0
Install
27.5s avg
Import
11718ms
Disk
412MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 9.782s · 399.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 27.5s · import 8.966s · 377MB
412MB installed
● package 412MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Groq
from llama_index.llms.groq import Groq
from llama_index.llms.groq import Groq as GroqLLM
Correct import path; the class is named 'Groq' directly.
Groq
from llama_index.llms.groq import Groq
from llama_index.llms.groq import GroqDeprecated
No deprecated alias exists; use the standard import.

Instantiate Groq LLM and call complete()

import os from llama_index.llms.groq import Groq api_key = os.environ.get("GROQ_API_KEY", "") if not api_key: raise ValueError("Set GROQ_API_KEY environment variable") llm = Groq(model="mixtral-8x7b-32768", api_key=api_key) response = llm.complete("What is Groq?") print(response)
Debug
Known issues
breakingLlamaIndex v0.11 introduced a new package structure: 'llama-index-llms-groq' instead of the old monolithic 'llama-index' plus 'llama-index[groq]'. Code using 'from llama_index.llms import Groq' from the old package must be updated to 'from llama_index.llms.groq import Groq'.
fix
Run 'pip install llama-index-llms-groq' and update all import paths to 'from llama_index.llms.groq import Groq'
affects: <0.11
deprecatedThe 'llama-index' meta-package (version <0.11) included all integrations by default. As of v0.11, integrations are separate packages to reduce bloat. The meta-package no longer includes Groq automatically.
fix
Install 'llama-index-llms-groq' explicitly
affects: <0.11
gotchaThe package does not automatically load the GROQ_API_KEY from environment variables; you must pass it explicitly or set it via 'llm = Groq(model=..., api_key=os.environ["GROQ_API_KEY"])'.
fix
Always provide 'api_key' parameter or configure via environment variable in your code.
affects: all
gotchaSome models are token-limited (e.g., 'mixtral-8x7b-32768' has 32k context). Exceeding the limit will raise a 'ValueError: Request too large for model...'. Check model limits before streaming long documents.
fix
Use models with larger context windows (e.g., 'llama3-70b-8192' has 8k, 'gemma2-9b-it' has 8k) or chunk input.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'llama_index'
LlamaIndex core is not installed; 'llama-index-llms-groq' only depends on 'llama-index-core', not the full 'llama-index' meta-package.
fix
Run 'pip install llama-index-llms-groq' (installs 'llama-index-core' automatically). Alternatively, install full suite: 'pip install llama-index llama-index-llms-groq'.
ImportError: cannot import name 'Groq' from 'llama_index.llms'
Old-style import path. In LlamaIndex v0.11+, the LLM classes are in subpackages 'llama_index.llms.<provider>'.
fix
Use 'from llama_index.llms.groq import Groq'
AuthenticationError: API key not found. Pass your API key via the 'api_key' parameter or set the 'GROQ_API_KEY' environment variable.
Missing API key; the package does not read env vars automatically.
fix
Set environment variable 'GROQ_API_KEY' or pass 'api_key' parameter when initializing Groq.
Upgrade
Version history
0.5.0latest on PyPI · released Mar 12, 2026
Audit
Dependencies
llama-index-corerequiredCore LlamaIndex dependency, provides base classes like BaseLLM
groqrequiredOfficial Groq Python client for API calls
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
llama-index-llms-groq — pip install llama-index-llms-groq · libregistry