GAIA Final Assignment - Agent Code

Agent for the Hugging Face Agents Course final assignment. It answers the 20 GAIA level-1 questions and submits them to the course scoring API.

Source files

FilePurpose
app.pyGradio entry point: login, run, submit, per-question table.
gaia_agent/agent.pyReAct loop: one strict JSON object per turn, JSON repair, forced-answer fallback, final formatting pass.
gaia_agent/llm.pyLLM backends: local MLX (Qwen3-8B-4bit), any OpenAI-compatible endpoint, HF router, keyless Pollinations.
gaia_agent/tools.pyWeb search, page reading, Wikipedia API with parsed tables, YouTube captions, Python execution, attachment parsing (xlsx/pdf/docx/csv/py), Whisper transcription, image inspection.
gaia_agent/data.pyQuestion fetching, attachment download with mirror fallback, submission.
gaia_agent/vlm_worker.pyVision model in a throwaway process so it never competes with the 8B text model for memory.
run_eval.pyCLI runner: --all, --task, --list, --submit.
requirements.txtPython dependencies of the Space-side code.

How it works

question -> model proposes {"thought", "tool", "input"}
          -> tool runs (search / wikipedia / python / transcript / attachment / vision)
          -> observation appended -> next turn
          -> model emits {"thought", "answer"} -> formatting pass -> submitted

Notes

The agent was developed and run locally on Apple Silicon with a keyless local model (mlx-lm, mlx-whisper, mlx-vlm), about 4 s per model call. This Space hosts the code only: running the full evaluation needs a GPU runtime or an API key supplied through OPENAI_BASE_URL / OPENAI_API_KEY.