This repository contains a Python agent for the Hugging Face Agents Course final assignment. The static page presents its source; the runner executes on a computer with the documented backend. This Space does not host a live agent or an inference API.
The selected final-assignment backend is codex_agent.py: it uses an installed, already signed-in Codex CLI and native live web search to research each question. It uses the CLI's default model and existing authentication without reading or copying credentials. Existing account usage limits apply; this repository does not purchase credits or configure a new provider key.
The runner fetches current evaluation questions from the official course API and generates answers dynamically. It contains no benchmark answer table. Each question gets a separate ephemeral CLI invocation, a read-only sandbox, disabled shell tooling, a strict JSON output schema, and a 240-second default time limit. Instructions allow public research only and prohibit account/file inspection, private data, answer-key searches, and external mutations. Unavailable attachments and unresolved questions receive explicit empty answers.
Requires Python and an installed, already signed-in Codex CLI available as codex. The program never performs a login or changes account configuration.
python3 codex_agent.py
Use --ids UUID,UUID to run selected questions and --force to rerun completed results. Completed runs resume automatically. codex-runs/answers.json contains generated answers; each question directory includes its exact prompt, CLI event trace, raw structured answer, status/error, and timing. A successful invocation does not establish factual correctness.
agent.py preserves an experimental smolagents.CodeAgent backend using a local 4-bit Qwen2.5 Coder 7B model through MLXModel. This backend was explored locally; the selected final-assignment runner above is separate.
Requires Apple silicon, sufficient memory/disk space, Python, and ffmpeg for audio. The first run downloads several GB of public model assets.
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python agent.py
Use --ids UUID,UUID to run selected questions and --force to rerun previously completed ones. Existing results are resumed automatically. The model and document caches remain beside the script.
MLX tools include public web search, webpage/PDF reading with focused section lookup, attachment reading, spreadsheet parsing, local Whisper audio transcription, bounded arithmetic, and text operations. Its text model cannot visually inspect images. runs/answers.json and question traces are separate from the selected backend's codex-runs/ data.
.venv/bin/python prepare_submission.py --username YOUR_HF_USERNAME --code-link https://huggingface.co/spaces/YOUR_HF_USERNAME/YOUR_SPACE/tree/main
This checks for a complete, unique set of results and creates codex-runs/submission.json for review. Add --backend mlx only to use optional MLX results. The helper never submits automatically. The course API is the authority for the score and certificate eligibility. No submission or passing score is implied merely by running either backend.
For a question explicitly requesting a comma-separated or comma-delimited list, the helper canonicalizes only delimiter whitespace to a comma followed by one space, unless the question explicitly forbids spaces. It does not change answer content. Raw model results and traces remain intact; each changed string is recorded in submission-formatting.json for inspection.
The project was prepared with AI assistance. Its outputs should not be treated as evidence of a person's independent understanding.
unit3-gala-source.zip contains the separate local Alfred gala implementation (app.py, retriever.py, tools.py, pinned requirements, and execution notes). Its tools use the public course invitees dataset, BM25 retrieval, public web search, Hub model statistics, and explicitly simulated weather. The MLX implementation runs on Apple Silicon.