Image Agent
Code
1from kern.agent import Agent2from kern.media import Image3from kern.models.groq import Groq45agent = Agent(model=Groq(id="meta-llama/llama-4-scout-17b-16e-instruct"))67agent.print_response(8 "Tell me about this image",9 images=[10 Image(url="https://upload.wikimedia.org/wikipedia/commons/f/f2/LPU-v1-die.jpg"),11 ],12 stream=True,13)Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export GROQ_API_KEY=xxxInstall dependencies
1uv pip install -U groq kern-aiRun Agent
1python cookbook/11_models/groq/image_agent.py