Skip to content

Google ADK

Google ADK (Agent Development Kit) standardizes agent development across Python, Java, TypeScript, and Go. Google ADK uses LiteLLM for model access. Configure LiteLLM to use Glitch by setting environment variables.

Google ADK uses LiteLLM models. Configure LiteLLM to point to Glitch:

import os
from google.adk.agents import LlmAgent
from google.adk.models.lite_llm import LiteLlm
# Configure LiteLLM to use Glitch for OpenAI models
# LiteLLM reads these environment variables
os.environ["OPENAI_API_BASE"] = "https://api.golabrat.ai/v1"
os.environ["OPENAI_API_KEY"] = os.environ["GLITCH_API_KEY"] # Your Glitch API key
# Create agent with Glitch-secured model
agent = LlmAgent(
model=LiteLlm(model="openai/gpt-4o"), # LiteLLM will route through Glitch
name="glitch_secured_agent",
instruction="You are a helpful assistant.",
)
import os
from google.adk.agents import LlmAgent
from google.adk.models.lite_llm import LiteLlm
# Configure LiteLLM to use Glitch
os.environ["OPENAI_API_BASE"] = "https://api.golabrat.ai/v1"
os.environ["OPENAI_API_KEY"] = os.environ["GLITCH_API_KEY"]
# Create agent - all LLM calls are secured via Glitch
agent = LlmAgent(
model=LiteLlm(model="openai/gpt-4o"),
name="my_agent",
instruction="You are a helpful assistant.",
)
# Use the agent
response = await agent.run("What is the capital of France?")
print(response)

Google ADK supports multiple models through LiteLLM. All models configured to use OpenAI-compatible endpoints will route through Glitch:

# OpenAI models (via Glitch)
agent_openai = LlmAgent(
model=LiteLlm(model="openai/gpt-4o"),
name="openai_agent",
instruction="You are a helpful assistant.",
)
# Anthropic models can also use Glitch if configured
# (Note: Glitch supports OpenAI-compatible endpoints)
agent_claude = LlmAgent(
model=LiteLlm(model="anthropic/claude-3-haiku-20240307"),
name="claude_agent",
instruction="You are a helpful assistant.",
)