Skip to content

Instantly share code, notes, and snippets.

@israelshirk
Last active May 21, 2026 21:01
Show Gist options
  • Select an option

  • Save israelshirk/d33f8c3740d118450784384b2cffcc65 to your computer and use it in GitHub Desktop.

Select an option

Save israelshirk/d33f8c3740d118450784384b2cffcc65 to your computer and use it in GitHub Desktop.
2026-05-21 - Extends Google ADK on Kaggle to use Groq/Kimi

Install underlying dependencies, they're outdated (this takes a while)

The extras included in the upgrade are to catch already-installed conflicts.

%pip install -UUv dotenv 'google-adk[extensions]' google-adk google-colab bigframes cesium datasets dopamine-rl gcsfs gradio langchain mlxtend plotnine pydrive2 toolbox-adk transformers

Load Groq API key from env secrets

import os
from kaggle_secrets import UserSecretsClient

try:
    GROQ_API_KEY = UserSecretsClient().get_secret("GROQ_API_KEY")
    os.environ["GROQ_API_KEY"] = GROQ_API_KEY
    print("✅ Groq API key setup complete.")
except Exception as e:
    print(
        f"🔑 Authentication Error: Please make sure you have added 'GROQ_API_KEY' to your Kaggle secrets. Details: {e}"
    )

Initiate ADK session with Groq/KIMI

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

load_dotenv()

root_agent = Agent(
    name="greeting_agent",
    model=LiteLlm(
        model="groq/moonshotai/kimi-k2-instruct-0905",  # use "groq/<groq-model-name>"
    ),
    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.
    """
)

print("Groq imported successfully with Kimi K2 open-source model. ✅")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment