zwo.fyi — Building Workouts with AI (Jul 2023)
Getting noticed by industry leaders, coaches, and athletes.
Chat Demo
The Team — Just Me (Design and Engineering)
zwo.fyi presents an experimental experience where athletes collaborate with AI to create downloadable Zwift workouts. By sharing goals, how they feel, asking questions and iterating, athletes end up with downloadable cycling/running workouts that fulfil their training needs.
(1/2) Workout Library — Light
This project was curiosity-driven. I race triathlons and love experimenting with technology within the health and fitness space. I wanted to learn as much as possible, increase my chances of opportunity and connect with great people.
Awesome individuals and companies discovered the project. It was a fantastic opportunity to meet, learn from, and share my findings with some of them.
(1/2) Chat — Light
My goal for zwo.fyi was to create an engaging and enjoyable site that encourages user feedback. Over 350 AI-generated workouts have been downloaded from the platform. By combining this data with user feedback, we identified recurring strengths and weaknesses of AI (regarding workout generation and my application).
(1/2) Feedback Widget
The creativity of AI was valuable to coaches brainstorming new workouts. Large virtual indoor cycling companies have used zwo.fyi internally to build and create entertaining workouts. For example, asking for an 80s-themed threshold workout will produce amusing results.
Whilst most AI-generated workouts are valuable, many lack duration precision and need tweaking. For example, asking AI for a 90-minute tempo workout may result in a workout 10 minutes too short/long. I haven’t yet solved this engineering challenge.
Engineering
Main Tech Stack
Zwift workouts are .zwo files. These files contain XML elements and attributes that form the workout structure. Users can upload and use these workouts within the Zwift platform. Generating .zwo files reliably using AI presented a challenge that required experimentation.
(1/2) Profile — Light
Initially, I attempted to include example XML files in the AI prompt and request XML outputs. However, this approach frequently led to AI hallucinations, resulting in invalid files. I felt the complexity and length of the XML structure compromised reliability, as it consumed a significant portion of the AI's context window (conversation memory). Furthermore, more context = more tokens = more cost.
Emoji Overview
An approach that shifted all XML heavy lifting away from AI became the most successful. I created a custom JSON structure based on the workout XML that models workouts more efficiently. Any workout inputs/outputs from the AI utilise the JSON workout structure. Upon download, JSON workouts convert to .zwo files using application code.
The final approach had noticeable advantages:
- Relevant, reliable, fast and cheap workout generation.
- Workouts could be stored and analysed in Supabase.
- A tunable JSON structure to tweak based on feedback.
Cost estimations:
- Asking for a workout and receiving the workout costs ~$0.06.
- Asking for a workout, receiving the workout, asking for amendments and receiving the amended workout costs ~$0.13.
Up Next
AnatoMe — Measuring Human Mobility->
The university project that set everything in motion.