Groq is the public alias for GroqToolCallingProvider. This guide derives its constructor from MTPX 0.1.37.
Install and configure
bashpython -m pip install "mtpx[groq]"
mtp doctor --provider groqSet GROQ_API_KEY in your process environment before constructing the provider. The SDK does not automatically load .env. To use a .env file, install mtpx[dotenv] and call Agent.load_dotenv_if_available() first.
Constructor model defaults below come from this release's code. They are offline defaults, not a guarantee of current provider availability or account access. Enter an available model ID, or use /model in the terminal UI to discover models.
Create an agent
pythonfrom mtp import Agent
from mtp.providers import Groq
from mtp.toolkits import CalculatorToolkit
tools = Agent.ToolRegistry()
tools.register_toolkit_loader("calculator", CalculatorToolkit())
provider = Groq()
agent = Agent.MTPAgent(provider=provider, tools=tools)
print(agent.run("What is 25 * 4 + 10?", max_rounds=4))This example makes a provider request. The offline quickstart needs no credentials.
Constructor reference
| Parameter | Annotation | Source default |
|---|---|---|
model | str | 'openai/gpt-oss-120b' |
api_key | str | None | None |
system_prompt | str | None | None |
temperature | float | 0.0 |
tool_choice | str | dict[str, Any] | 'auto' |
parallel_tool_calls | bool | True |
encourage_batch_tool_calls | bool | True |
strict_dependency_mode | bool | False |
include_reasoning | bool | None | None |
reasoning_format | str | None | None |
reasoning_effort | str | None | None |
stream_include_usage | bool | True |
client | Any | None | None |
Inspect capabilities
pythonprint(provider.capabilities())Capabilities describe the adapter's tools, streaming, media, structured output, and async behavior. The selected model and account can impose further restrictions. See the provider contract.
The adapter declares the following contract in this source release:
pythondef capabilities(self) -> ProviderCapabilities:
return ProviderCapabilities(
provider="groq",
supports_tool_calling=True,
supports_parallel_tool_calls=bool(self.parallel_tool_calls),
input_modalities=["text", "image"],
supports_tool_media_output=True,
supports_finalize_streaming=True,
usage_metrics_quality=USAGE_METRICS_RICH,
supports_reasoning_metadata=True,
structured_output_support=STRUCTURED_OUTPUT_CLIENT_VALIDATED,
supports_native_async=False,
allow_finalize_stream_fallback=True,
)