Integrating Groq with Google ADK using LiteLLM

integrating-groq-with-google-adk-using-litellm

I recently tried to integrate Groq models with Google ADK to build an agent and ran into some challenges. There’s no official documentation on either side for direct integration, which made it tricky at first.

After digging through the docs:

From the ADK documentation, I learned that ADK can integrate LiteLLM as an LLM backend.

From the Groq documentation, I found that Groq models can be accessed through LiteLLM by using the model name in this format:

groq/

This was the key insight — LiteLLM acts as a bridge between Groq and ADK.

Here’s the minimal setup I used:

from dotenv import load_dotenv
from google.adk.agents import Agent
from google.adk.models.lite_llm import LiteLlm

load_dotenv()

model = LiteLlm(
    model="groq/llama-3.3-70b-versatile",  # use "groq/"
)

root_agent = Agent(
    name="greeting_agent",
    model=model,
    description="This agent greets the user.",
    instruction="""
    You are a helpful assistant that greets the users. Ask for the user's name and greet them by name.
    """
)

With this setup, the agent works perfectly. It uses Groq under the hood via LiteLLM, while ADK handles the orchestration.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
marketing-career-path-report:-what-100+-marketers-told-us-about-growth-and-job-security

Marketing career path report: What 100+ marketers told us about growth and job security

Next Post
when-growth-backfires:-managing-product-market-fit-drift-in-fast-scaling-companies

When growth backfires: Managing product-market fit drift in fast scaling companies

Related Posts