Why I wrote this

I have loved technology since I was a kid. I was the one who opened every menu in the phone settings, played with JavaScript, and showed people Google's satellite maps when nobody around me had seen them. I once put a Samsung ROM on a Huawei phone just to see if I could.

I studied architecture at Unity University, but AI is where my curiosity kept taking me. About three years ago I was already generating images and music with AI, and telling my friends that one day everyone would have their own agents, each with a profession, working for them. They started calling me "the AI guy". Since then I have taken the 5 Million Ethiopian Coders course, built automations, made videos with ComfyUI, run models offline on my own PC, and tried almost every AI assistant I could find.

I joined the AMD AI League for two honest reasons: the prize money, and the skills. I want to work as an AI engineer, and one day start a tech company in Ethiopia.

The challenge

Match 4 of the AMD AI League, run by lablab and AMD, asks for an agent that takes a plain question, goes out on the live web, and comes back with the exact answer and the page that proves it. It runs as a Docker image on AMD's ROCm base, graded on an AMD GPU. Here is how I built mine, and what I learned.

The real problem is not the model

My first instinct was to pick the biggest model that fits. That was the wrong place to start. A model can only answer from what you put in front of it, so most of the work is getting the right 1,500 words onto the page.

Step 1: never depend on one search engine

From inside a container, any single search engine may block you. So the agent asks several at once (DuckDuckGo, Bing, Wikipedia, Mojeek, Yahoo) and merges the results. If the question includes a starting URL, it also crawls that site, following the links whose text best matches the question first.

Step 2: clean pages properly

It fetches up to 8 pages in parallel, HTML and PDF. Menus, footers and cookie banners are thrown away. The detail that mattered most: tables are flattened into label: value lines. Many answers live in infoboxes and spec tables, and plain text extraction turns those into soup.

Step 3: rank before you read

The text is cut into chunks of about 90 words and ranked with BM25, an old keyword method with no GPU cost. Only the best 1,500 words or so go to the model.

Step 4: a small model, kept warm

The model is Qwen3-4B-Instruct in bf16 on the AMD GPU through PyTorch on ROCm. A small server inside the container loads the weights once at start. Each question then costs web time plus one short request, not a model load. The model must return strict JSON: the shortest exact answer, its source and a supporting quote.

Step 5: check the answer against the page

This is the part I am proudest of. The answer has to literally appear on a page the agent actually fetched. If it does not, the agent follows the best links one level deeper, searches again with a rewritten question, and if that fails it returns an empty answer. An honest blank beats a confident wrong answer.

My favourite moment

One slow search engine was quietly breaking everything. The agent waited so long for it that it had about one second left to actually read pages. Finding that, and fixing it so that no single engine can hold up the others, was the best moment of the whole build. There is now a test for it.

Lessons from running on ROCm

  • Build for linux/amd64 and leave the ROCm base layers untouched. The base is about 29 GiB, too big for a hosted CI runner to unpack, so I append my layers on top of it with crane without ever pulling it apart.
  • Keep stdout clean. Graders parse it. My logs go to a file.
  • Give every question one shared deadline, and always write an output file, even on failure.
  • Test without a GPU first. I built a fake web and a fake model so I could run seven tricky questions offline: decoy years in a footer, a PDF, a rumour page that disagrees with the spec table, and a question with no answer.

If you are a student

Just start. Use the free credits. You do not need a computer science degree. Compete anyway.

Ask me anything in the comments. I will answer.

The source is on GitHub: https://github.com/abrsh43210/amd-league-mc4-web-public

Built for the AMD AI League (lablab x AMD): https://lablab.build/ai-hackathons/amd-lablab-ai-academy-challenge (I used an AI coding assistant while building this.)