mikarantanen/Tier3
0
GAIA Agent — Agents Course Unit 4 Final Assignment
A smolagents CodeAgent that answers the 20 GAIA Level-1 questions and submits to the course scoring API. Pass bar: ≥30% (6/20).
Files
app.py— Gradio UI + fetch/questions, run agent,POST /submit.agent.py— theGaiaAgent(web search, page visit, file download, spreadsheet reader).test_local.py— run the agent locally over a few questions without submitting.requirements.txt— dependencies.
Setup (Hugging Face Space)
- Create a public Space (SDK: Gradio) or duplicate this folder into one.
- In Settings → Variables and secrets, set:
MODEL_ID=claude-sonnet-4-6(default). The code adds theanthropic/LiteLLM prefix automatically.- Secret
ANTHROPIC_API_KEY= your Anthropic API key. - (Other options:
gpt-4o/gpt-4o-mini+OPENAI_API_KEY, or an HF model id likeQwen/Qwen2.5-72B-Instruct+HF_TOKEN.) - Make sure the Space is public so
.../tree/mainresolves (required for submit). - Open the Space, log in, click Run Evaluation & Submit.
Local iteration (recommended before submitting)
pip install -r requirements.txt
copy .env.example .env # then edit .env and paste your real ANTHROPIC_API_KEY
python test_local.py # runs a few questions, prints answers, no submit.env is loaded automatically (via python-dotenv) and is git-ignored — your key stays local and is never committed or pushed to the Space. On the Space itself, use Settings → Secrets instead (there is no .env there).
Tuning to pass
- Most points come from web search + correct answer formatting (exact match).
- File-attached questions need
download_task_file→ reader; don't skip them. - If stuck below 30%: try a stronger
MODEL_ID, raisemax_stepsinagent.py, or tighten the format rules inGAIA_SYSTEM_SUFFIX.
