> Markdown version of https://www.imranjan.cn/projects/p-gantry for AI agents and other programs. It carries the same public information as the web page. Built 2026-11-24.

October 2026

# Gantry

AI production crew for football broadcasts

Inside the Game: Microsoft and Premier League Developer Hackathon

An AI production crew I built for the Microsoft and Premier League hackathon. From one synthetic match it produces a separate live broadcast for each kind of viewer, each with its own commentary, voice, camera, replays and language.

Tags: Hackathon, Multi-Agent, Microsoft Foundry, Three.js

![Gantry](https://www.imranjan.cn/images/projects/gantry-2026/cover.svg)

### Project resources

The code is public on GitHub; the README covers running it locally. The live demo opens directly, though the first load can take about half a minute to start. The demo video is on YouTube.

[Source code](https://github.com/narmi924/gantry)
[Watch the demo](https://youtu.be/vPupkhUmb2c)
[Try the live demo](https://gantry.salmondune-004c8a8a.eastus2.azurecontainerapps.io)

## Event

#### Hackathon

Inside the Game Microsoft and Premier League Developer Hackathon

- **Organizer**: Microsoft and the Premier League
- **Challenge**: Build AI on synthetic football data that turns match events into explainable insight, live commentary and recaps, giving analysts and casual fans two different experiences
- **Result**: Not among the winners
[Hackathon website](https://developer.microsoft.com/en-us/reactor/series/S-1709/)

#### Entrant

- [Me](https://github.com/narmi924)
Architected the system and the match simulation; accelerated prototyping and modules with Claude Code.
- **Time**: Seven days
- **Code**: About 10,000 lines of Python and TypeScript
- **Runtime**: One container on Azure Container Apps, signed in with a managed identity

## Background

A rights holder carries one match to millions of people who want different things from it: new fans want the rules explained, data-minded fans want pressing and space, some care about one player, and blind fans need someone to describe what is happening. Every extra commentary track needs another crew, so most matches get one or two.

Gantry is an AI production crew. It watches a synthetic match through full player tracking, works out what matters from the numbers, and produces a separate live broadcast for each kind of viewer, each with its own commentary, voice, camera, graphics, replays and language. Everything is timed to the picture as a machine-readable rundown.

The match comes from a simulator I wrote for it: two fictional clubs, Kingsmere FC and Ashvale Athletic, 22 players and the ball at 10 frames a second, 57,601 frames of tracking and about 3,600 events.

![The Gantry gallery: four broadcasts of the same goal, with the AI crew's talkback on the right](https://www.imranjan.cn/images/projects/gantry-2026/gallery.jpg)

The gallery: four broadcasts call the same goal at the same moment, with the crew's talkback on the right.

## How it works

Open the demo and press "Watch the first goal, with sound"; the gallery opens a few seconds before Aldana's goal.

![The four broadcasts: New fan, Analyst, Following No. 10 and Audio described](https://www.imranjan.cn/images/projects/gantry-2026/feeds.jpg)

Who is on top for the new fan, who controls which space for the analyst, Aldana's numbers for his followers, and a picture that can be left dark for the audio-described feed.

### Four broadcasts, each its own

New fan explains in plain words why a moment matters and explains a rule when it comes up. Analyst gives the mechanism and the numbers: pressing, space, pass difficulty, xG, the defensive line. Following No. 10 keeps the camera on Nico Aldana with a partisan voice. Audio described says where the ball is, who has it and which way they attack; with headphones on, the voice moves left and right with the ball.

You can also build your own feed: pick a style, a club, a player to follow, the one number you care about and one of eight languages, and the crew starts producing it. A feed in another language is entirely in that language, down to player and club names in its own script.

![The analyst feed three seconds before a shot, with the calls and replays already made](https://www.imranjan.cn/images/projects/gantry-2026/rundown.jpg)

Three seconds before the shot, every feed's call and replay is already in the rundown.

### A rundown 15 seconds ahead

The crew works 15 seconds ahead of the picture, like a broadcast delay. The Rundown tab shows what the crew has made that viewers have not seen yet: three seconds before a shot, every feed's call and replay angle are already booked.

Viewers can type a question or press V and speak; the answer only uses what the viewer has already seen, with a replay of the moment. The rundown also goes out through an API as JSON and WebVTT captions, and over MCP to other AI assistants.

## Implementation

The crew is organised like a real broadcast team. Each role is an executor in a Microsoft Agent Framework workflow, and the feeds are written in parallel, each by its own agent. Every number said on air is computed in code from the tracking and events: speed and sprints, distance, pass difficulty, shot speed and xG, PPDA, momentum, which team would reach each patch of grass first, how high each back four is holding. The models only tell the story.

When a goal comes, two workflow runs start at once: the call goes straight to the commentators so every feed calls it as it happens, and the analysis waits for the stats desk and the director and goes out over the replay. In the demo match, all 12 calls of the three goals across four feeds come within 0.3 seconds of the ball crossing the line.

![Gantry architecture: the synthetic match, the AI production crew, the server and the Azure services](https://www.imranjan.cn/images/projects/gantry-2026/architecture.png)

The synthetic match feeds the AI crew; its rundown goes out as a live stream, an API and an MCP server.

##### Stats desk and director

The stats desk finds the moments worth covering and says why they matter. The director decides, feed by feed, who speaks, about what, with which graphic and replay angle; when the model is slow, it falls back to its own rules.

##### Commentators and voices

One commentator agent per feed writes in the feed's language, style and point of view, and Azure AI Speech reads each line in that feed's own voice: 18 neural voices across eight languages.

##### Shared booth

All feeds share one picture of what is on air: every feed's booked lines, the air kept for big moments, the storylines already told. Bookings and substitutions are never dropped; when the air is busy they wait for the next gap.

##### The show goes on

Every model call has a deadline. A slow director falls back to rules, a slow commentator to a prepared line, a stalled voice to captions, and a moment that takes too long is dropped rather than holding up the next. A crew failure never takes the picture down.

### Technologies

#### Simulation

PythonNumPy

#### AI crew

Microsoft Agent FrameworkMicrosoft FoundryAzure AI Speech

#### Server and picture

FastAPIWebSocketReactThree.js

#### Deployment

Azure Container AppsEntra IDGitHub Actions

## Problems solved

These four took the biggest changes.

##### Goals called a minute late

**Problem**In the pre-produced match, the median goal call came 61.6 seconds late. Production ran at four times speed and the crew could not keep up, and Agent Framework advances in supersteps: messages sent in one step wait until the whole step has finished, so two model calls stood in front of the first shout of every goal.

**Fix**Split the call and the analysis into two runs that start together, so the call never waits for the analysis. Now every feed calls the goal within 0.3 seconds.

##### Finished analysis thrown away

**Problem**463 finished lines were dropped by the scheduler as "the moment has passed", 75% of what went on air was play-by-play, and not one booking or substitution was mentioned. Play-by-play was quick to write and took the slots first.

**Fix**Air is kept clear on every feed before big moments; bookings and substitutions are never dropped and wait for the next gap.

##### Audio description got teams and directions wrong

**Problem**The numbers were right; the mistakes were in who and where: a player put in the wrong team, an attack described in the wrong direction.

**Fix**House rules for every commentator: only names and numbers from the facts, every player in the right team, numbers said the way they are said aloud. The director reads each line before it goes out and sends it back once; if there is no time, a prepared line in the feed's language goes out instead.

##### Choosing the models

**Problem**New Azure subscriptions get no quota for the newest models, so the choice was among the small ones.

**Fix**I compared three: gpt-5.4-mini wrote best, while gpt-5-mini and gpt-4.1-mini invented details. Every line on air uses gpt-5.4-mini, and the other roles use gpt-5-mini.

## Results

The demo match: Kingsmere 2, Ashvale 1, with goals from Aldana (30'), Adekunle (75') and Bankole (90+3').

0.3 sfrom goal to the call on all four feeds

8languages

18neural voices

\~$1of model and speech per feed per match

__The demo match in numbers__
| Item                   | Result                                                                                              |
| ---------------------- | --------------------------------------------------------------------------------------------------- |
| Tracking data          | 57,601 frames, 22 players and the ball, 10 frames a second                                          |
| Match events           | About 3,600, of 25 kinds                                                                            |
| Goal calls             | 3 goals, 12 calls across four feeds, all within 0.3 s of the ball crossing the line                 |
| Fictional league       | 20 clubs, nine matchdays played, with the table, form, the last meeting and players' season numbers |
| Continuous integration | Lint, tests, front-end build and container image on every push                                      |

## Demo & Submission

The demo video is under two minutes and opens with four feeds calling the same goal. In the live demo you can switch feeds, ask questions and build your own feed, and the chapters jump straight to the half-time show and the 90+3' winner.

[![A frame from the Gantry demo video: Aldana scores in the 30th minute on the analyst feed](https://www.imranjan.cn/images/projects/gantry-2026/video-poster.jpg)Watch the demoOpens on YouTube](https://youtu.be/vPupkhUmb2c)

[Source code (GitHub)](https://github.com/narmi924/gantry)
[Live demo](https://gantry.salmondune-004c8a8a.eastus2.azurecontainerapps.io)

## Other pages

- [Home](https://www.imranjan.cn/index.md)
- [About me](https://www.imranjan.cn/about.md)
- [Projects](https://www.imranjan.cn/projects.md)
- [Photography](https://www.imranjan.cn/gallery.md)
- [LCIMS Cloud](https://www.imranjan.cn/projects/p-lcims.md)
- [imranjan.cn](https://www.imranjan.cn/projects/p-portfolio.md)
- [Gatehouse](https://www.imranjan.cn/projects/p-gatehouse.md)
- [PlusOne](https://www.imranjan.cn/projects/p-plusone.md)
- [BYOF Agent](https://www.imranjan.cn/projects/p-byof-agent.md)
- [Shopping Copilot by KI](https://www.imranjan.cn/projects/p-shopping-copilot.md)
- [Look2Act](https://www.imranjan.cn/projects/p-look2act.md)
- [AccessAudit - On-Chain Access Approval & Audit System](https://www.imranjan.cn/projects/p-accessaudit.md)
- [Eye Touch - Real-time Eye Tracking and Gaze Control System](https://www.imranjan.cn/projects/p-eyetouch.md)
- [China Collegiate Computer Competition—Mobile Application Innovation Contest](https://www.imranjan.cn/projects/p-yigui.md)
- [Nilufar Restaurant Expense Management System](https://www.imranjan.cn/projects/p-nilufar.md)
- [Voice-Interactive LED Light Panel](https://www.imranjan.cn/projects/p-led.md)
- ["Mengsheng Cup" Electronic Design Competition](https://www.imranjan.cn/projects/p-msb.md)
- [NUS SOC SWS 2024](https://www.imranjan.cn/projects/p-nus.md)

中文版本：https://www.imranjan.cn/zh/projects/p-gantry.md
