CoolFace
Apppublic

mikarantanen/Tier3

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

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 — the GaiaAgent (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)

  1. 1.Create a public Space (SDK: Gradio) or duplicate this folder into one.
  2. 2.In Settings → Variables and secrets, set:
  3. 3.MODEL_ID = claude-sonnet-4-6 (default). The code adds the anthropic/ LiteLLM prefix automatically.
  4. 4.Secret ANTHROPIC_API_KEY = your Anthropic API key.
  5. 5.(Other options: gpt-4o/gpt-4o-mini + OPENAI_API_KEY, or an HF model id like Qwen/Qwen2.5-72B-Instruct + HF_TOKEN.)
  6. 6.Make sure the Space is public so .../tree/main resolves (required for submit).
  7. 7.Open the Space, log in, click Run Evaluation & Submit.

Local iteration (recommended before submitting)

powershell
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, raise max_steps in agent.py, or tighten the format rules in GAIA_SYSTEM_SUFFIX.