Toolhouse is the first Backend-as-a-Service for the agentic stack. Toolhouse allows you to define agents as configuration, and to deploy them as APIs. Toolhouse agents are automatically connected to 40+ tools including RAG, MCP servers, web search, webpage readers, memory, storage, statefulness and more. With Toolhouse, you can build both conversational and autonomous agents without the need to host and maintain your own infrastructure.
You can use Groq’s fast inference with Toolhouse. This page shows you how to use Llama 4 Maverick and Groq’s Compound Beta to build a Toolhouse agent.
Download the Toolhouse CLI by typing this command on your Terminal:
npm i -g @toolhouseai/cli
Log into Toolhouse via the CLI:
th login
Follow the instructions to create a free Sandbox account.
Generate a Groq API Key in your Groq Console, then copy its value.
In the CLI, set your Groq API Key:
th secrets set GROQ_API_KEY=(replace this with your Groq API Key)
You’re all set! From now on, you’ll be able to use Groq models with your Toolhouse agents. For a list of supported models, refer to the Toolhouse models page.
To use a specific model, simply reference the model identifier in your agent file, for example:
@groq/meta-llama/llama-4-maverick-17b-128e-instruct
@groq/meta-llama/llama-4-scout-17b-16e-instruct
Here’s an example of a working agent file. You can copy this file and save it as groq.yaml
. In this example, we use an image generation tool, along with Maverick.
title: "Maverick Example"
prompt: "Tell me a joke about this topic: {topic} then generate an image!"
vars:
topic: "bananas"
model: "@groq/meta-llama/llama-4-maverick-17b-128e-instruct"
public: true
Then, run it:
th run groq.yaml
You will see something like this:
━━━━ Stream output for joke ━━━━
Why did the banana go to the doctor? Because it wasn't peeling well!
Using MCP Server: image_generation_flux()
Why did the banana go to the doctor? Because it wasn't peeling well!

━━━━ End of stream for joke ━━━━
If the results look good to you, you can deploy this agent using th deploy groq.yaml
Compound Beta is an advanced AI system that is designed to agentically search the web and execute code, while being optimized for latency.
To use Compound Beta, simply specify @groq/compound-beta
or @groq/compound-beta-mini
as the model identifier. In this example, Compound Beta will search the web under the hood. Save the following file as groq.yaml
:
title: Compound Example
prompt: Who are the Oilers playing against next, and when/where are they playing? Use the current_time() tool to get the current time.
model: "@groq/compound-beta"
Run it with the following command:
th run compound.yaml
You will see something like this:
━━━━ Stream output for compound ━━━━
The Oilers are playing against the Florida Panthers next. The game is scheduled for June 12, 2025, at Amerant Bank Arena.
━━━━ End of stream for compound ━━━━
Then to deploy the agent as an API:
th deploy